aboutsummaryrefslogtreecommitdiff
path: root/generic/Draw.c
diff options
context:
space:
mode:
authorlecoanet2002-11-05 09:30:52 +0000
committerlecoanet2002-11-05 09:30:52 +0000
commit8629fe564af55ae618a2475fb2235b705d606655 (patch)
treecc5cc13f93cfcbf0ff366d15222150dc4f1b22b8 /generic/Draw.c
parent9ec8c046838efe3d88077854505ffcaf0cc2b18f (diff)
downloadtkzinc-8629fe564af55ae618a2475fb2235b705d606655.zip
tkzinc-8629fe564af55ae618a2475fb2235b705d606655.tar.gz
tkzinc-8629fe564af55ae618a2475fb2235b705d606655.tar.bz2
tkzinc-8629fe564af55ae618a2475fb2235b705d606655.tar.xz
Suppression de holes dans la structure ZnPoly et mise en place de cw
dans le contour.
Diffstat (limited to 'generic/Draw.c')
-rw-r--r--generic/Draw.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/generic/Draw.c b/generic/Draw.c
index d8ece94..7587082 100644
--- a/generic/Draw.c
+++ b/generic/Draw.c
@@ -366,7 +366,7 @@ ReliefColorOfSegment(ZnReal x1,
color_index = 2*(num_colors-1)-color_index;
}
if ((color_index < 0) || (color_index >= num_colors)) {
- printf("Color index out of gradient (should not happen).\n");
+ fprintf(stderr, "Color index out of gradient (should not happen).\n");
if (color_index < 0) {
color_index = 0;
}
@@ -1323,7 +1323,6 @@ ZnComputeAxialGradient(WidgetInfo *wi,
ZnPoint *grad_geo)
{
ZnTransfo *transfo1, *transfo2;
- ZnBool *holes;
ZnContour *c;
ZnBBox bbox;
ZnPoint *points, p[4];
@@ -1333,11 +1332,10 @@ ZnComputeAxialGradient(WidgetInfo *wi,
transfo2 = ZnTransfoNew();
ZnRotateDeg(transfo1, angle);
ZnRotateDeg(transfo2, -angle);
- holes = shape->holes;
c = shape->contours;
ResetBBox(&bbox);
- for (i = 0; i < shape->num_contours; i++, c++, holes++) {
- if (*holes) {
+ for (i = 0; i < shape->num_contours; i++, c++) {
+ if (c->cw) {
continue;
}
ZnListAssertSize(wi->work_pts, c->num_points);
@@ -1370,7 +1368,6 @@ ZnComputeRadialGradient(WidgetInfo *wi,
ZnPoint *grad_geo)
{
ZnReal dist, new, x, y, fact;
- ZnBool *holes;
ZnContour *c;
ZnPoint *points;
ZnTransfo *transfo1;
@@ -1382,10 +1379,9 @@ ZnComputeRadialGradient(WidgetInfo *wi,
fact = (bbox->corner.x-bbox->orig.x)/(bbox->corner.y-bbox->orig.y);
ZnScale(transfo1, 1.0, fact);
dist = 0.0;
- holes = shape->holes;
c = shape->contours;
- for (j = 0; j < shape->num_contours; j++, c++, holes++) {
- if (*holes) {
+ for (j = 0; j < shape->num_contours; j++, c++) {
+ if (c->cw) {
continue;
}
ZnListAssertSize(wi->work_pts, c->num_points);
@@ -1587,7 +1583,7 @@ ZnRenderGradient(WidgetInfo *wi,
ZnReal position;
for (k = 0; k < poly->num_contours; k++) {
- if (poly->holes[k]) {
+ if (poly->contours[k].cw) {
continue;
}
points = poly->contours[k].points;