[2/2] gdiplus: Fix GdipWidenPath transform for non-pixel pens.
Vincent Povirk
madewokherd at gmail.com
Tue Feb 16 16:10:22 CST 2016
From: Vincent Povirk <vincent at codeweavers.com>
Signed-off-by: Vincent Povirk <vincent at codeweavers.com>
---
dlls/gdiplus/graphicspath.c | 5 ++++-
dlls/gdiplus/tests/graphicspath.c | 8 ++++----
2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/dlls/gdiplus/graphicspath.c b/dlls/gdiplus/graphicspath.c
index 49dbf6c..58e99a2 100644
--- a/dlls/gdiplus/graphicspath.c
+++ b/dlls/gdiplus/graphicspath.c
@@ -2074,7 +2074,7 @@ GpStatus WINGDIPAPI GdipWidenPath(GpPath *path, GpPen *pen, GpMatrix *matrix,
status = GdipClonePath(path, &flat_path);
if (status == Ok)
- status = GdipFlattenPath(flat_path, matrix, flatness);
+ status = GdipFlattenPath(flat_path, pen->unit == UnitPixel ? matrix : NULL, flatness);
if (status == Ok && !init_path_list(&points, 314.0, 22.0))
status = OutOfMemory;
@@ -2147,6 +2147,9 @@ GpStatus WINGDIPAPI GdipWidenPath(GpPath *path, GpPen *pen, GpMatrix *matrix,
GdipDeletePath(flat_path);
+ if (status == Ok && pen->unit != UnitPixel)
+ status = GdipTransformPath(path, matrix);
+
return status;
}
diff --git a/dlls/gdiplus/tests/graphicspath.c b/dlls/gdiplus/tests/graphicspath.c
index 81670a4..24619e5 100644
--- a/dlls/gdiplus/tests/graphicspath.c
+++ b/dlls/gdiplus/tests/graphicspath.c
@@ -1056,10 +1056,10 @@ static path_test_t widenline_path[] = {
};
static path_test_t widenline_wide_path[] = {
- {5.0, 0.0, PathPointTypeStart, 0, 1}, /*0*/
- {50.0, 0.0, PathPointTypeLine, 0, 1}, /*1*/
- {50.0, 20.0, PathPointTypeLine, 0, 1}, /*2*/
- {5.0, 20.0, PathPointTypeLine|PathPointTypeCloseSubpath, 0, 1} /*3*/
+ {5.0, 0.0, PathPointTypeStart, 0, 0}, /*0*/
+ {50.0, 0.0, PathPointTypeLine, 0, 0}, /*1*/
+ {50.0, 20.0, PathPointTypeLine, 0, 0}, /*2*/
+ {5.0, 20.0, PathPointTypeLine|PathPointTypeCloseSubpath, 0, 0} /*3*/
};
static void test_widen(void)
--
2.5.0
More information about the wine-patches
mailing list