From fb82091fbba2545e3c8a20abe89a7a9566d7aa05 Mon Sep 17 00:00:00 2001 From: lecoanet Date: Mon, 26 Nov 2001 09:21:17 +0000 Subject: R�alisation du clipping non rectangulaire --- Bezier.c | 47 +++++++++++++++++++++++++++++++++++++++++++++-- 1 file 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 */ -- cgit v1.1