[PATCH 1/2] gdi32: fix for rotated Arc, ArcTo, Chord and Pie drawing problem

Ralf Habacker ralf.habacker at freenet.de
Tue Sep 24 09:09:57 CDT 2013


>From 89118b11e13d323e32c6e66b82d1c7d5145af642 Mon Sep 17 00:00:00 2001
From: Daniel Wendt <daniel.wendt at linux.com>
Date: Tue, 24 Sep 2013 13:55:08 +0200
Subject: gdi32: Fixed drawing coordinates of arc based primitives in
GM_ADVANCED graphics mode.

Line drawing bug of ArcTo() will be fixed in an additional patch.

BUG: http://bugs.winehq.org/show_bug.cgi?id=34579
---
 dlls/gdi32/dibdrv/graphics.c |   25 ++++++++++++++++++++++---
 1 Datei geändert, 22 Zeilen hinzugefügt(+), 3 Zeilen entfernt(-)

diff --git a/dlls/gdi32/dibdrv/graphics.c b/dlls/gdi32/dibdrv/graphics.c
index f3aaeb6..570c81d 100644
--- a/dlls/gdi32/dibdrv/graphics.c
+++ b/dlls/gdi32/dibdrv/graphics.c
@@ -308,6 +308,11 @@ static int get_arc_points( PHYSDEV dev, const RECT
*rect, POINT start, POINT end
     }

     memmove( points, points + count, (pos - count) * sizeof(POINT) );
+
+    if (GetGraphicsMode( dev->hdc ) == GM_ADVANCED)
+    {
+        LPtoDP( dev->hdc, points, pos - count );
+    }
     return pos - count;
 }

@@ -322,7 +327,17 @@ static BOOL draw_arc( PHYSDEV dev, INT left, INT
top, INT right, INT bottom,
     BOOL ret = TRUE;
     HRGN outline = 0, interior = 0;

-    if (!get_pen_device_rect( pdev, &rect, left, top, right, bottom ))
return TRUE;
+    if (GetGraphicsMode(dev->hdc ) != GM_ADVANCED)
+    {
+        if (!get_pen_device_rect( pdev, &rect, left, top, right, bottom
)) return TRUE;
+    }
+    else
+    {
+        rect.left = left;
+        rect.top = top;
+        rect.right = right;
+        rect.bottom = bottom;
+    }

     width = rect.right - rect.left;
     height = rect.bottom - rect.top;
@@ -331,7 +346,8 @@ static BOOL draw_arc( PHYSDEV dev, INT left, INT
top, INT right, INT bottom,
     pt[0].y = start_y;
     pt[1].x = end_x;
     pt[1].y = end_y;
-    LPtoDP( dev->hdc, pt, 2 );
+    if (GetGraphicsMode( dev->hdc ) != GM_ADVANCED)
+        LPtoDP( dev->hdc, pt, 2 );
     /* make them relative to the ellipse center */
     pt[0].x -= rect.left + width / 2;
     pt[0].y -= rect.top + height / 2;
@@ -344,7 +360,8 @@ static BOOL draw_arc( PHYSDEV dev, INT left, INT
top, INT right, INT bottom,
     if (extra_lines == -1)
     {
         GetCurrentPositionEx( dev->hdc, points );
-        LPtoDP( dev->hdc, points, 1 );
+        if (GetGraphicsMode( dev->hdc ) != GM_ADVANCED)
+            LPtoDP( dev->hdc, points, 1 );
         count = 1 + get_arc_points( dev, &rect, pt[0], pt[1], points + 1 );
     }
     else count = get_arc_points( dev, &rect, pt[0], pt[1], points );
@@ -353,6 +370,8 @@ static BOOL draw_arc( PHYSDEV dev, INT left, INT
top, INT right, INT bottom,
     {
         points[count].x = rect.left + width / 2;
         points[count].y = rect.top + height / 2;
+        if (GetGraphicsMode( dev->hdc ) == GM_ADVANCED)
+            LPtoDP( dev->hdc, points+count, 1 );
         count++;
     }
     if (count < 2)
-- 
1.7.10.4




More information about the wine-patches mailing list