Module: wine Branch: master Commit: 8d6cd1b5745be6f6eaeff1ca9ff5b1ab7ee95c71 URL: https://gitlab.winehq.org/wine/wine/-/commit/8d6cd1b5745be6f6eaeff1ca9ff5b1a...
Author: Bartosz Kosiorek gang65@poczta.onet.pl Date: Fri Oct 20 22:32:28 2023 +0200
gdiplus: Fix transformation in GdipIsOutlineVisiblePathPoint.
---
dlls/gdiplus/graphicspath.c | 18 ++++++------------ dlls/gdiplus/tests/graphicspath.c | 8 ++++---- 2 files changed, 10 insertions(+), 16 deletions(-)
diff --git a/dlls/gdiplus/graphicspath.c b/dlls/gdiplus/graphicspath.c index 8e436f96f4e..54234ea0bd6 100644 --- a/dlls/gdiplus/graphicspath.c +++ b/dlls/gdiplus/graphicspath.c @@ -1728,9 +1728,10 @@ GpStatus WINGDIPAPI GdipIsOutlineVisiblePathPoint(GpPath* path, REAL x, REAL y, { GpStatus stat; GpPath *wide_path; + GpPointF pt = {x, y}; GpMatrix *transform = NULL;
- TRACE("(%p,%0.2f,%0.2f,%p,%p,%p)\n", path, x, y, pen, graphics, result); + TRACE("(%p, %0.2f, %0.2f, %p, %p, %p)\n", path, x, y, pen, graphics, result);
if(!path || !pen) return InvalidParameter; @@ -1747,22 +1748,15 @@ GpStatus WINGDIPAPI GdipIsOutlineVisiblePathPoint(GpPath* path, REAL x, REAL y, if (stat == Ok) stat = get_graphics_transform(graphics, CoordinateSpaceDevice, CoordinateSpaceWorld, transform); + if (stat == Ok) + GdipTransformMatrixPoints(transform, &pt, 1); }
if (stat == Ok) - stat = GdipWidenPath(wide_path, pen, transform, 1.0); - - if (pen->unit == UnitPixel && graphics != NULL) - { - if (stat == Ok) - stat = GdipInvertMatrix(transform); - - if (stat == Ok) - stat = GdipTransformPath(wide_path, transform); - } + stat = GdipWidenPath(wide_path, pen, transform, 0.25f);
if (stat == Ok) - stat = GdipIsVisiblePathPoint(wide_path, x, y, graphics, result); + stat = GdipIsVisiblePathPoint(wide_path, pt.X, pt.Y, graphics, result);
GdipDeleteMatrix(transform);
diff --git a/dlls/gdiplus/tests/graphicspath.c b/dlls/gdiplus/tests/graphicspath.c index 074311c71a0..03122cdda5d 100644 --- a/dlls/gdiplus/tests/graphicspath.c +++ b/dlls/gdiplus/tests/graphicspath.c @@ -1964,7 +1964,7 @@ static void test_is_outline_visible_path_point(void) result = TRUE; status = GdipIsOutlineVisiblePathPoint(path, 1.0, 1.0, pen, graphics, &result); expect(Ok, status); - todo_wine expect(FALSE, result); + expect(FALSE, result); result = FALSE; status = GdipIsOutlineVisiblePathPoint(path, 2.0, 1.0, pen, graphics, &result); expect(Ok, status); @@ -1976,7 +1976,7 @@ static void test_is_outline_visible_path_point(void) result = TRUE; status = GdipIsOutlineVisiblePathPoint(path, 14.0, 1.0, pen, graphics, &result); expect(Ok, status); - todo_wine expect(FALSE, result); + expect(FALSE, result); result = FALSE; status = GdipIsOutlineVisiblePathPoint(path, 15.0, 1.0, pen, graphics, &result); expect(Ok, status); @@ -2001,7 +2001,7 @@ static void test_is_outline_visible_path_point(void) result = FALSE; status = GdipIsOutlineVisiblePathPoint(path, 2.0, 1.0, pen, graphics, &result); expect(Ok, status); - todo_wine expect(TRUE, result); + expect(TRUE, result); result = TRUE; status = GdipIsOutlineVisiblePathPoint(path, 3.0, 1.0, pen, graphics, &result); expect(Ok, status); @@ -2013,7 +2013,7 @@ static void test_is_outline_visible_path_point(void) result = FALSE; status = GdipIsOutlineVisiblePathPoint(path, 15.0, 1.0, pen, graphics, &result); expect(Ok, status); - todo_wine expect(TRUE, result); + expect(TRUE, result); result = TRUE; status = GdipIsOutlineVisiblePathPoint(path, 16.0, 1.0, pen, graphics, &result); expect(Ok, status);