From: Bartosz Kosiorek gang65@poczta.onet.pl
--- dlls/gdiplus/tests/graphicspath.c | 78 ++++++++++++++++++++++++++++--- 1 file changed, 71 insertions(+), 7 deletions(-)
diff --git a/dlls/gdiplus/tests/graphicspath.c b/dlls/gdiplus/tests/graphicspath.c index 81b4b40eed4..ed85b3445e8 100644 --- a/dlls/gdiplus/tests/graphicspath.c +++ b/dlls/gdiplus/tests/graphicspath.c @@ -24,7 +24,7 @@ #include <math.h>
#define expect(expected, got) ok(got == expected, "Expected %.8x, got %.8x\n", expected, got) -#define expectf(expected, got) ok(fabs(expected - got) < 2.0, "Expected %.2f, got %.2f\n", expected, got) +#define expectf(expected, got) ok(fabs(expected - got) < 0.1, "Expected %.2f, got %.2f\n", expected, got) #define POINT_TYPE_MAX_LEN (75)
static void stringify_point_type(PathPointType type, char * name) @@ -596,18 +596,82 @@ static void test_worldbounds(void) expectf(0.0, bounds.Width); expectf(0.0, bounds.Height);
+ /* GetPathWorldBounds with pen */ + GdipCreatePath(FillModeAlternate, &path); + GdipAddPathLine2(path, &(line2_points[0]), 2); + status = GdipGetPathWorldBounds(path, &bounds, NULL, pen); + expect(Ok, status); + GdipDeletePath(path); + + expectf(156.0, bounds.X); + expectf(156.0, bounds.Y); + expectf(138.0, bounds.Width); + expectf(88.0, bounds.Height); + + /* GetPathWorldBounds with matrix */ + GdipCreatePath(FillModeAlternate, &path); + GdipAddPathLine2(path, &(line2_points[0]), 2); + status = GdipGetPathWorldBounds(path, &bounds, matrix, NULL); + expect(Ok, status); + GdipDeletePath(path); + + expectf(510.4, bounds.X); + expectf(250.2, bounds.Y); + expectf(75.0, bounds.Width); + expectf(0.0, bounds.Height); + + /* GetPathWorldBounds with pen and matrix */ GdipCreatePath(FillModeAlternate, &path); GdipAddPathLine2(path, &(line2_points[0]), 2); status = GdipGetPathWorldBounds(path, &bounds, matrix, pen); expect(Ok, status); GdipDeletePath(path);
- todo_wine{ - expectf(427.9, bounds.X); - expectf(167.7, bounds.Y); - expectf(239.9, bounds.Width); - expectf(164.9, bounds.Height); - } + 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); + + /* GetPathWorldBounds with pen and matrix without Cap */ + GdipCreatePath(FillModeAlternate, &path); + GdipAddPathLine2(path, &(line2_points[0]), 2); + GdipSetPenEndCap(pen, LineCapFlat); + status = GdipGetPathWorldBounds(path, &bounds, matrix, pen); + 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); + + /* GetPathWorldBounds with pen and scaled matrix without Cap */ + GdipCreatePath(FillModeAlternate, &path); + GdipAddPathLine2(path, &(line2_points[0]), 2); + GdipSetMatrixElements(matrix, 4.0, 0.0, 0.0, 2.0, 0.0, 0.0); + GdipSetPenEndCap(pen, LineCapFlat); + status = GdipGetPathWorldBounds(path, &bounds, matrix, pen); + 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); + + /* GetPathWorldBounds with pen and singular matrix without Cap */ + GdipCreatePath(FillModeAlternate, &path); + GdipAddPathLine2(path, &(line2_points[0]), 2); + GdipSetMatrixElements(matrix, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0); + GdipSetPenEndCap(pen, LineCapFlat); + status = GdipGetPathWorldBounds(path, &bounds, matrix, pen); + 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);
GdipDeleteMatrix(matrix); GdipCreateMatrix2(0.9, -0.5, -0.5, -1.2, 10.4, 10.2, &matrix);