aboutsummaryrefslogtreecommitdiff
path: root/generic/Draw.c
diff options
context:
space:
mode:
authorlecoanet2002-03-29 13:07:18 +0000
committerlecoanet2002-03-29 13:07:18 +0000
commitf2429426bf9152908875b50fb1ceddb829dc5a31 (patch)
tree25fef038e74ce7b13d3dd0735b633fdfc499a423 /generic/Draw.c
parentdd2ac1ade0daec61cb90457baf6940391ccce0fe (diff)
downloadtkzinc-f2429426bf9152908875b50fb1ceddb829dc5a31.zip
tkzinc-f2429426bf9152908875b50fb1ceddb829dc5a31.tar.gz
tkzinc-f2429426bf9152908875b50fb1ceddb829dc5a31.tar.bz2
tkzinc-f2429426bf9152908875b50fb1ceddb829dc5a31.tar.xz
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).
Diffstat (limited to 'generic/Draw.c')
-rw-r--r--generic/Draw.c12
1 files changed, 6 insertions, 6 deletions
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) {