aboutsummaryrefslogtreecommitdiff
path: root/generic/Rectangle.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/Rectangle.c')
-rw-r--r--generic/Rectangle.c32
1 files changed, 9 insertions, 23 deletions
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