From f2429426bf9152908875b50fb1ceddb829dc5a31 Mon Sep 17 00:00:00 2001 From: lecoanet Date: Fri, 29 Mar 2002 13:07:18 +0000 Subject: Suppression du parametre inutile closed. Correction de deux bugs sur les polylines ferm�es qui empechait de dessiner les joins/bouts dans certains cas (utilisation par rectangle, les deux coins du haut n'�taient pas dessin�s, dernier join et bout). --- generic/Draw.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'generic/Draw.c') diff --git a/generic/Draw.c b/generic/Draw.c index 73e3bfb..078439e 100644 --- a/generic/Draw.c +++ b/generic/Draw.c @@ -1014,7 +1014,6 @@ RenderPolyline(WidgetInfo *wi, ZnPoint *points, int num_points, int line_width, - ZnBool closed, LineStyle line_style, int cap_style, int join_style, @@ -1024,7 +1023,7 @@ RenderPolyline(WidgetInfo *wi, { int num_clips = ZnListSize(wi->clip_stack); ZnPoint end_points[LINE_END_POINTS]; - ZnBool need_rcaps, thin; + ZnBool need_rcaps, thin, closed; int pass, i, k, m; ZnPoint c1, c2; XColor *color; @@ -1035,11 +1034,12 @@ RenderPolyline(WidgetInfo *wi, * of GL_SMOOTH_LINE_WIDTH_RANGE and GL_SMOOTH_POINT_SIZE_RANGE * with a mix of anti-aliased lines and points. The curves that * are thicker are drawn using regular polygons. - * The joints are drawn only rounded, the caps can be either round - * or butt (but not projecting). + * BUG: The joints are drawn only rounded. + * The caps can be either round or butt (but not projecting). */ thin = ((line_width <= wi->max_line_width) && (line_width <= wi->max_point_width)); + closed = (points->x == points[num_points-1].x) && (points->y == points[num_points-1].y); color = ZnGetGradientColor(gradient, 0, &alpha); alpha = ZnComposeAlpha(alpha, wi->alpha); glColor4us(color->red, color->green, color->blue, alpha); @@ -1099,7 +1099,7 @@ RenderPolyline(WidgetInfo *wi, GLX_END_CLIP(num_clips); return; } - need_rcaps = ((line_width > 1) && (cap_style == CapRound) && !closed); + need_rcaps = ((line_width > 1) && (cap_style == CapRound)); i = 0; k = num_points; if (closed) { @@ -1108,7 +1108,7 @@ RenderPolyline(WidgetInfo *wi, if (!need_rcaps || first_end) { i++; } - if (!need_rcaps || last_end) { + if ((!need_rcaps && !closed) || last_end) { k--; } if (thin) { -- cgit v1.1