Vincent Povirk : gdiplus: Account for transforms when calculating hdc bounds.

Alexandre Julliard julliard at wine.codeweavers.com
Wed Jul 9 14:35:20 CDT 2014


Module: wine
Branch: master
Commit: 60f558876e8a88305e93839f32f2264414061f9e
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=60f558876e8a88305e93839f32f2264414061f9e

Author: Vincent Povirk <vincent at codeweavers.com>
Date:   Wed Jul  9 13:44:28 2014 -0500

gdiplus: Account for transforms when calculating hdc bounds.

---

 dlls/gdiplus/graphics.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c
index 861d160..7ee46ee 100644
--- a/dlls/gdiplus/graphics.c
+++ b/dlls/gdiplus/graphics.c
@@ -1995,6 +1995,24 @@ static GpStatus get_graphics_bounds(GpGraphics* graphics, GpRectF* rect)
         rect->Height = GetDeviceCaps(graphics->hdc, VERTRES);
     }
 
+    if (graphics->hdc &&
+        (GetMapMode(graphics->hdc) != MM_TEXT || GetGraphicsMode(graphics->hdc) != GM_COMPATIBLE))
+    {
+        POINT points[2];
+
+        points[0].x = rect->X;
+        points[0].y = rect->Y;
+        points[1].x = rect->X + rect->Width;
+        points[1].y = rect->Y + rect->Height;
+
+        DPtoLP(graphics->hdc, points, sizeof(points)/sizeof(points[0]));
+
+        rect->X = min(points[0].x, points[1].x);
+        rect->Y = min(points[0].y, points[1].y);
+        rect->Width = abs(points[1].x - points[0].x);
+        rect->Height = abs(points[1].y - points[0].y);
+    }
+
     return stat;
 }
 




More information about the wine-cvs mailing list