From 9b450c4142005050f7cf329f9a27e6debfb1e738 Mon Sep 17 00:00:00 2001 From: lecoanet Date: Fri, 29 Mar 2002 13:00:48 +0000 Subject: * Correction d'un core dump dans Clone. Les structures geometriques �taient mises � NULL pour �tre remplies par ComputeCoordinates. En fait il fallait les copier tout de suite. * Les flags sont dans un unsigned short (16 flags). * Adaptation de RenderPolyline (closed inutile). --- generic/Curve.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'generic/Curve.c') diff --git a/generic/Curve.c b/generic/Curve.c index 9ea09de..79d7cf8 100644 --- a/generic/Curve.c +++ b/generic/Curve.c @@ -74,7 +74,7 @@ typedef struct _CurveItemStruct { /* Public data */ ZnPoly shape; - unsigned int flags; + unsigned short flags; Pixmap marker; ZnLineEnd first_end; /* These two are considered only if relief is flat */ ZnLineEnd last_end; @@ -297,7 +297,12 @@ Clone(Item item) ZnBool *holes; POLY_INIT(&cv->dev_shape); - cv->grad_geo = NULL; + + if (cv->grad_geo) { + ZnPoint *grad_geo = ZnMalloc(4*sizeof(ZnPoint)); + memcpy(grad_geo, cv->grad_geo, 4*sizeof(ZnPoint)); + cv->grad_geo = grad_geo; + } if (cv->shape.num_contours) { conts = cv->shape.contours; @@ -1304,14 +1309,12 @@ Render(Item item) else { ZnLineEnd first = ISSET(cv->flags, FIRST_END_OK) ? cv->first_end : NULL; ZnLineEnd last = ISSET(cv->flags, LAST_END_OK) ? cv->last_end : NULL; - ZnBool closed = ISSET(cv->flags, CLOSED_BIT); for (j = 0; j < cv->dev_shape.num_contours; j++) { RenderPolyline(wi, cv->dev_shape.contours[j].points, cv->dev_shape.contours[j].num_points, - cv->line_width, closed, - cv->line_style, cv->cap_style, cv->join_style, + cv->line_width, cv->line_style, cv->cap_style, cv->join_style, first, last, cv->line_color); } } -- cgit v1.1