Commit 7f1cb3bc authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

gdiplus: Destination points passed to GdipDrawImagePointsRect should be in device units.

parent 5e7452ad
......@@ -2969,14 +2969,19 @@ GpStatus WINGDIPAPI GdipDrawImagePointRect(GpGraphics *graphics, GpImage *image,
GpUnit srcUnit)
{
GpPointF points[3];
REAL scale_x, scale_y, width, height;
TRACE("(%p, %p, %f, %f, %f, %f, %f, %f, %d)\n", graphics, image, x, y, srcx, srcy, srcwidth, srcheight, srcUnit);
scale_x = units_scale(srcUnit, graphics->unit, graphics->xres);
scale_y = units_scale(srcUnit, graphics->unit, graphics->yres);
width = srcwidth * scale_x;
height = srcheight * scale_y;
points[0].X = points[2].X = x;
points[0].Y = points[1].Y = y;
/* FIXME: convert image coordinates to Graphics coordinates? */
points[1].X = x + srcwidth;
points[2].Y = y + srcheight;
points[1].X = x + width;
points[2].Y = y + height;
return GdipDrawImagePointsRect(graphics, image, points, 3, srcx, srcy,
srcwidth, srcheight, srcUnit, NULL, NULL, NULL);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment