From 31c93c043aefc5ad49bbdb7277ee7380536caee5 Mon Sep 17 00:00:00 2001 From: lecoanet Date: Tue, 26 Mar 2002 09:26:41 +0000 Subject: Correction d'un core dump sur linewidth non nul. --- generic/Rectangle.c | 32 +++++++++----------------------- 1 file changed, 9 insertions(+), 23 deletions(-) (limited to 'generic/Rectangle.c') diff --git a/generic/Rectangle.c b/generic/Rectangle.c index 6ebc137..793e427 100644 --- a/generic/Rectangle.c +++ b/generic/Rectangle.c @@ -698,34 +698,20 @@ Render(Item item) } if (rect->line_width) { + ZnPoint p[5]; + for (i = 0; i < 4; i++) { + p[4-i].x = rect->dev[i].x; + p[4-i].y = rect->dev[i].y; + } + p[0] = p[4]; if (rect->relief != RELIEF_FLAT) { - ZnPoint p[5]; - for (i = 0; i < 4; i++) { - p[4-i].x = rect->dev[i].x; - p[4-i].y = rect->dev[i].y; - } - p[0] = p[4]; RenderPolygonRelief(wi, rect->relief, rect->gradient, False, p, 5, rect->line_width); } else { - if ((rect->line_width <= wi->max_line_width) && - (rect->line_width <= wi->max_point_width)) { - glColor4us(color->red, color->green, color->blue, alpha); - SetLineStyle(wi, rect->line_style); - glLineWidth(rect->line_width); - glBegin(GL_LINE_LOOP); - for (i = 0; i < 4; i++) { - glVertex2f(rect->dev[i].x, rect->dev[i].y); - } - glEnd(); - } - else { - RenderPolyline(wi, - rect->dev, 4, rect->line_width, True, - rect->line_style, CapButt, JoinMiter, - NULL, NULL, rect->line_color); - } + RenderPolyline(wi, p, 5, rect->line_width, True, + rect->line_style, CapButt, JoinMiter, + NULL, NULL, rect->line_color); } } #endif -- cgit v1.1