From 370757c7202d3d2ec40eb2a60006ffbbed5829b2 Mon Sep 17 00:00:00 2001 From: lecoanet Date: Tue, 22 Jan 2002 10:50:33 +0000 Subject: Traitement du dessin de contour par la routine RenderPolyline au lieu de gle. --- generic/Rectangle.c | 30 +++++++----------------------- 1 file changed, 7 insertions(+), 23 deletions(-) (limited to 'generic/Rectangle.c') diff --git a/generic/Rectangle.c b/generic/Rectangle.c index 0b09e72..9d21d3b 100644 --- a/generic/Rectangle.c +++ b/generic/Rectangle.c @@ -28,9 +28,6 @@ #include -#ifdef GLX -#include -#endif #include "Item.h" #include "Geo.h" @@ -735,8 +732,9 @@ Render(Item item) else { color = rect->line_color; alpha = rect->line_alpha*wi->alpha/100*65535/100; - glColor4us(color->red, color->green, color->blue, alpha); - if (rect->line_width < 3) { + 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); @@ -746,24 +744,10 @@ Render(Item item) glEnd(); } else { - double lw_2 = (double) rect->line_width / 2.0; - double section[2][2] = { { 0.0, -lw_2 }, { 0.0, lw_2 } }; - double up[3] = { 1.0, 0.0, 0.0 }; - double vertices[7][3]; - - vertices[0][0] = vertices[4][0] = rect->dev[3].x; - vertices[0][1] = vertices[4][1] = rect->dev[3].y; - vertices[1][0] = vertices[5][0] = rect->dev[0].x; - vertices[1][1] = vertices[5][1] = rect->dev[0].y; - vertices[2][0] = vertices[6][0] = rect->dev[1].x; - vertices[2][1] = vertices[6][1] = rect->dev[1].y; - vertices[3][0] = rect->dev[2].x; - vertices[3][1] = rect->dev[2].y; - vertices[0][2] = vertices[1][2] = vertices[2][2] = vertices[3][2] = 0; - vertices[4][2] = vertices[5][2] = vertices[6][2] = 0; - glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); - gleSetJoinStyle(TUBE_JN_ANGLE | TUBE_CONTOUR_CLOSED); - gleExtrusion(2, section, NULL, up, 7, vertices, NULL); + RenderPolyline(wi, + rect->dev, 4, rect->line_width, True, + rect->line_style, CapButt, JoinMiter, + NULL, NULL, color, alpha); } } } -- cgit v1.1