Module: wine Branch: master Commit: 423ba9cb23d76a7b086e9f474767c14f4240ae6f URL: https://gitlab.winehq.org/wine/wine/-/commit/423ba9cb23d76a7b086e9f474767c14...
Author: Esme Povirk esme@codeweavers.com Date: Mon Mar 18 20:05:08 2024 +0000
gdiplus/tests: Region bounds aren't rounded.
---
dlls/gdiplus/tests/region.c | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+)
diff --git a/dlls/gdiplus/tests/region.c b/dlls/gdiplus/tests/region.c index 1bcef8a35dd..375f82f9ea7 100644 --- a/dlls/gdiplus/tests/region.c +++ b/dlls/gdiplus/tests/region.c @@ -1732,6 +1732,7 @@ static void test_scans(void) static void test_getbounds(void) { GpRegion *region; + GpPath *path; GpGraphics *graphics; GpStatus status; GpRectF rectf; @@ -1807,6 +1808,44 @@ static void test_getbounds(void) ok(rectf.Width == 100.0, "Expected width = 0.0, got %.2f\n", rectf.Width); ok(rectf.Height == 100.0, "Expected height = 0.0, got %.2f\n", rectf.Height);
+ /* coordinates are not rounded */ + status = GdipResetWorldTransform(graphics); + ok(status == Ok, "status %08x\n", status); + status = GdipResetPageTransform(graphics); + ok(status == Ok, "status %08x\n", status); + rectf.X = 0.125; + rectf.Y = 1.125; + rectf.Width = 2.125; + rectf.Height = 3.125; + status = GdipCombineRegionRect(region, &rectf, CombineModeReplace); + ok(status == Ok, "status %08x\n", status); + rectf.X = rectf.Y = 0.0; + rectf.Height = rectf.Width = 0.0; + status = GdipGetRegionBounds(region, graphics, &rectf); + ok(status == Ok, "status %08x\n", status); + todo_wine ok(rectf.X == 0.125, "Expected X = 0.0, got %.2f\n", rectf.X); + todo_wine ok(rectf.Y == 1.125, "Expected Y = 0.0, got %.2f\n", rectf.Y); + todo_wine ok(rectf.Width == 2.125, "Expected width = 0.0, got %.2f\n", rectf.Width); + todo_wine ok(rectf.Height == 3.125, "Expected height = 0.0, got %.2f\n", rectf.Height); + + /* test path */ + status = GdipCreatePath(FillModeAlternate, &path); + ok(status == Ok, "status %08x\n", status); + status = GdipAddPathRectangle(path, 0.125, 1.125, 2.125, 3.125); + ok(status == Ok, "status %08x\n", status); + status = GdipCombineRegionPath(region, path, CombineModeReplace); + ok(status == Ok, "status %08x\n", status); + status = GdipDeletePath(path); + ok(status == Ok, "status %08x\n", status); + rectf.X = rectf.Y = 0.0; + rectf.Height = rectf.Width = 0.0; + status = GdipGetRegionBounds(region, graphics, &rectf); + ok(status == Ok, "status %08x\n", status); + todo_wine ok(rectf.X == 0.125, "Expected X = 0.0, got %.2f\n", rectf.X); + todo_wine ok(rectf.Y == 1.125, "Expected Y = 0.0, got %.2f\n", rectf.Y); + todo_wine ok(rectf.Width == 2.125, "Expected width = 0.0, got %.2f\n", rectf.Width); + todo_wine ok(rectf.Height == 3.125, "Expected height = 0.0, got %.2f\n", rectf.Height); + status = GdipDeleteRegion(region); ok(status == Ok, "status %08x\n", status); status = GdipDeleteGraphics(graphics);