aboutsummaryrefslogtreecommitdiff
path: root/generic/Arc.c
diff options
context:
space:
mode:
authorlecoanet2002-01-22 10:57:28 +0000
committerlecoanet2002-01-22 10:57:28 +0000
commitcd7b949f50063bf9e9357ffad9c65ce8d0f8f850 (patch)
treec3f08478aa25384ccc26462a02b172165033b927 /generic/Arc.c
parentc9287f7f3867205e5d58b40a228423f66d20fa64 (diff)
downloadtkzinc-cd7b949f50063bf9e9357ffad9c65ce8d0f8f850.zip
tkzinc-cd7b949f50063bf9e9357ffad9c65ce8d0f8f850.tar.gz
tkzinc-cd7b949f50063bf9e9357ffad9c65ce8d0f8f850.tar.bz2
tkzinc-cd7b949f50063bf9e9357ffad9c65ce8d0f8f850.tar.xz
Traitement du contour par RenderPolyline au lieu de gle.
Diffstat (limited to 'generic/Arc.c')
-rw-r--r--generic/Arc.c44
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
}