From 757e9dce2cea68779866278c29d39fdd021ffec3 Mon Sep 17 00:00:00 2001 From: lecoanet Date: Thu, 11 May 2000 13:48:30 +0000 Subject: Modif suite � l'introduction de la structure polygone multi-contours. --- generic/Arc.c | 39 +++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 20 deletions(-) (limited to 'generic') diff --git a/generic/Arc.c b/generic/Arc.c index de11259..3fab559 100644 --- a/generic/Arc.c +++ b/generic/Arc.c @@ -733,7 +733,7 @@ ToArea(Item item, num_points = ZnListSize(wi->work_pts); if (ISSET(arc->flags, FILLED_BIT)) { - result = PolygonInBBox(points, num_points, area); + result = PolygonInBBox(points, num_points, area, NULL); if (result == 0) { return 0; } @@ -764,14 +764,14 @@ ToArea(Item item, if (ISSET(arc->flags, FIRST_END_OK)) { GetLineEnd(&points[0], &points[1], arc->line_width, CapRound, arc->first_end, pts); - if (PolygonInBBox(pts, LINE_END_POINTS, area) != result) { + if (PolygonInBBox(pts, LINE_END_POINTS, area, NULL) != result) { return 0; } } if (ISSET(arc->flags, LAST_END_OK)) { GetLineEnd(&points[num_points-1], &points[num_points-2], arc->line_width, CapRound, arc->last_end, pts); - if (PolygonInBBox(pts, LINE_END_POINTS, area) != result) { + if (PolygonInBBox(pts, LINE_END_POINTS, area, NULL) != result) { return 0; } } @@ -925,7 +925,7 @@ ToArea(Item item, Tangent(arc, True, &tang); GetLineEnd(&arc->center1, &tang, arc->line_width, CapRound, arc->first_end, pts); - if (PolygonInBBox(pts, LINE_END_POINTS, area) != result) { + if (PolygonInBBox(pts, LINE_END_POINTS, area, NULL) != result) { return 0; } } @@ -933,7 +933,7 @@ ToArea(Item item, Tangent(arc, False, &tang); GetLineEnd(&arc->center2, &tang, arc->line_width, CapRound, arc->last_end, pts); - if (PolygonInBBox(pts, LINE_END_POINTS, area) != result) { + if (PolygonInBBox(pts, LINE_END_POINTS, area, NULL) != result) { return 0; } } @@ -1025,7 +1025,9 @@ Draw(Item item) /* Fill if requested */ if (ISSET(arc->flags, FILLED_BIT)) { if (arc->grad_geom) { - DrawPolygonGradient(wi, arc->grad_geom, arc->fill_color, p, num_points, + ZnPoly poly; + POLY_CONTOUR1(&poly, p, num_points); + DrawPolygonGradient(wi, arc->grad_geom, arc->fill_color, &poly, &item->item_bounding_box); } else { @@ -1483,8 +1485,7 @@ Pick(Item item, */ static ZnBool GetClipVertices(Item item, - ZnPoint **points, - int *num_points) + ZnPoly *poly) { WidgetInfo *wi = item->wi; ArcItem arc = (ArcItem) item; @@ -1492,11 +1493,6 @@ GetClipVertices(Item item, int i, num_p; ZnPoint *p_list; - /* - * Il n'est pas possible de faire GetArcPath ici on ne dispose - * pas de la transfo pour recaler ou alors il faut faire - * avec les coins transformés. - */ if (ISCLEAR(arc->flags, USING_POLY_BIT)) { if (!arc->render_shape) { arc->render_shape = ZnListNew(4, sizeof(ZnPoint)); @@ -1519,8 +1515,8 @@ GetClipVertices(Item item, } GetBezierPath(arc->render_shape, wi->work_pts); - *points = (ZnPoint *) ZnListArray(wi->work_pts); - *num_points = ZnListSize(wi->work_pts); + POLY_CONTOUR1(poly, (ZnPoint *) ZnListArray(wi->work_pts), + ZnListSize(wi->work_pts)); return False; } @@ -1536,6 +1532,7 @@ GetClipVertices(Item item, */ static int Coords(Item item, + int contour, int index, int cmd, ZnPoint **pts, @@ -1618,9 +1615,9 @@ PostScript(Item item, */ static ItemClassStruct ARC_ITEM_CLASS = { sizeof(ArcItemStruct), - False, - False, - False, + False, /* has_fields */ + False, /* has_parts */ + False, /* has_anchors */ "arc", arc_attrs, Init, @@ -1628,15 +1625,17 @@ static ItemClassStruct ARC_ITEM_CLASS = { Destroy, Configure, Query, - NULL, - NULL, + NULL, /* GetFieldSet */ + NULL, /* GetAnchor */ GetClipVertices, Coords, + NULL, /* Contour */ ComputeCoordinates, ToArea, Draw, IsSensitive, Pick, + NULL, /* PickVertex */ PostScript }; -- cgit v1.1