diff options
Diffstat (limited to 'generic/tkZinc.c')
-rw-r--r-- | generic/tkZinc.c | 43 |
1 files changed, 33 insertions, 10 deletions
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; /* |