gdiplus: Fix curve closing in GdipDrawClosedCurve2.

This commit is contained in:
Nikolay Sivov 2008-09-03 19:57:09 +04:00 committed by Alexandre Julliard
parent 72304d8377
commit 9c60a57ad1
1 changed files with 10 additions and 10 deletions

View File

@ -1102,7 +1102,7 @@ GpStatus WINGDIPAPI GdipDrawClosedCurveI(GpGraphics *graphics, GpPen *pen,
GpStatus WINGDIPAPI GdipDrawClosedCurve2(GpGraphics *graphics, GpPen *pen, GpStatus WINGDIPAPI GdipDrawClosedCurve2(GpGraphics *graphics, GpPen *pen,
GDIPCONST GpPointF *points, INT count, REAL tension) GDIPCONST GpPointF *points, INT count, REAL tension)
{ {
GpPointF *ptf; GpPath *path;
GpStatus stat; GpStatus stat;
TRACE("(%p, %p, %p, %d, %.2f)\n", graphics, pen, points, count, tension); 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) if(graphics->busy)
return ObjectBusy; return ObjectBusy;
/* make a full points copy.. */ if((stat = GdipCreatePath(FillModeAlternate, &path)) != Ok)
ptf = GdipAlloc(sizeof(GpPointF)*(count+1)); return stat;
if(!ptf)
return OutOfMemory;
memcpy(ptf, points, sizeof(GpPointF)*count);
/* ..and add a first point as a last one */ stat = GdipAddPathClosedCurve2(path, points, count, tension);
ptf[count] = ptf[0]; 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; return stat;
} }