diff options
-rw-r--r-- | generic/Arc.c | 44 |
1 files changed, 12 insertions, 32 deletions
diff --git a/generic/Arc.c b/generic/Arc.c index 54476e0..203978f 100644 --- a/generic/Arc.c +++ b/generic/Arc.c @@ -1255,7 +1255,7 @@ Render(Item item) #ifdef GLX WidgetInfo *wi = item->wi; ArcItem arc = (ArcItem) item; - int num_points=0, i; + int num_points=0; ZnPoint *p=NULL; XColor *color; int alpha; @@ -1298,43 +1298,23 @@ Render(Item item) * Draw the arc. */ if (arc->line_width) { + ZnLineEnd first = ISSET(arc->flags, FIRST_END_OK) ? arc->first_end : NULL; + ZnLineEnd last = ISSET(arc->flags, LAST_END_OK) ? arc->last_end : NULL; + ZnBool closed = ISSET(arc->flags, CLOSED_BIT); + p = ZnListArray(arc->render_shape); num_points = ZnListSize(arc->render_shape); - glColor4us(arc->line_color->red, arc->line_color->green, - arc->line_color->blue, arc->line_alpha*wi->alpha/100*65535/100); - if ((arc->line_width <= wi->max_line_width) && - (arc->line_width <= wi->max_point_width)) { - glLineWidth(arc->line_width); - SetLineStyle(wi, arc->line_style); - - if (ISSET(arc->flags, CLOSED_BIT)) { - glBegin(GL_LINE_LOOP); - } - else { - glBegin(GL_LINE_STRIP); - if (arc->angle_extent != 360) { + if (!closed) { + if (arc->angle_extent != 360) { + num_points--; + if (ISSET(arc->flags, PIE_SLICE_BIT)) { num_points--; - if (ISSET(arc->flags, PIE_SLICE_BIT)) { - num_points--; - } } } - for (i = 0; i < num_points; i++) { - glVertex2f(p[i].x, p[i].y); - } - glEnd(); - } - else { - double (*gl_pts)[3]; - - ZnListAssertSize(wi->work_doubles, (num_points+3)*3); - gl_pts = ZnListArray(wi->work_doubles); - for (i = 1; i <= num_points; i++, p++) { - gl_pts[i][0] = p->x; - gl_pts[i][1] = p->y; - gl_pts[i][1] = 0; - } } + RenderPolyline(wi, p, num_points, arc->line_width, False, + arc->line_style, CapRound, JoinRound, first, last, + arc->line_color, arc->line_alpha*wi->alpha/100*65535/100); } #endif } |