aboutsummaryrefslogtreecommitdiff
path: root/generic/Rectangle.c
diff options
context:
space:
mode:
authorlecoanet2002-01-22 10:50:33 +0000
committerlecoanet2002-01-22 10:50:33 +0000
commit370757c7202d3d2ec40eb2a60006ffbbed5829b2 (patch)
tree7dd380950395bc8d13f2f68f352893e6cf5d3a87 /generic/Rectangle.c
parent47d1206c385a18b119fd9637d7c7fbf7d3a06b9f (diff)
downloadtkzinc-370757c7202d3d2ec40eb2a60006ffbbed5829b2.zip
tkzinc-370757c7202d3d2ec40eb2a60006ffbbed5829b2.tar.gz
tkzinc-370757c7202d3d2ec40eb2a60006ffbbed5829b2.tar.bz2
tkzinc-370757c7202d3d2ec40eb2a60006ffbbed5829b2.tar.xz
Traitement du dessin de contour par la routine RenderPolyline
au lieu de gle.
Diffstat (limited to 'generic/Rectangle.c')
-rw-r--r--generic/Rectangle.c30
1 files changed, 7 insertions, 23 deletions
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 <malloc.h>
-#ifdef GLX
-#include <GL/tube.h>
-#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);
}
}
}