Signed-off-by: Jeff Smith whydoubt@gmail.com --- dlls/gdiplus/tests/graphicspath.c | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-)
diff --git a/dlls/gdiplus/tests/graphicspath.c b/dlls/gdiplus/tests/graphicspath.c index 99f25930ca..eb59a5eb7d 100644 --- a/dlls/gdiplus/tests/graphicspath.c +++ b/dlls/gdiplus/tests/graphicspath.c @@ -1375,6 +1375,25 @@ static path_test_t widenline_capsquareanchor_thin_path[] = { {51.414211, 11.414213, PathPointTypeLine|PathPointTypeCloseSubpath, 0, 0}, /*7*/ };
+static path_test_t widenline_capsquareanchor_dashed_path[] = { + {5.0, 5.0, PathPointTypeStart, 0, 0}, /*0*/ + {35.0, 5.0, PathPointTypeLine, 0, 0}, /*1*/ + {35.0, 15.0, PathPointTypeLine, 0, 0}, /*2*/ + {5.0, 15.0, PathPointTypeLine|PathPointTypeCloseSubpath, 0, 0}, /*3*/ + {45.0, 5.0, PathPointTypeStart, 0, 1}, /*4*/ + {50.0, 5.0, PathPointTypeLine, 0, 1}, /*5*/ + {50.0, 15.0, PathPointTypeLine, 0, 1}, /*6*/ + {45.0, 15.0, PathPointTypeLine|PathPointTypeCloseSubpath, 0, 1}, /*7*/ + {12.071068, 2.928932, PathPointTypeStart, 0, 1}, /*8*/ + {12.071068, 17.071066, PathPointTypeLine, 0, 1}, /*9*/ + {-2.071068, 17.071066, PathPointTypeLine, 0, 1}, /*10*/ + {-2.071068, 2.928932, PathPointTypeLine|PathPointTypeCloseSubpath, 0, 1}, /*11*/ + {42.928928, 17.071068, PathPointTypeStart, 0, 0}, /*12*/ + {42.928928, 2.928932, PathPointTypeLine, 0, 0}, /*13*/ + {57.071068, 2.928932, PathPointTypeLine, 0, 0}, /*14*/ + {57.071068, 17.071068, PathPointTypeLine|PathPointTypeCloseSubpath, 0, 0}, /*15*/ + }; + static void test_widen_cap(void) { struct @@ -1383,6 +1402,7 @@ static void test_widen_cap(void) REAL line_width; const path_test_t *expected; INT expected_size; + BOOL dashed; BOOL todo_size; } caps[] = @@ -1404,9 +1424,11 @@ static void test_widen_cap(void) { LineCapDiamondAnchor, 10.0, widenline_capdiamondanchor_path, ARRAY_SIZE(widenline_capdiamondanchor_path) }, { LineCapArrowAnchor, 10.0, widenline_caparrowanchor_path, - ARRAY_SIZE(widenline_caparrowanchor_path), TRUE }, + ARRAY_SIZE(widenline_caparrowanchor_path), FALSE, TRUE }, { LineCapSquareAnchor, 0.0, widenline_capsquareanchor_thin_path, - ARRAY_SIZE(widenline_capsquareanchor_thin_path), TRUE }, + ARRAY_SIZE(widenline_capsquareanchor_thin_path), FALSE, TRUE }, + { LineCapSquareAnchor, 10.0, widenline_capsquareanchor_dashed_path, + ARRAY_SIZE(widenline_capsquareanchor_dashed_path), TRUE }, }; GpStatus status; GpPath *path; @@ -1420,6 +1442,11 @@ static void test_widen_cap(void) { status = GdipCreatePen1(0xffffffff, caps[i].line_width, UnitPixel, &pen); expect(Ok, status); + if (caps[i].dashed) + { + status = GdipSetPenDashStyle(pen, DashStyleDash); + expect(Ok, status); + }
status = GdipResetPath(path); expect(Ok, status);
Signed-off-by: Jeff Smith whydoubt@gmail.com --- dlls/gdiplus/graphicspath.c | 18 ++++++++++-------- dlls/gdiplus/tests/graphicspath.c | 16 ++++++++-------- 2 files changed, 18 insertions(+), 16 deletions(-)
diff --git a/dlls/gdiplus/graphicspath.c b/dlls/gdiplus/graphicspath.c index 0e62d7db7d..a7faec0f86 100644 --- a/dlls/gdiplus/graphicspath.c +++ b/dlls/gdiplus/graphicspath.c @@ -2130,14 +2130,6 @@ static void widen_open_figure(const GpPointF *points, GpPen *pen, int start, int
prev_point->next->type = PathPointTypeStart; (*last_point)->type |= PathPointTypeCloseSubpath; - - if (start_cap & LineCapAnchorMask) - add_anchor(&points[start], &points[start+1], - pen, start_cap, start_custom, last_point); - - if (end_cap & LineCapAnchorMask) - add_anchor(&points[end], &points[end-1], - pen, end_cap, end_custom, last_point); }
static void widen_closed_figure(GpPath *path, GpPen *pen, int start, int end, @@ -2385,6 +2377,16 @@ GpStatus WINGDIPAPI GdipWidenPath(GpPath *path, GpPen *pen, GpMatrix *matrix, widen_dashed_figure(flat_path, pen, subpath_start, i, 0, &last_point); else widen_open_figure(flat_path->pathdata.Points, pen, subpath_start, i, pen->startcap, pen->customstart, pen->endcap, pen->customend, &last_point); + + if (pen->startcap & LineCapAnchorMask) + add_anchor(&flat_path->pathdata.Points[subpath_start], + &flat_path->pathdata.Points[subpath_start+1], + pen, pen->startcap, pen->customstart, &last_point); + + if (pen->endcap & LineCapAnchorMask) + add_anchor(&flat_path->pathdata.Points[i], + &flat_path->pathdata.Points[i-1], + pen, pen->endcap, pen->customend, &last_point); } }
diff --git a/dlls/gdiplus/tests/graphicspath.c b/dlls/gdiplus/tests/graphicspath.c index eb59a5eb7d..78a9c442a4 100644 --- a/dlls/gdiplus/tests/graphicspath.c +++ b/dlls/gdiplus/tests/graphicspath.c @@ -1380,14 +1380,14 @@ static path_test_t widenline_capsquareanchor_dashed_path[] = { {35.0, 5.0, PathPointTypeLine, 0, 0}, /*1*/ {35.0, 15.0, PathPointTypeLine, 0, 0}, /*2*/ {5.0, 15.0, PathPointTypeLine|PathPointTypeCloseSubpath, 0, 0}, /*3*/ - {45.0, 5.0, PathPointTypeStart, 0, 1}, /*4*/ - {50.0, 5.0, PathPointTypeLine, 0, 1}, /*5*/ - {50.0, 15.0, PathPointTypeLine, 0, 1}, /*6*/ - {45.0, 15.0, PathPointTypeLine|PathPointTypeCloseSubpath, 0, 1}, /*7*/ - {12.071068, 2.928932, PathPointTypeStart, 0, 1}, /*8*/ - {12.071068, 17.071066, PathPointTypeLine, 0, 1}, /*9*/ - {-2.071068, 17.071066, PathPointTypeLine, 0, 1}, /*10*/ - {-2.071068, 2.928932, PathPointTypeLine|PathPointTypeCloseSubpath, 0, 1}, /*11*/ + {45.0, 5.0, PathPointTypeStart, 0, 0}, /*4*/ + {50.0, 5.0, PathPointTypeLine, 0, 0}, /*5*/ + {50.0, 15.0, PathPointTypeLine, 0, 0}, /*6*/ + {45.0, 15.0, PathPointTypeLine|PathPointTypeCloseSubpath, 0, 0}, /*7*/ + {12.071068, 2.928932, PathPointTypeStart, 0, 0}, /*8*/ + {12.071068, 17.071066, PathPointTypeLine, 0, 0}, /*9*/ + {-2.071068, 17.071066, PathPointTypeLine, 0, 0}, /*10*/ + {-2.071068, 2.928932, PathPointTypeLine|PathPointTypeCloseSubpath, 0, 0}, /*11*/ {42.928928, 17.071068, PathPointTypeStart, 0, 0}, /*12*/ {42.928928, 2.928932, PathPointTypeLine, 0, 0}, /*13*/ {57.071068, 2.928932, PathPointTypeLine, 0, 0}, /*14*/
Hold off on this one. I need to do more testing on multi-figure paths, and I expect I will be sending in a v2.
On Wed, Mar 4, 2020 at 11:54 AM Jeff Smith whydoubt@gmail.com wrote:
Signed-off-by: Jeff Smith whydoubt@gmail.com
dlls/gdiplus/tests/graphicspath.c | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-)
diff --git a/dlls/gdiplus/tests/graphicspath.c b/dlls/gdiplus/tests/graphicspath.c index 99f25930ca..eb59a5eb7d 100644 --- a/dlls/gdiplus/tests/graphicspath.c +++ b/dlls/gdiplus/tests/graphicspath.c @@ -1375,6 +1375,25 @@ static path_test_t widenline_capsquareanchor_thin_path[] = { {51.414211, 11.414213, PathPointTypeLine|PathPointTypeCloseSubpath, 0, 0}, /*7*/ };
+static path_test_t widenline_capsquareanchor_dashed_path[] = {
- {5.0, 5.0, PathPointTypeStart, 0, 0}, /*0*/
- {35.0, 5.0, PathPointTypeLine, 0, 0}, /*1*/
- {35.0, 15.0, PathPointTypeLine, 0, 0}, /*2*/
- {5.0, 15.0, PathPointTypeLine|PathPointTypeCloseSubpath, 0, 0}, /*3*/
- {45.0, 5.0, PathPointTypeStart, 0, 1}, /*4*/
- {50.0, 5.0, PathPointTypeLine, 0, 1}, /*5*/
- {50.0, 15.0, PathPointTypeLine, 0, 1}, /*6*/
- {45.0, 15.0, PathPointTypeLine|PathPointTypeCloseSubpath, 0, 1}, /*7*/
- {12.071068, 2.928932, PathPointTypeStart, 0, 1}, /*8*/
- {12.071068, 17.071066, PathPointTypeLine, 0, 1}, /*9*/
- {-2.071068, 17.071066, PathPointTypeLine, 0, 1}, /*10*/
- {-2.071068, 2.928932, PathPointTypeLine|PathPointTypeCloseSubpath, 0, 1}, /*11*/
- {42.928928, 17.071068, PathPointTypeStart, 0, 0}, /*12*/
- {42.928928, 2.928932, PathPointTypeLine, 0, 0}, /*13*/
- {57.071068, 2.928932, PathPointTypeLine, 0, 0}, /*14*/
- {57.071068, 17.071068, PathPointTypeLine|PathPointTypeCloseSubpath, 0, 0}, /*15*/
- };
static void test_widen_cap(void) { struct @@ -1383,6 +1402,7 @@ static void test_widen_cap(void) REAL line_width; const path_test_t *expected; INT expected_size;
} caps[] =BOOL dashed; BOOL todo_size;
@@ -1404,9 +1424,11 @@ static void test_widen_cap(void) { LineCapDiamondAnchor, 10.0, widenline_capdiamondanchor_path, ARRAY_SIZE(widenline_capdiamondanchor_path) }, { LineCapArrowAnchor, 10.0, widenline_caparrowanchor_path,
ARRAY_SIZE(widenline_caparrowanchor_path), TRUE },
ARRAY_SIZE(widenline_caparrowanchor_path), FALSE, TRUE }, { LineCapSquareAnchor, 0.0, widenline_capsquareanchor_thin_path,
ARRAY_SIZE(widenline_capsquareanchor_thin_path), TRUE },
ARRAY_SIZE(widenline_capsquareanchor_thin_path), FALSE, TRUE },
{ LineCapSquareAnchor, 10.0, widenline_capsquareanchor_dashed_path,
}; GpStatus status; GpPath *path;ARRAY_SIZE(widenline_capsquareanchor_dashed_path), TRUE },
@@ -1420,6 +1442,11 @@ static void test_widen_cap(void) { status = GdipCreatePen1(0xffffffff, caps[i].line_width, UnitPixel, &pen); expect(Ok, status);
if (caps[i].dashed)
{
status = GdipSetPenDashStyle(pen, DashStyleDash);
expect(Ok, status);
} status = GdipResetPath(path); expect(Ok, status);
-- 2.23.0