diff options
author | lecoanet | 2002-09-02 12:22:45 +0000 |
---|---|---|
committer | lecoanet | 2002-09-02 12:22:45 +0000 |
commit | f229c5c574c753a7f6ca14e2efa9e712cc4dd73d (patch) | |
tree | 967601da5eb473bf86302e7a54e523fb47594652 | |
parent | fa16c881347c880e4a32369e6847b106db8e2612 (diff) | |
download | tkzinc-f229c5c574c753a7f6ca14e2efa9e712cc4dd73d.zip tkzinc-f229c5c574c753a7f6ca14e2efa9e712cc4dd73d.tar.gz tkzinc-f229c5c574c753a7f6ca14e2efa9e712cc4dd73d.tar.bz2 tkzinc-f229c5c574c753a7f6ca14e2efa9e712cc4dd73d.tar.xz |
* (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.
-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 |