From b8eaa1aaa315495709f00d37e26845c3e46fa531 Mon Sep 17 00:00:00 2001 From: lecoanet Date: Mon, 26 Nov 2001 08:39:10 +0000 Subject: Remise en place et debugage du clipping non rectangulaire. Correction d'un bug de binding d'�v�nements sur enter/leave des items --- generic/tkZinc.c | 43 +++++++++++++++++++++++++++++++++---------- 1 file changed, 33 insertions(+), 10 deletions(-) (limited to 'generic/tkZinc.c') diff --git a/generic/tkZinc.c b/generic/tkZinc.c index 8d372e7..712b646 100644 --- a/generic/tkZinc.c +++ b/generic/tkZinc.c @@ -2170,12 +2170,31 @@ Contour(WidgetInfo *wi, * update or the shape will be erroneous. */ ITEM_P.Update(wi); - if (!shape->class->GetClipVertices) { + if (!shape->class->GetContours && + !shape->class->GetClipVertices) { + noshape: Tcl_AppendResult(wi->interp, "class: \"", shape->class->name, "\" can't give a polygonal shape", NULL); return ZN_ERROR; } - simple = shape->class->GetClipVertices(shape, &poly); + if (!shape->class->GetContours) { + ZnTriStrip tristrip; + /* + * If there is no GetContours mrthod try to use + * the GetClipVertices. It works only for simple + * shapes (i.e tose returning a bounding box). + */ + tristrip.num_strips = 0; + simple = shape->class->GetClipVertices(shape, &tristrip); + if (!simple) { + goto noshape; + } + POLY_CONTOUR1(&poly, tristrip.strip1.points, tristrip.strip1.num_points); + } + else { + poly.num_contours = 0; + simple = shape->class->GetContours(shape, &poly); + } if (poly.num_contours == 0) { return ZN_OK; } @@ -4892,15 +4911,19 @@ PickCurrentItem(WidgetInfo *wi, ITEM.RemoveTag(wi->current_item, current_uid); } }*/ - wi->current_item = wi->new_item; - wi->current_part = wi->new_part; - /* - * Added to enable DoEvent to make a special case for enter/leaves - * between fields in the same item. It may interact with - * LEFT_GRABBED_ITEM. - */ - wi->new_item = ZN_NO_ITEM; + { + Item it = wi->current_item; + wi->current_item = wi->new_item; + wi->current_part = wi->new_part; + /* + * Added to enable DoEvent to make a special case for enter/leaves + * between fields in the same item. It may interact with + * LEFT_GRABBED_ITEM. + */ + wi->new_item = it; + } + if (wi->current_item != ZN_NO_ITEM) { XEvent event; /* -- cgit v1.1