aboutsummaryrefslogtreecommitdiff
path: root/generic/Triangles.c
diff options
context:
space:
mode:
authorlecoanet2002-02-15 09:10:59 +0000
committerlecoanet2002-02-15 09:10:59 +0000
commitae605c85d45a3a122f93366778eabc1bf44f4d77 (patch)
treee1b2abba44f3920477a25dc8448518209cb0c3f6 /generic/Triangles.c
parent1afa38f20cd3a45c51459994ae334a9a3012e80d (diff)
downloadtkzinc-ae605c85d45a3a122f93366778eabc1bf44f4d77.zip
tkzinc-ae605c85d45a3a122f93366778eabc1bf44f4d77.tar.gz
tkzinc-ae605c85d45a3a122f93366778eabc1bf44f4d77.tar.bz2
tkzinc-ae605c85d45a3a122f93366778eabc1bf44f4d77.tar.xz
Correction du clonage de l'item. Les couleurs n'�taient
pas correctement clon�es ni lib�r�es.
Diffstat (limited to 'generic/Triangles.c')
-rw-r--r--generic/Triangles.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/generic/Triangles.c b/generic/Triangles.c
index 41487e0..183146d 100644
--- a/generic/Triangles.c
+++ b/generic/Triangles.c
@@ -172,16 +172,26 @@ Init(Item item,
static void
Clone(Item item)
{
+ WidgetInfo *wi = item->wi;
TrianglesItem tr = (TrianglesItem) item;
+ if (tr->colors) {
+ int i, num_colors;
+ ZnGradientColor *colors;
+
+ tr->colors = ZnListDuplicate(tr->colors);
+ num_colors = ZnListSize(tr->colors);
+ colors = ZnListArray(tr->colors);
+ for (i = 0; i < num_colors; i++, colors++) {
+ colors->shades[0] = ZnGetColorByValue(wi->win, colors->shades[0]);
+ }
+ }
+
tr->dev_points.num_strips = 0;
if (tr->points) {
tr->points = ZnListDuplicate(tr->points);
}
- if (tr->colors) {
- tr->colors = ZnListDuplicate(tr->colors);
- }
}
@@ -204,6 +214,14 @@ Destroy(Item item)
ZnFree(tr->dev_points.strips->points);
}
if (tr->colors) {
+ int i, num_colors;
+ ZnGradientColor *colors;
+
+ num_colors = ZnListSize(tr->colors);
+ colors = ZnListArray(tr->colors);
+ for (i = 0; i < num_colors; i++, colors++) {
+ ZnFreeColor(colors->shades[0]);
+ }
ZnListFree(tr->colors);
}
}