From 739d556eb6715c91d5e9748a7670badac289dfe2 Mon Sep 17 00:00:00 2001 From: lecoanet Date: Mon, 26 Nov 2001 09:24:21 +0000 Subject: Adaptation pour le clippnig non rectangulaire --- generic/Tabular.c | 10 +++++----- generic/Text.c | 8 +++++--- generic/Window.c | 9 +++++---- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/generic/Tabular.c b/generic/Tabular.c index 5a0acb4..c24244c 100644 --- a/generic/Tabular.c +++ b/generic/Tabular.c @@ -448,24 +448,23 @@ GetAnchor(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) { FieldSet field_set = &((TabularItem) item)->field_set; ZnDim width, height; ZnPoint *points; - poly->num_contours = 0; - if (field_set->label_format) { ITEM_P.GetLabelBBox(field_set, &width, &height); ZnListAssertSize(item->wi->work_pts, 2); points = (ZnPoint *) ZnListArray(item->wi->work_pts); - POLY_CONTOUR1(poly, points, 2); + TRI_STRIP1(tristrip, points, 2); points[0] = field_set->label_pos; points[1].x = points[0].x + width; points[1].y = points[0].y + height; @@ -585,6 +584,7 @@ static ItemClassStruct TABULAR_ITEM_CLASS = { GetFieldSet, GetAnchor, GetClipVertices, + NULL, /* GetContours */ Coords, NULL, /* InsertChars */ NULL, /* DeleteChars */ diff --git a/generic/Text.c b/generic/Text.c index 02935f6..bc9a4a5 100644 --- a/generic/Text.c +++ b/generic/Text.c @@ -923,18 +923,19 @@ GetAnchor(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) { ZnPoint *points; ZnListAssertSize(item->wi->work_pts, 2); points = (ZnPoint *) ZnListArray(item->wi->work_pts); - POLY_CONTOUR1(poly, points, 2); + TRI_STRIP1(tristrip, points, 2); points[0] = item->item_bounding_box.orig; points[1] = item->item_bounding_box.corner; @@ -1341,6 +1342,7 @@ static ItemClassStruct TEXT_ITEM_CLASS = { NULL, /* GetFieldSet */ GetAnchor, GetClipVertices, + NULL, /* GetContours */ Coords, InsertChars, DeleteChars, diff --git a/generic/Window.c b/generic/Window.c index eae6e84..d894d3c 100644 --- a/generic/Window.c +++ b/generic/Window.c @@ -584,8 +584,8 @@ GetAnchor(Item item, ********************************************************************************** */ static ZnBool -GetClipVertices(Item item, - ZnPoly *poly) +GetClipVertices(Item item, + ZnTriStrip *tristrip) { WindowItem wind = (WindowItem) item; int w=0, h=0; @@ -596,8 +596,8 @@ GetClipVertices(Item item, w = wind->real_width; h = wind->real_height; } - points = (ZnPoint *) ZnListArray(item->wi->work_pts); - POLY_CONTOUR1(poly, points, 2); + points = ZnListArray(item->wi->work_pts); + TRI_STRIP1(tristrip, points, 2); points[0] = wind->pos_dev; points[1].x = points[0].x + w; points[1].y = points[0].y + h; @@ -670,6 +670,7 @@ static ItemClassStruct WINDOW_ITEM_CLASS = { NULL, /* GetFieldSet */ GetAnchor, GetClipVertices, + NULL, /* GetContours */ Coords, NULL, /* InsertChars */ NULL, /* DeleteChars */ -- cgit v1.1