gdiplus: Ignore the graphics transforms in GdipGetRegionBounds.
This commit is contained in:
parent
ee74501102
commit
c71853cda5
|
@ -657,7 +657,8 @@ GpStatus WINGDIPAPI GdipGetRegionBounds(GpRegion *region, GpGraphics *graphics,
|
|||
if(!region || !graphics || !rect)
|
||||
return InvalidParameter;
|
||||
|
||||
status = GdipGetRegionHRgn(region, graphics, &hrgn);
|
||||
/* Contrary to MSDN, native ignores the graphics transform. */
|
||||
status = GdipGetRegionHRgn(region, NULL, &hrgn);
|
||||
if(status != Ok)
|
||||
return status;
|
||||
|
||||
|
|
|
@ -459,7 +459,7 @@ static void test_BeginContainer2(void)
|
|||
status = GdipEndContainer(graphics, cont2);
|
||||
|
||||
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[2] - clip.Width) < 0.0001 &&
|
||||
fabs(defClip[3] - clip.Height) < 0.0001,
|
||||
|
|
|
@ -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.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);
|
||||
ok(status == Ok, "status %08x\n", status);
|
||||
status = GdipDeleteGraphics(graphics);
|
||||
|
|
Loading…
Reference in New Issue