From cd83d14acf1a7356b7bd361f9357bbd44faa9cd5 Mon Sep 17 00:00:00 2001 From: lecoanet Date: Thu, 11 Dec 2003 08:10:00 +0000 Subject: * (Draw): Corrected a core dump on curve with -closed 1 under X. --- generic/Curve.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'generic/Curve.c') diff --git a/generic/Curve.c b/generic/Curve.c index 901f331..39f9aee 100644 --- a/generic/Curve.c +++ b/generic/Curve.c @@ -1190,7 +1190,7 @@ Draw(ZnItem item) ZnWInfo *wi = item->wi; CurveItem cv = (CurveItem) item; XGCValues values; - unsigned int i, j, num_points=0, num2; + unsigned int i, j, num_points=0; unsigned int gc_mask; ZnPoint *points=NULL; XPoint *xpoints=NULL; @@ -1304,17 +1304,14 @@ Draw(ZnItem item) &values); } for (j = 0; j < cv->outlines.num_contours; j++) { - num2 = num_points = cv->outlines.contours[j].num_points; + num_points = cv->outlines.contours[j].num_points; points = cv->outlines.contours[j].points; ZnListAssertSize(wi->work_xpts, num_points); xpoints = ZnListArray(wi->work_xpts); - for (i = 0; i < num2; i++) { + for (i = 0; i < num_points; i++) { xpoints[i].x = ZnNearestInt(points[i].x); xpoints[i].y = ZnNearestInt(points[i].y); } - if (ISSET(cv->flags, CLOSED_BIT)) { - xpoints[num2] = xpoints[0]; - } XDrawLines(wi->dpy, wi->draw_buffer, wi->gc, xpoints, (int) num_points, CoordModeOrigin); } -- cgit v1.1