diff options
Diffstat (limited to 'generic')
-rw-r--r-- | generic/Curve.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/generic/Curve.c b/generic/Curve.c index 1b14ae3..a31210f 100644 --- a/generic/Curve.c +++ b/generic/Curve.c @@ -1785,7 +1785,7 @@ Coords(Item item, ********************************************************************************** */ #ifdef GPC -static void +static int Contour(Item item, int cmd, ZnPoly *poly) @@ -1793,13 +1793,21 @@ Contour(Item item, CurveItem cv = (CurveItem) item; ZnPoly rpoly; - POLY_INIT(&rpoly); - gpc_polygon_clip(cmd, (gpc_polygon *) &cv->shape, (gpc_polygon *) poly, - (gpc_polygon *) &rpoly); - - POLY_SET(&cv->shape, &rpoly); + switch (cmd) { + case GPC_DIFF: + case GPC_INT: + case GPC_UNION: + case GPC_XOR: + POLY_INIT(&rpoly); + gpc_polygon_clip(cmd, (gpc_polygon *) &cv->shape, (gpc_polygon *) poly, + (gpc_polygon *) &rpoly); + + POLY_SET(&cv->shape, &rpoly); + + ITEM.Invalidate(item, ZN_COORDS_FLAG); + } - ITEM.Invalidate(item, ZN_COORDS_FLAG); + return cv->shape.num_contours; } #endif |