aboutsummaryrefslogtreecommitdiff
path: root/generic
diff options
context:
space:
mode:
Diffstat (limited to 'generic')
-rw-r--r--generic/Curve.c56
1 files changed, 49 insertions, 7 deletions
diff --git a/generic/Curve.c b/generic/Curve.c
index df32562..ab18ce5 100644
--- a/generic/Curve.c
+++ b/generic/Curve.c
@@ -222,8 +222,8 @@ Init(Item item,
SET(item->flags, SENSITIVE_BIT);
SET(item->flags, COMPOSE_ROTATION_BIT);
SET(item->flags, COMPOSE_SCALE_BIT);
- SET(item->flags, CLOSED_BIT);
- SET(item->flags, REDUCED_BIT);
+ SET(cv->flags, CLOSED_BIT);
+ SET(cv->flags, REDUCED_BIT);
item->priority = DEFAULT_CURVE_PRIORITY;
@@ -279,8 +279,10 @@ Init(Item item,
*/
SET(cv->flags, MARKED_BIT);
cv->marker = ZnUnspecifiedPattern;
+ cv->fill_alpha = 255;
cv->fill_color = ZnGetColorGradient(wi->interp, wi->win,
ZnNameOfColor(wi->fore_color));
+ cv->line_alpha = 255;
cv->line_color = ZnGetColorByValue(wi->win, wi->fore_color);
cv->marker_color = ZnGetColorByValue(wi->win, wi->fore_color);
cv->grad_geom = NULL;
@@ -363,10 +365,7 @@ Clone(Item item)
if (cv->grad_geom) {
cv->grad_geom = GradientGeomDuplicate(cv->grad_geom);
}
- if (cv->outline_svp) {
- }
- if (cv->fill_svp) {
- }
+ cv->outline_svp = cv->fill_svp = NULL;
}
@@ -714,6 +713,49 @@ ComputeCoordinates(Item item,
lw = cv->line_width;
+ /*
+ * PLC Rendering works only with one contour, no relief, no markers,
+ * round ends, round joins.
+ */
+ if (wi->local_render) {
+ ArtVpath *vpath;
+
+ c1 = cv->dev_shape.contours;
+ vpath = (ArtVpath *) ZnMalloc((c1->num_points+2) * sizeof(ArtVpath));
+ points = c1->points;
+ for (i = 0; i < c1->num_points; i++, points++) {
+ vpath[i].code = ART_LINETO;
+ vpath[i].x = points->x;
+ vpath[i].y = points->y;
+ }
+ if (ISSET(cv->flags, CLOSED_BIT)) {
+ vpath[0].code = ART_MOVETO;
+ }
+ else {
+ vpath[0].code = ART_MOVETO_OPEN;
+ }
+ vpath[i].code = ART_END;
+
+ if (cv->fill_svp) {
+ art_svp_free(cv->fill_svp);
+ cv->fill_svp = NULL;
+ }
+ if (ISSET(cv->flags, FILLED_BIT)) {
+ cv->fill_svp = art_svp_from_vpath(vpath);
+ }
+ if (cv->outline_svp) {
+ art_svp_free(cv->outline_svp);
+ cv->outline_svp = NULL;
+ }
+ if (cv->line_width) {
+ cv->outline_svp = art_svp_vpath_stroke(vpath,
+ ART_PATH_STROKE_JOIN_ROUND,
+ ART_PATH_STROKE_CAP_ROUND,
+ lw, 2, 1);
+ }
+ ZnFree(vpath);
+ }
+
if (ISSET(cv->flags, RELIEF_OK)) {
holes = cv->shape.holes;
c2 = cv->dev_shape.contours;
@@ -745,7 +787,7 @@ ComputeCoordinates(Item item,
}
}
- /*
+ /*
* Add the line width in all directions.
* This overestimates the space needed to draw the polyline
* but is simple.