gdiplus: Destination points passed to GdipDrawImagePointsRect should be in device units.
This commit is contained in:
parent
5e7452ade9
commit
7f1cb3bca2
|
@ -2969,14 +2969,19 @@ GpStatus WINGDIPAPI GdipDrawImagePointRect(GpGraphics *graphics, GpImage *image,
|
||||||
GpUnit srcUnit)
|
GpUnit srcUnit)
|
||||||
{
|
{
|
||||||
GpPointF points[3];
|
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);
|
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].X = points[2].X = x;
|
||||||
points[0].Y = points[1].Y = y;
|
points[0].Y = points[1].Y = y;
|
||||||
|
points[1].X = x + width;
|
||||||
/* FIXME: convert image coordinates to Graphics coordinates? */
|
points[2].Y = y + height;
|
||||||
points[1].X = x + srcwidth;
|
|
||||||
points[2].Y = y + srcheight;
|
|
||||||
|
|
||||||
return GdipDrawImagePointsRect(graphics, image, points, 3, srcx, srcy,
|
return GdipDrawImagePointsRect(graphics, image, points, 3, srcx, srcy,
|
||||||
srcwidth, srcheight, srcUnit, NULL, NULL, NULL);
|
srcwidth, srcheight, srcUnit, NULL, NULL, NULL);
|
||||||
|
|
Loading…
Reference in New Issue