aboutsummaryrefslogtreecommitdiff
path: root/generic/tkZinc.c
diff options
context:
space:
mode:
authorlecoanet2001-11-26 08:39:10 +0000
committerlecoanet2001-11-26 08:39:10 +0000
commitb8eaa1aaa315495709f00d37e26845c3e46fa531 (patch)
tree586e0830c546101a91296c03d084e9d79c366cef /generic/tkZinc.c
parentd8c25aa60a7d38117726e47b994cf1db96ebfbe0 (diff)
downloadtkzinc-b8eaa1aaa315495709f00d37e26845c3e46fa531.zip
tkzinc-b8eaa1aaa315495709f00d37e26845c3e46fa531.tar.gz
tkzinc-b8eaa1aaa315495709f00d37e26845c3e46fa531.tar.bz2
tkzinc-b8eaa1aaa315495709f00d37e26845c3e46fa531.tar.xz
Remise en place et debugage du clipping non rectangulaire.
Correction d'un bug de binding d'�v�nements sur enter/leave des items
Diffstat (limited to 'generic/tkZinc.c')
-rw-r--r--generic/tkZinc.c43
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;
/*