diff options
-rw-r--r-- | generic/Triangles.c | 24 |
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); } } |