Alexandre Julliard : gdi32: Fix off-by-one error in the extent of arcs when the size is even.

Alexandre Julliard julliard at winehq.org
Mon Jul 1 14:46:41 CDT 2013


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Mon Jul  1 12:55:00 2013 +0200

gdi32: Fix off-by-one error in the extent of arcs when the size is even.

---

 dlls/gdi32/dibdrv/graphics.c |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/dlls/gdi32/dibdrv/graphics.c b/dlls/gdi32/dibdrv/graphics.c
index f9ed4c0..d91ef11 100644
--- a/dlls/gdi32/dibdrv/graphics.c
+++ b/dlls/gdi32/dibdrv/graphics.c
@@ -267,16 +267,16 @@ static int get_arc_points( PHYSDEV dev, const RECT *rect, POINT start, POINT end
                 points[pos].y = rect->top + height/2 + points[i % count].y;
                 break;
             case 1:
-                points[pos].x = rect->left + width/2 - points[count - 1 - i % count].x;
+                points[pos].x = rect->right-1 - width/2 - points[count - 1 - i % count].x;
                 points[pos].y = rect->top + height/2 + points[count - 1 - i % count].y;
                 break;
             case 2:
-                points[pos].x = rect->left + width/2 - points[i % count].x;
-                points[pos].y = rect->top + height/2 - points[i % count].y;
+                points[pos].x = rect->right-1 - width/2 - points[i % count].x;
+                points[pos].y = rect->bottom-1 - height/2 - points[i % count].y;
                 break;
             case 3:
                 points[pos].x = rect->left + width/2 + points[count - 1 - i % count].x;
-                points[pos].y = rect->top + height/2 - points[count - 1 - i % count].y;
+                points[pos].y = rect->bottom-1 - height/2 - points[count - 1 - i % count].y;
                 break;
             }
         }
@@ -289,14 +289,14 @@ static int get_arc_points( PHYSDEV dev, const RECT *rect, POINT start, POINT end
             {
             case 0:
                 points[pos].x = rect->left + width/2 + points[i % count].x;
-                points[pos].y = rect->top + height/2 - points[i % count].y;
+                points[pos].y = rect->bottom-1 - height/2 - points[i % count].y;
                 break;
             case 1:
-                points[pos].x = rect->left + width/2 - points[count - 1 - i % count].x;
-                points[pos].y = rect->top + height/2 - points[count - 1 - i % count].y;
+                points[pos].x = rect->right-1 - width/2 - points[count - 1 - i % count].x;
+                points[pos].y = rect->bottom-1 - height/2 - points[count - 1 - i % count].y;
                 break;
             case 2:
-                points[pos].x = rect->left + width/2 - points[i % count].x;
+                points[pos].x = rect->right-1 - width/2 - points[i % count].x;
                 points[pos].y = rect->top + height/2 + points[i % count].y;
                 break;
             case 3:




More information about the wine-cvs mailing list