Dmitry Timoshkov : gdiplus: Destination points passed to GdipDrawImagePointsRect should be in device units .
Alexandre Julliard
julliard at winehq.org
Thu Aug 16 15:26:12 CDT 2012
Module: wine
Branch: master
Commit: 7f1cb3bca20a94ce0161e6a9c44e9c831611ef8e
URL: http://source.winehq.org/git/wine.git/?a=commit;h=7f1cb3bca20a94ce0161e6a9c44e9c831611ef8e
Author: Dmitry Timoshkov <dmitry at baikal.ru>
Date: Wed Aug 15 12:09:24 2012 +0900
gdiplus: Destination points passed to GdipDrawImagePointsRect should be in device units.
---
dlls/gdiplus/graphics.c | 13 +++++++++----
1 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c
index 77f2f8d..4606074 100644
--- a/dlls/gdiplus/graphics.c
+++ b/dlls/gdiplus/graphics.c
@@ -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);
More information about the wine-cvs
mailing list