From: Bartosz Kosiorek gang65@poczta.onet.pl
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55717 --- dlls/gdiplus/graphicspath.c | 2 +- dlls/gdiplus/tests/graphicspath.c | 115 +++++++++++++++++++++++++++++- 2 files changed, 114 insertions(+), 3 deletions(-)
diff --git a/dlls/gdiplus/graphicspath.c b/dlls/gdiplus/graphicspath.c index b1e417842f8..7146f93229c 100644 --- a/dlls/gdiplus/graphicspath.c +++ b/dlls/gdiplus/graphicspath.c @@ -1804,7 +1804,7 @@ GpStatus WINGDIPAPI GdipIsOutlineVisiblePathPoint(GpPath* path, REAL x, REAL y,
if (stat != Ok) return stat; - + // if (graphics != NULL) // TODO Why we are checking Pen? if (pen->unit == UnitPixel && graphics != NULL) { stat = GdipCreateMatrix(&transform); diff --git a/dlls/gdiplus/tests/graphicspath.c b/dlls/gdiplus/tests/graphicspath.c index 89a7dd786de..a4a3a75045c 100644 --- a/dlls/gdiplus/tests/graphicspath.c +++ b/dlls/gdiplus/tests/graphicspath.c @@ -1998,7 +1998,7 @@ static void test_is_outline_visible_path_point(void) GpBitmap *bitmap; GpGraphics *graphics = NULL; GpPath *path; - GpPen *pen = NULL; + GpPen *pen, *penmm = NULL; GpStatus status; static const int width = 20, height = 20;
@@ -2019,6 +2019,10 @@ static void test_is_outline_visible_path_point(void) expect(Ok, status); ok(pen != NULL, "Expected pen to be initialized\n");
+ status = GdipCreatePen1((ARGB)0xffff00ff, 8.0f, UnitMillimeter, &penmm); + expect(Ok, status); + ok(penmm != NULL, "Expected pen to be initialized\n"); + /* With NULL pen */ result = 9; status = GdipIsOutlineVisiblePathPoint(path, 0.0, 1.0, NULL, graphics, &result); @@ -2095,7 +2099,7 @@ static void test_is_outline_visible_path_point(void) expect(Ok, status); expect(FALSE, result);
- /* Page Unit */ + /* Page Unit in Millimeters, Pen Unit in pixels */ GdipResetWorldTransform(graphics); status = GdipSetPageUnit(graphics, UnitMillimeter); expect(Ok, status); @@ -2128,6 +2132,113 @@ static void test_is_outline_visible_path_point(void) expect(Ok, status); expect(FALSE, result);
+ /* Pen Unit in Millimeters */ + expect(Ok, status); + result = TRUE; + status = GdipIsOutlineVisiblePathPoint(path, 0.0, 1.0, penmm, graphics, &result); + expect(Ok, status); + expect(FALSE, result); + result = TRUE; + status = GdipIsOutlineVisiblePathPoint(path, 1.0, 1.0, penmm, graphics, &result); + expect(Ok, status); + expect(FALSE, result); + result = FALSE; + status = GdipIsOutlineVisiblePathPoint(path, 2.0, 1.0, penmm, graphics, &result); + expect(Ok, status); + expect(TRUE, result); + result = TRUE; + status = GdipIsOutlineVisiblePathPoint(path, 3.0, 1.0, penmm, graphics, &result); + expect(Ok, status); + expect(FALSE, result); + result = TRUE; + status = GdipIsOutlineVisiblePathPoint(path, 4.0, 1.0, penmm, graphics, &result); + expect(Ok, status); + expect(FALSE, result); + result = TRUE; + status = GdipIsOutlineVisiblePathPoint(path, 5.0, 1.0, penmm, graphics, &result); + expect(Ok, status); + expect(FALSE, result); + result = TRUE; + status = GdipIsOutlineVisiblePathPoint(path, 6.0, 1.0, penmm, graphics, &result); + expect(Ok, status); + expect(FALSE, result); + result = TRUE; + status = GdipIsOutlineVisiblePathPoint(path, 7.0, 1.0, penmm, graphics, &result); + expect(Ok, status); + expect(FALSE, result); + result = TRUE; + status = GdipIsOutlineVisiblePathPoint(path, 8.0, 1.0, penmm, graphics, &result); + expect(Ok, status); + expect(FALSE, result); + result = TRUE; + status = GdipIsOutlineVisiblePathPoint(path, 9.0, 1.0, penmm, graphics, &result); + expect(Ok, status); + expect(FALSE, result); + result = TRUE; + status = GdipIsOutlineVisiblePathPoint(path, 10.0, 1.0, penmm, graphics, &result); + expect(Ok, status); + expect(FALSE, result); + result = TRUE; + status = GdipIsOutlineVisiblePathPoint(path, 11.0, 1.0, penmm, graphics, &result); + expect(Ok, status); + expect(FALSE, result); + result = TRUE; + status = GdipIsOutlineVisiblePathPoint(path, 12.0, 1.0, penmm, graphics, &result); + expect(Ok, status); + expect(FALSE, result); + result = TRUE; + status = GdipIsOutlineVisiblePathPoint(path, 13.0, 1.0, penmm, graphics, &result); + expect(Ok, status); + expect(FALSE, result); + result = TRUE; + status = GdipIsOutlineVisiblePathPoint(path, 14.0, 1.0, penmm, graphics, &result); + expect(Ok, status); + expect(FALSE, result); + result = FALSE; + status = GdipIsOutlineVisiblePathPoint(path, 15.0, 1.0, penmm, graphics, &result); + expect(Ok, status); + expect(TRUE, result); + result = TRUE; + status = GdipIsOutlineVisiblePathPoint(path, 16.0, 1.0, penmm, graphics, &result); + expect(Ok, status); + expect(FALSE, result); + result = TRUE; + status = GdipIsOutlineVisiblePathPoint(path, 20.0, 1.0, penmm, graphics, &result); + expect(Ok, status); + expect(FALSE, result); + result = TRUE; + status = GdipIsOutlineVisiblePathPoint(path, 24.0, 1.0, penmm, graphics, &result); + expect(Ok, status); + expect(FALSE, result); + result = TRUE; + status = GdipIsOutlineVisiblePathPoint(path, 30.0, 1.0, penmm, graphics, &result); + expect(Ok, status); + expect(FALSE, result); + result = TRUE; + status = GdipIsOutlineVisiblePathPoint(path, 34.0, 1.0, penmm, graphics, &result); + expect(Ok, status); + expect(FALSE, result); + result = TRUE; + status = GdipIsOutlineVisiblePathPoint(path, 40.0, 1.0, penmm, graphics, &result); + expect(Ok, status); + expect(FALSE, result); + result = TRUE; + status = GdipIsOutlineVisiblePathPoint(path, 44.0, 1.0, penmm, graphics, &result); + expect(Ok, status); + expect(FALSE, result); + result = TRUE; + status = GdipIsOutlineVisiblePathPoint(path, 45.0, 1.0, penmm, graphics, &result); + expect(Ok, status); + expect(FALSE, result); + result = TRUE; + status = GdipIsOutlineVisiblePathPoint(path, 46.0, 1.0, penmm, graphics, &result); + expect(Ok, status); + expect(FALSE, result); + result = TRUE; + status = GdipIsOutlineVisiblePathPoint(path, 47.0, 1.0, penmm, graphics, &result); + expect(Ok, status); + expect(FALSE, result); + GdipResetWorldTransform(graphics); GdipDeletePath(path); GdipDeleteGraphics(graphics);