gdiplus: Ignore the graphics transforms in GdipGetRegionBounds.

This commit is contained in:
Vincent Povirk 2009-08-03 10:09:07 -05:00 committed by Alexandre Julliard
parent ee74501102
commit c71853cda5
3 changed files with 26 additions and 2 deletions

View File

@ -657,7 +657,8 @@ GpStatus WINGDIPAPI GdipGetRegionBounds(GpRegion *region, GpGraphics *graphics,
if(!region || !graphics || !rect) if(!region || !graphics || !rect)
return InvalidParameter; return InvalidParameter;
status = GdipGetRegionHRgn(region, graphics, &hrgn); /* Contrary to MSDN, native ignores the graphics transform. */
status = GdipGetRegionHRgn(region, NULL, &hrgn);
if(status != Ok) if(status != Ok)
return status; return status;

View File

@ -459,7 +459,7 @@ static void test_BeginContainer2(void)
status = GdipEndContainer(graphics, cont2); status = GdipEndContainer(graphics, cont2);
GdipGetClipBounds(graphics, &clip); GdipGetClipBounds(graphics, &clip);
todo_wine ok(fabs(defClip[0] - clip.X) < 0.0001 && ok(fabs(defClip[0] - clip.X) < 0.0001 &&
fabs(defClip[1] - clip.Y) < 0.0001 && fabs(defClip[1] - clip.Y) < 0.0001 &&
fabs(defClip[2] - clip.Width) < 0.0001 && fabs(defClip[2] - clip.Width) < 0.0001 &&
fabs(defClip[3] - clip.Height) < 0.0001, fabs(defClip[3] - clip.Height) < 0.0001,

View File

@ -1176,6 +1176,29 @@ static void test_getbounds(void)
ok(rectf.Width == 100.0, "Expected width = 0.0, got %.2f\n", rectf.Width); 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); ok(rectf.Height == 100.0, "Expected height = 0.0, got %.2f\n", rectf.Height);
/* the world and page transforms are ignored */
GdipScaleWorldTransform(graphics, 2.0, 2.0, MatrixOrderPrepend);
GdipSetPageUnit(graphics, UnitInch);
GdipSetPageScale(graphics, 2.0);
status = GdipGetRegionBounds(region, graphics, &rectf);
ok(status == Ok, "status %08x\n", status);
ok(rectf.X == 10.0, "Expected X = 0.0, got %.2f\n", rectf.X);
ok(rectf.Y == 0.0, "Expected Y = 0.0, got %.2f\n", rectf.Y);
ok(rectf.Width == 100.0, "Expected width = 0.0, got %.2f\n", rectf.Width);
rectf.X = 10.0; rectf.Y = 0.0;
rectf.Width = rectf.Height = 100.0;
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);
ok(rectf.X == 10.0, "Expected X = 0.0, got %.2f\n", rectf.X);
ok(rectf.Y == 0.0, "Expected Y = 0.0, got %.2f\n", rectf.Y);
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);
status = GdipDeleteRegion(region); status = GdipDeleteRegion(region);
ok(status == Ok, "status %08x\n", status); ok(status == Ok, "status %08x\n", status);
status = GdipDeleteGraphics(graphics); status = GdipDeleteGraphics(graphics);