From 0e48458f8a598a83f29baeb8e54ecb8847dcd4eb Mon Sep 17 00:00:00 2001 From: lecoanet Date: Mon, 16 Jun 2003 14:39:08 +0000 Subject: Simplified the gradient routines interface. Use of the new ZnGetGradientPixel instead of ZnGetGradientColor in X. --- generic/Arc.c | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) (limited to 'generic') diff --git a/generic/Arc.c b/generic/Arc.c index 147bf83..4ffb885 100644 --- a/generic/Arc.c +++ b/generic/Arc.c @@ -447,7 +447,7 @@ UpdateRenderShape(ArcItem arc) ZnTransformPoint(t, &p, &p2); d = hypot(o2.x-p2.x, o2.y-p2.y); if (d > 100.0) { - quality = ZN_CIRCLE_FINEST; + quality = ZN_CIRCLE_FINER; } else if (d > 30.0) { quality = ZN_CIRCLE_FINE; @@ -541,17 +541,11 @@ ComputeCoordinates(ZnItem item, p[3].x = p[0].x; p[3].y = p[2].y; ZnPolyContour1(&shape, p, 4, False); - ZnComputeAxialGradient(wi, &shape, (ZnReal) arc->fill_color->g.angle, - arc->grad_geo); } - else if (arc->fill_color->type == ZN_RADIAL_GRADIENT) { - ZnPolyContour1(&shape, arc->coords, 2, False); - ZnComputeRadialGradient(wi, &shape, True, &arc->fill_color->g.p, arc->grad_geo); - } - else if (arc->fill_color->type == ZN_PATH_GRADIENT) { + else { ZnPolyContour1(&shape, arc->coords, 2, False); - ZnComputePathGradient(wi, &shape, &arc->fill_color->g.p, arc->grad_geo); } + ZnComputeGradient(arc->fill_color, wi, &shape, arc->grad_geo); } else { if (arc->grad_geo) { @@ -1006,7 +1000,7 @@ Draw(ZnItem item) /* Fill if requested */ if (ISSET(arc->flags, FILLED_BIT)) { - values.foreground = ZnPixel(ZnGetGradientColor(arc->fill_color, 0.0, NULL)); + values.foreground = ZnGetGradientPixel(arc->fill_color, 0.0); values.arc_mode = ISSET(arc->flags, PIE_SLICE_BIT) ? ArcPieSlice : ArcChord; if (arc->tile != ZnUnspecifiedImage) { if (!ZnImageIsBitmap(arc->tile)) { /* Fill tiled */ @@ -1055,7 +1049,7 @@ Draw(ZnItem item) ZnPoint tang; ZnSetLineStyle(wi, arc->line_style); - values.foreground = ZnPixel(ZnGetGradientColor(arc->line_color, 0.0, NULL)); + values.foreground = ZnGetGradientPixel(arc->line_color, 0.0); values.line_width = (arc->line_width == 1) ? 0 : (int) arc->line_width; values.cap_style = CapRound; values.join_style = JoinRound; @@ -1200,8 +1194,6 @@ Render(ZnItem item) ArcItem arc = (ArcItem) item; unsigned int num_points=0; ZnPoint *p=NULL; - XColor *color; - unsigned short alpha; if (ISCLEAR(arc->flags, FILLED_BIT) && !arc->line_width) { return; @@ -1229,7 +1221,8 @@ Render(ZnItem item) (ZnPoint *) &item->item_bounding_box); } else { - color = ZnGetGradientColor(arc->fill_color, 0.0, &alpha); + unsigned short alpha; + XColor *color = ZnGetGradientColor(arc->fill_color, 0.0, &alpha); alpha = ZnComposeAlpha(alpha, wi->alpha); glColor4us(color->red, color->green, color->blue, alpha); ArcRenderCB(arc); -- cgit v1.1