From 8629fe564af55ae618a2475fb2235b705d606655 Mon Sep 17 00:00:00 2001 From: lecoanet Date: Tue, 5 Nov 2002 09:30:52 +0000 Subject: Suppression de holes dans la structure ZnPoly et mise en place de cw dans le contour. --- generic/Draw.c | 16 ++++++---------- 1 file 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; -- cgit v1.1