[5/10] gdiplus: updated GdipDrawArc()

Evan Stade estade at gmail.com
Tue Jul 10 20:39:56 CDT 2007


Hi,

Changelog:
*updated GdipDrawArc() to use SaveDC/RestoreDC/arc2polybezier/end caps

 dlls/gdiplus/graphics.c |   19 ++++++++-----------
 1 files changed, 8 insertions(+), 11 deletions(-)

-- 
Evan Stade
-------------- next part --------------
diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c
index c32a412..6e3bf1d 100644
--- a/dlls/gdiplus/graphics.c
+++ b/dlls/gdiplus/graphics.c
@@ -418,24 +418,21 @@ GpStatus WINGDIPAPI GdipDeleteGraphics(G
 GpStatus WINGDIPAPI GdipDrawArc(GpGraphics *graphics, GpPen *pen, REAL x,
     REAL y, REAL width, REAL height, REAL startAngle, REAL sweepAngle)
 {
-    HGDIOBJ old_pen;
-    REAL x_0, y_0, x_1, y_1, x_2, y_2;
+    INT save_state, num_pts;
+    GpPointF points[MAX_ARC_PTS];
 
     if(!graphics || !pen)
         return InvalidParameter;
 
-    old_pen = SelectObject(graphics->hdc, pen->gdipen);
-
-    x_0 = x + (width/2.0);
-    y_0 = y + (height/2.0);
+    num_pts = arc2polybezier(points, x, y, width, height, startAngle, sweepAngle);
 
-    deg2xy(startAngle+sweepAngle, x_0, y_0, &x_1, &y_1);
-    deg2xy(startAngle, x_0, y_0, &x_2, &y_2);
+    save_state = SaveDC(graphics->hdc);
+    EndPath(graphics->hdc);
+    SelectObject(graphics->hdc, pen->gdipen);
 
-    Arc(graphics->hdc, roundr(x), roundr(y), roundr(x+width), roundr(y+height),
-        roundr(x_1), roundr(y_1), roundr(x_2), roundr(y_2));
+    draw_polybezier(graphics->hdc, pen, points, num_pts, TRUE);
 
-    SelectObject(graphics->hdc, old_pen);
+    RestoreDC(graphics->hdc, save_state);
 
     return Ok;
 }
-- 
1.4.1


More information about the wine-patches mailing list