From: Bartosz Kosiorek gang65@poczta.onet.pl
--- dlls/gdiplus/graphicspath.c | 18 ++++++++--------- dlls/gdiplus/tests/graphicspath.c | 32 +++++++++++++++---------------- 2 files changed, 24 insertions(+), 26 deletions(-)
diff --git a/dlls/gdiplus/graphicspath.c b/dlls/gdiplus/graphicspath.c index cbf8e74340b..45e795e1878 100644 --- a/dlls/gdiplus/graphicspath.c +++ b/dlls/gdiplus/graphicspath.c @@ -1614,7 +1614,7 @@ GpStatus WINGDIPAPI GdipGetPathWorldBounds(GpPath* path, GpRectF* bounds, { GpPointF * points, temp_pts[4]; INT count, i; - REAL path_width = 1.0, width, height, temp, low_x, low_y, high_x, high_y; + REAL path_width = 1.0, width, height, low_x, low_y, high_x, high_y;
TRACE("(%p, %p, %s, %p)\n", path, bounds, debugstr_matrix(matrix), pen);
@@ -1641,10 +1641,6 @@ GpStatus WINGDIPAPI GdipGetPathWorldBounds(GpPath* path, GpRectF* bounds, high_y = max(high_y, points[i].Y); }
- width = high_x - low_x; - height = high_y - low_y; - - /* This looks unusual but it's the only way I can imitate windows. */ if(matrix){ temp_pts[0].X = low_x; temp_pts[0].Y = low_y; @@ -1656,19 +1652,21 @@ GpStatus WINGDIPAPI GdipGetPathWorldBounds(GpPath* path, GpRectF* bounds, temp_pts[3].Y = low_y;
GdipTransformMatrixPoints((GpMatrix*)matrix, temp_pts, 4); - low_x = temp_pts[0].X; - low_y = temp_pts[0].Y; + low_x = high_x = temp_pts[0].X; + low_y = high_y = temp_pts[0].Y;
for(i = 1; i < 4; i++){ low_x = min(low_x, temp_pts[i].X); low_y = min(low_y, temp_pts[i].Y); + high_x = max(high_x, temp_pts[i].X); + high_y = max(high_y, temp_pts[i].Y); }
- temp = width; - width = height * fabs(matrix->matrix[2]) + width * fabs(matrix->matrix[0]); - height = height * fabs(matrix->matrix[3]) + temp * fabs(matrix->matrix[1]); }
+ width = high_x - low_x; + height = high_y - low_y; + if(pen){ path_width = pen->width / 2.0;
diff --git a/dlls/gdiplus/tests/graphicspath.c b/dlls/gdiplus/tests/graphicspath.c index ed85b3445e8..da79d083b5c 100644 --- a/dlls/gdiplus/tests/graphicspath.c +++ b/dlls/gdiplus/tests/graphicspath.c @@ -627,10 +627,10 @@ static void test_worldbounds(void) expect(Ok, status); GdipDeletePath(path);
- todo_wine expectf(427.9, bounds.X); - todo_wine expectf(167.7, bounds.Y); - todo_wine expectf(239.9, bounds.Width); - todo_wine expectf(164.9, bounds.Height); + expectf(427.9, bounds.X); + expectf(167.7, bounds.Y); + expectf(239.9, bounds.Width); + expectf(164.9, bounds.Height);
/* GetPathWorldBounds with pen and matrix without Cap */ GdipCreatePath(FillModeAlternate, &path); @@ -640,10 +640,10 @@ static void test_worldbounds(void) expect(Ok, status); GdipDeletePath(path);
- todo_wine expectf(471.17, bounds.X); - todo_wine expectf(210.97, bounds.Y); - todo_wine expectf(153.47, bounds.Width); - todo_wine expectf(78.47, bounds.Height); + expectf(471.17, bounds.X); + expectf(210.97, bounds.Y); + expectf(153.47, bounds.Width); + expectf(78.47, bounds.Height);
/* GetPathWorldBounds with pen and scaled matrix without Cap */ GdipCreatePath(FillModeAlternate, &path); @@ -654,10 +654,10 @@ static void test_worldbounds(void) expect(Ok, status); GdipDeletePath(path);
- todo_wine expectf(720.0, bounds.X); - todo_wine expectf(320.0, bounds.Y); - todo_wine expectf(360.0, bounds.Width); - todo_wine expectf(160.0, bounds.Height); + expectf(720.0, bounds.X); + expectf(320.0, bounds.Y); + expectf(360.0, bounds.Width); + expectf(160.0, bounds.Height);
/* GetPathWorldBounds with pen and singular matrix without Cap */ GdipCreatePath(FillModeAlternate, &path); @@ -668,10 +668,10 @@ static void test_worldbounds(void) expect(Ok, status); GdipDeletePath(path);
- todo_wine expectf(180.0, bounds.X); - todo_wine expectf(180.0, bounds.Y); - todo_wine expectf(90.0, bounds.Width); - todo_wine expectf(40.0, bounds.Height); + expectf(180.0, bounds.X); + expectf(180.0, bounds.Y); + expectf(90.0, bounds.Width); + expectf(40.0, bounds.Height);
GdipDeleteMatrix(matrix); GdipCreateMatrix2(0.9, -0.5, -0.5, -1.2, 10.4, 10.2, &matrix);