aboutsummaryrefslogtreecommitdiff
path: root/generic/Curve.c
diff options
context:
space:
mode:
authorlecoanet2002-03-29 13:00:48 +0000
committerlecoanet2002-03-29 13:00:48 +0000
commit9b450c4142005050f7cf329f9a27e6debfb1e738 (patch)
tree983eef05cdbeff454acd163fbca6b2b1f9d695fd /generic/Curve.c
parent510ade508aa4eedb6b4b532a1ca3522572ef3e06 (diff)
downloadtkzinc-9b450c4142005050f7cf329f9a27e6debfb1e738.zip
tkzinc-9b450c4142005050f7cf329f9a27e6debfb1e738.tar.gz
tkzinc-9b450c4142005050f7cf329f9a27e6debfb1e738.tar.bz2
tkzinc-9b450c4142005050f7cf329f9a27e6debfb1e738.tar.xz
* 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).
Diffstat (limited to 'generic/Curve.c')
-rw-r--r--generic/Curve.c13
1 files changed, 8 insertions, 5 deletions
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);
}
}