From f229c5c574c753a7f6ca14e2efa9e712cc4dd73d Mon Sep 17 00:00:00 2001 From: lecoanet Date: Mon, 2 Sep 2002 12:22:45 +0000 Subject: * (Contour): Retourne le nombre de contours apr�s la commande. Si le param�tre cmd est hors des commandes admises, le seul effet est de retourner le nombre de contours. --- generic/Curve.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'generic/Curve.c') 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 -- cgit v1.1