From f0ebc4f3affbac34920f7be557312927e6cf8a81 Mon Sep 17 00:00:00 2001 From: lecoanet Date: Thu, 11 May 2000 13:58:17 +0000 Subject: Adaptation suite � la r�alisation des polygones multi-contours. --- generic/Icon.c | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) (limited to 'generic/Icon.c') diff --git a/generic/Icon.c b/generic/Icon.c index bd8c7e1..7a89753 100644 --- a/generic/Icon.c +++ b/generic/Icon.c @@ -669,24 +669,24 @@ GetAnchor(Item item, */ static ZnBool GetClipVertices(Item item, - ZnPoint **points, - int *num_points) + ZnPoly *poly) { IconItem icon = (IconItem) item; int w=0, h=0; - + ZnPoint *points; + ZnListAssertSize(item->wi->work_pts, 2); - *points = (ZnPoint *) ZnListArray(item->wi->work_pts); - *num_points = 2; if (icon->image != ZnUnspecifiedImage) { Tk_SizeOfImage(icon->image, &w, &h); } else { Tk_SizeOfBitmap(item->wi->dpy, icon->mask, &w, &h); } - (*points)[0] = icon->pos_dev; - (*points)[1].x = icon->pos_dev.x + w; - (*points)[1].y = icon->pos_dev.y + h; + points = (ZnPoint *) ZnListArray(item->wi->work_pts); + POLY_CONTOUR1(poly, points, 2); + points[0] = icon->pos_dev; + points[1].x = points[0].x + w; + points[1].y = points[0].y + h; return True; } @@ -704,6 +704,7 @@ GetClipVertices(Item item, */ static int Coords(Item item, + int contour, int index, int cmd, ZnPoint **pts, @@ -742,9 +743,9 @@ Coords(Item item, */ static ItemClassStruct ICON_ITEM_CLASS = { sizeof(IconItemStruct), - False, - False, - True, + False, /* has_fields */ + False, /* has_parts */ + True, /* has_anchors */ "icon", icon_attrs, Init, @@ -752,15 +753,17 @@ static ItemClassStruct ICON_ITEM_CLASS = { Destroy, Configure, Query, - NULL, + NULL, /* GetFieldSet */ GetAnchor, GetClipVertices, Coords, + NULL, /* Contour */ ComputeCoordinates, ToArea, Draw, IsSensitive, Pick, + NULL, /* PickVertex */ PostScript }; -- cgit v1.1