aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Bezier.c74
1 files changed, 34 insertions, 40 deletions
diff --git a/Bezier.c b/Bezier.c
index 2b63a53..f330b9d 100644
--- a/Bezier.c
+++ b/Bezier.c
@@ -386,7 +386,9 @@ Configure(Item item,
}
if ((bz->relief != RELIEF_FLAT) && !bz->gradient) {
bz->gradient = ZnGetReliefGradient(wi->interp, wi->win,
- ZnNameOfColor(ZnGetGradientColor(wi->win, bz->fill_color, 50.0)));
+ ZnNameOfColor(ZnGetGradientColor(wi->win,
+ bz->fill_color,
+ 50.0, NULL)));
if (bz->gradient == NULL) {
status = ZN_ERROR;
}
@@ -690,47 +692,39 @@ Draw(Item item)
* Fill if requested.
*/
if (ISSET(bz->flags, FILLED_OK)) {
- if (!ZnGradientFlat(bz->fill_color)) {
- ZnPoly poly;
- POLY_CONTOUR1(&poly, points, num_points);
- DrawPolygonGradient(wi, bz->fill_color, &poly,
- &item->item_bounding_box);
+ values.foreground = ZnPixel(ZnGetGradientColor(wi->win, bz->fill_color, 0.0, NULL));
+ gc_mask = GCFillStyle;
+ if (bz->tile != ZnUnspecifiedImage) { /* Fill tiled */
+ Pixmap pmap = GetImagePixmap(wi->win, bz->tile_name, bz->tile, NULL);
+ values.fill_style = FillTiled;
+ values.tile = pmap;
+ values.ts_x_origin = REAL_TO_INT(item->item_bounding_box.orig.x);
+ values.ts_y_origin = REAL_TO_INT(item->item_bounding_box.orig.y);
+ gc_mask |= GCTileStipXOrigin|GCTileStipYOrigin|GCTile;
}
- else {
- values.foreground = ZnPixel(ZnGetGradientColor(wi->win, bz->fill_color, 50.0));
- gc_mask = GCFillStyle;
- if (bz->tile != ZnUnspecifiedImage) { /* Fill tiled */
- Pixmap pmap = GetImagePixmap(wi->win, bz->tile_name, bz->tile, NULL);
- values.fill_style = FillTiled;
- values.tile = pmap;
- values.ts_x_origin = REAL_TO_INT(item->item_bounding_box.orig.x);
- values.ts_y_origin = REAL_TO_INT(item->item_bounding_box.orig.y);
- gc_mask |= GCTileStipXOrigin|GCTileStipYOrigin|GCTile;
- }
- else if (bz->fill_pattern != ZnUnspecifiedPattern) { /* Fill stippled */
- values.fill_style = FillStippled;
- values.stipple = bz->fill_pattern;
- values.ts_x_origin = REAL_TO_INT(item->item_bounding_box.orig.x);
- values.ts_y_origin = REAL_TO_INT(item->item_bounding_box.orig.y);
- gc_mask |= GCTileStipXOrigin|GCTileStipYOrigin|GCStipple|GCForeground;
- }
- else { /* Fill solid */
- values.fill_style = FillSolid;
- gc_mask |= GCForeground;
- }
- XChangeGC(wi->dpy, wi->gc, gc_mask, &values);
-
- if (!xpoints) {
- ZnListAssertSize(wi->work_xpts, num_points);
- xpoints = (XPoint *) ZnListArray(wi->work_xpts);
- for (i = 0; i < num_points; i++) {
- xpoints[i].x = REAL_TO_INT(points[i].x);
- xpoints[i].y = REAL_TO_INT(points[i].y);
- }
+ else if (bz->fill_pattern != ZnUnspecifiedPattern) { /* Fill stippled */
+ values.fill_style = FillStippled;
+ values.stipple = bz->fill_pattern;
+ values.ts_x_origin = REAL_TO_INT(item->item_bounding_box.orig.x);
+ values.ts_y_origin = REAL_TO_INT(item->item_bounding_box.orig.y);
+ gc_mask |= GCTileStipXOrigin|GCTileStipYOrigin|GCStipple|GCForeground;
+ }
+ else { /* Fill solid */
+ values.fill_style = FillSolid;
+ gc_mask |= GCForeground;
+ }
+ XChangeGC(wi->dpy, wi->gc, gc_mask, &values);
+
+ if (!xpoints) {
+ ZnListAssertSize(wi->work_xpts, num_points);
+ xpoints = (XPoint *) ZnListArray(wi->work_xpts);
+ for (i = 0; i < num_points; i++) {
+ xpoints[i].x = REAL_TO_INT(points[i].x);
+ xpoints[i].y = REAL_TO_INT(points[i].y);
}
- XFillPolygon(wi->dpy, wi->draw_buffer, wi->gc,
- xpoints, num_points, Complex, CoordModeOrigin);
}
+ XFillPolygon(wi->dpy, wi->draw_buffer, wi->gc,
+ xpoints, num_points, Complex, CoordModeOrigin);
}
/*
@@ -748,7 +742,7 @@ Draw(Item item)
points, num_points, ISCLEAR(bz->flags, CCW)?-lw:lw);
}
else {
- SetLineStyle(wi->dpy, wi->gc, bz->line_style);
+ SetLineStyle(wi, bz->line_style);
values.foreground = ZnPixel(bz->line_color);
values.line_width = (lw == 1) ? 0 : lw;
values.join_style = JoinRound;