diff options
author | lecoanet | 2003-11-28 13:33:08 +0000 |
---|---|---|
committer | lecoanet | 2003-11-28 13:33:08 +0000 |
commit | 0037b51dcc6900db62a1c2a6b935c0c23329bb65 (patch) | |
tree | 299b9d0ca60d05b6855665280475fcae8f82c1f7 | |
parent | 1a561e0efb8d40f2ff9e8216b3f38a26105752bb (diff) | |
download | tkzinc-0037b51dcc6900db62a1c2a6b935c0c23329bb65.zip tkzinc-0037b51dcc6900db62a1c2a6b935c0c23329bb65.tar.gz tkzinc-0037b51dcc6900db62a1c2a6b935c0c23329bb65.tar.bz2 tkzinc-0037b51dcc6900db62a1c2a6b935c0c23329bb65.tar.xz |
* (Coords): When replacing all the coordinates of a curve, the
control point list was not correctly updated.
-rw-r--r-- | generic/Curve.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/generic/Curve.c b/generic/Curve.c index 202e0ce..901f331 100644 --- a/generic/Curve.c +++ b/generic/Curve.c @@ -1842,11 +1842,15 @@ Coords(ZnItem item, if (c->points) { ZnFree(c->points); } - c->points = (ZnPoint *) ZnMalloc(*num_pts*sizeof(ZnPoint)); + c->points = ZnMalloc(*num_pts*sizeof(ZnPoint)); c->num_points = *num_pts; memcpy(c->points, *pts, *num_pts*sizeof(ZnPoint)); + if (c->controls) { + ZnFree(c->controls); + c->controls = NULL; + } if (*controls) { - c->controls = ZnRealloc(c->controls, *num_pts*sizeof(char)); + c->controls = ZnMalloc(*num_pts*sizeof(char)); memcpy(c->controls, *controls, *num_pts*sizeof(char)); } } |