aboutsummaryrefslogtreecommitdiff
path: root/generic/Group.c
diff options
context:
space:
mode:
authorlecoanet2004-07-28 14:41:34 +0000
committerlecoanet2004-07-28 14:41:34 +0000
commit2463c93b50c8c7a2bcd55074aa2f3611daaa452e (patch)
tree8bf1edc1c5416e282859a4d7745f5d68a8296133 /generic/Group.c
parentec70c443da0e8a6627fb6d820a3bb7c9106b05a9 (diff)
downloadtkzinc-2463c93b50c8c7a2bcd55074aa2f3611daaa452e.zip
tkzinc-2463c93b50c8c7a2bcd55074aa2f3611daaa452e.tar.gz
tkzinc-2463c93b50c8c7a2bcd55074aa2f3611daaa452e.tar.bz2
tkzinc-2463c93b50c8c7a2bcd55074aa2f3611daaa452e.tar.xz
Changed the group picking code to enable correct picking with a
complex clipping shape. CVS: ---------------------------------------------------------------------- CVS: Enter Log. Lines beginning with `CVS: ' are removed automatically CVS: committing files: CVS: /home/lecoanet/TCLTK/Tkzinc-3.2.99/generic/Group.c CVS: CVS: Type C-c C-c when done or C-c C-d to abort. CVS: ----------------------------------------------------------------------
Diffstat (limited to 'generic/Group.c')
-rw-r--r--generic/Group.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/generic/Group.c b/generic/Group.c
index 509bd6f..5b5505e 100644
--- a/generic/Group.c
+++ b/generic/Group.c
@@ -1185,6 +1185,7 @@ Pick(ZnItem item,
ZnBBox bbox, inter, *clip_box;
ZnPoint *p = ps->point;
ZnBool atomic;
+ TkRegion reg;
ps->a_item= ZN_NO_ITEM;
ps->a_part = ZN_NO_PART;
@@ -1232,13 +1233,25 @@ Pick(ZnItem item,
bbox.corner.x = p->x + (aperture?aperture:1);
bbox.corner.y = p->y + (aperture?aperture:1);
- if (ZnCurrentClip(wi, NULL, &clip_box, NULL)) {
+ if (ZnCurrentClip(wi, &reg, &clip_box, NULL)) {
ZnIntersectBBox(&bbox, clip_box, &inter);
if (ZnIsEmptyBBox(&inter)) {
goto out;
}
+ if (reg && !ZnPointInRegion(reg, p->x, p->y)) {
+ goto out;
+ }
}
-
+
+ if (group->clip) {
+ PushTransform(group->clip);
+ dist = group->clip->class->Pick(group->clip, ps);
+ PopTransform(group->clip);
+ if (dist > 0.0) {
+ goto out;
+ }
+ }
+
current_item = (ps->start_item == ZN_NO_ITEM) ? group->head : ps->start_item;
atomic = ISSET(item->flags, ATOMIC_BIT) && !ps->override_atomic;