Commit 5eda570e authored by Jeff Smith's avatar Jeff Smith Committed by Alexandre Julliard

gdiplus: Do not shrink UnitWorld lines below width 1.0.

parent 0cc30160
......@@ -2337,6 +2337,7 @@ GpStatus WINGDIPAPI GdipWidenPath(GpPath *path, GpPen *pen, GpMatrix *matrix,
if (status == Ok)
{
REAL anchor_pen_width = max(pen->width, 2.0);
REAL pen_width = (pen->unit == UnitWorld) ? max(pen->width, 1.0) : pen->width;
BYTE *types = flat_path->pathdata.Types;
last_point = points;
......@@ -2364,17 +2365,17 @@ GpStatus WINGDIPAPI GdipWidenPath(GpPath *path, GpPen *pen, GpMatrix *matrix,
if ((types[i]&PathPointTypeCloseSubpath) == PathPointTypeCloseSubpath)
{
if (pen->dash != DashStyleSolid)
widen_dashed_figure(flat_path, subpath_start, i, 1, pen, pen->width, &last_point);
widen_dashed_figure(flat_path, subpath_start, i, 1, pen, pen_width, &last_point);
else
widen_closed_figure(flat_path, subpath_start, i, pen, pen->width, &last_point);
widen_closed_figure(flat_path, subpath_start, i, pen, pen_width, &last_point);
}
else if (i == flat_path->pathdata.Count-1 ||
(types[i+1]&PathPointTypePathTypeMask) == PathPointTypeStart)
{
if (pen->dash != DashStyleSolid)
widen_dashed_figure(flat_path, subpath_start, i, 0, pen, pen->width, &last_point);
widen_dashed_figure(flat_path, subpath_start, i, 0, pen, pen_width, &last_point);
else
widen_open_figure(flat_path->pathdata.Points, subpath_start, i, pen, pen->width, pen->startcap, pen->customstart, pen->endcap, pen->customend, &last_point);
widen_open_figure(flat_path->pathdata.Points, subpath_start, i, pen, pen_width, pen->startcap, pen->customstart, pen->endcap, pen->customend, &last_point);
}
}
......
......@@ -1078,10 +1078,10 @@ static path_test_t widenline_dash_path[] = {
};
static path_test_t widenline_unit_path[] = {
{5.0, 9.5, PathPointTypeStart, 0, 1}, /*0*/
{50.0, 9.5, PathPointTypeLine, 0, 1}, /*1*/
{50.0, 10.5, PathPointTypeLine, 0, 1}, /*2*/
{5.0, 10.5, PathPointTypeLine|PathPointTypeCloseSubpath, 0, 1} /*3*/
{5.0, 9.5, PathPointTypeStart, 0, 0}, /*0*/
{50.0, 9.5, PathPointTypeLine, 0, 0}, /*1*/
{50.0, 10.5, PathPointTypeLine, 0, 0}, /*2*/
{5.0, 10.5, PathPointTypeLine|PathPointTypeCloseSubpath, 0, 0} /*3*/
};
static void test_widen(void)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment