From: Bartosz Kosiorek gang65@poczta.onet.pl
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55717 --- dlls/gdiplus/graphicspath.c | 4 ++-- dlls/gdiplus/tests/graphicspath.c | 40 +++++++++++++++++++++++++++++-- 2 files changed, 40 insertions(+), 4 deletions(-)
diff --git a/dlls/gdiplus/graphicspath.c b/dlls/gdiplus/graphicspath.c index b1e417842f8..87480dd5133 100644 --- a/dlls/gdiplus/graphicspath.c +++ b/dlls/gdiplus/graphicspath.c @@ -1804,8 +1804,8 @@ GpStatus WINGDIPAPI GdipIsOutlineVisiblePathPoint(GpPath* path, REAL x, REAL y,
if (stat != Ok) return stat; - - if (pen->unit == UnitPixel && graphics != NULL) + if (pen->unit == UnitPixel && graphics != NULL) + // if (graphics != NULL) // TODO Nie powinnismy sprawdzac jednostki Pen { stat = GdipCreateMatrix(&transform);
diff --git a/dlls/gdiplus/tests/graphicspath.c b/dlls/gdiplus/tests/graphicspath.c index 89a7dd786de..afa3828282e 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, 3.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,38 @@ 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, 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); + GdipResetWorldTransform(graphics); GdipDeletePath(path); GdipDeleteGraphics(graphics);