aboutsummaryrefslogtreecommitdiff
path: root/Bezier.c
diff options
context:
space:
mode:
authorlecoanet2001-11-26 09:21:17 +0000
committerlecoanet2001-11-26 09:21:17 +0000
commitfb82091fbba2545e3c8a20abe89a7a9566d7aa05 (patch)
treecf787ac12d6be842f5b10aebbe685de46cfdb67f /Bezier.c
parent1e2bf886275a1cc4ec2fbc27e4587d91be4b2764 (diff)
downloadtkzinc-fb82091fbba2545e3c8a20abe89a7a9566d7aa05.zip
tkzinc-fb82091fbba2545e3c8a20abe89a7a9566d7aa05.tar.gz
tkzinc-fb82091fbba2545e3c8a20abe89a7a9566d7aa05.tar.bz2
tkzinc-fb82091fbba2545e3c8a20abe89a7a9566d7aa05.tar.xz
R�alisation du clipping non rectangulaire
Diffstat (limited to 'Bezier.c')
-rw-r--r--Bezier.c47
1 files changed, 45 insertions, 2 deletions
diff --git a/Bezier.c b/Bezier.c
index 4e5ccef..aa2719a 100644
--- a/Bezier.c
+++ b/Bezier.c
@@ -938,12 +938,54 @@ PostScript(Item item,
*
* GetClipVertices --
* Get the clipping shape.
+ * Never ever call TRI_FREE on the tristrip returned by GetClipVertices.
*
**********************************************************************************
*/
static ZnBool
-GetClipVertices(Item item,
- ZnPoly *poly)
+GetClipVertices(Item item,
+ ZnTriStrip *tristrip)
+{
+ BezierItem bz = (BezierItem) item;
+ WidgetInfo *wi = item->wi;
+#ifndef GPC_TODO
+ ZnPoint *points;
+#endif
+
+#ifdef GPC_TODO
+ if (bz->dev_points) {
+ GetBezierPath(bz->dev_points, wi->work_pts);
+
+ POLY_CONTOUR1(poly, (ZnPoint *) ZnListArray(wi->work_pts),
+ ZnListSize(wi->work_pts));
+ }
+
+ return False;
+#else
+ ZnListAssertSize(item->wi->work_pts, 2);
+ points = (ZnPoint *) ZnListArray(item->wi->work_pts);
+ TRI_STRIP1(tristrip, points, 2);
+ points[0] = item->item_bounding_box.orig;
+ points[1] = item->item_bounding_box.corner;
+
+ return True;
+
+#endif
+}
+
+
+/*
+ **********************************************************************************
+ *
+ * GetContours --
+ * Get the external contour(s).
+ * Never ever call POLY_FREE on the poly returned by GetContours.
+ *
+ **********************************************************************************
+ */
+static ZnBool
+GetContours(Item item,
+ ZnPoly *poly)
{
BezierItem bz = (BezierItem) item;
WidgetInfo *wi = item->wi;
@@ -1160,6 +1202,7 @@ static ItemClassStruct BEZIER_ITEM_CLASS = {
NULL,
NULL,
GetClipVertices,
+ GetContours,
Coords,
NULL, /* InsertChars */
NULL, /* DeleteChars */