Nikolay Sivov : gdiplus: Fix curve closing in GdipDrawClosedCurve2.

Alexandre Julliard julliard at winehq.org
Thu Sep 4 08:27:10 CDT 2008


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

Author: Nikolay Sivov <bunglehead at gmail.com>
Date:   Wed Sep  3 19:57:09 2008 +0400

gdiplus: Fix curve closing in GdipDrawClosedCurve2.

---

 dlls/gdiplus/graphics.c |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c
index 7045a34..1265bd7 100644
--- a/dlls/gdiplus/graphics.c
+++ b/dlls/gdiplus/graphics.c
@@ -1102,7 +1102,7 @@ GpStatus WINGDIPAPI GdipDrawClosedCurveI(GpGraphics *graphics, GpPen *pen,
 GpStatus WINGDIPAPI GdipDrawClosedCurve2(GpGraphics *graphics, GpPen *pen,
     GDIPCONST GpPointF *points, INT count, REAL tension)
 {
-    GpPointF *ptf;
+    GpPath *path;
     GpStatus stat;
 
     TRACE("(%p, %p, %p, %d, %.2f)\n", graphics, pen, points, count, tension);
@@ -1113,18 +1113,18 @@ GpStatus WINGDIPAPI GdipDrawClosedCurve2(GpGraphics *graphics, GpPen *pen,
     if(graphics->busy)
         return ObjectBusy;
 
-    /* make a full points copy.. */
-    ptf = GdipAlloc(sizeof(GpPointF)*(count+1));
-    if(!ptf)
-        return OutOfMemory;
-    memcpy(ptf, points, sizeof(GpPointF)*count);
+    if((stat = GdipCreatePath(FillModeAlternate, &path)) != Ok)
+        return stat;
 
-    /* ..and add a first point as a last one */
-    ptf[count] = ptf[0];
+    stat = GdipAddPathClosedCurve2(path, points, count, tension);
+    if(stat != Ok){
+        GdipDeletePath(path);
+        return stat;
+    }
 
-    stat = GdipDrawCurve2(graphics, pen, ptf, count + 1, tension);
+    stat = GdipDrawPath(graphics, pen, path);
 
-    GdipFree(ptf);
+    GdipDeletePath(path);
 
     return stat;
 }




More information about the wine-cvs mailing list