aboutsummaryrefslogtreecommitdiff
path: root/generic/Group.c
diff options
context:
space:
mode:
authorlecoanet2002-05-29 14:55:53 +0000
committerlecoanet2002-05-29 14:55:53 +0000
commitcead3d7978b499e39a03b7f068ea8b1ae7470a21 (patch)
tree1532d3e272d02c64d8f71b2812340b5b5c0bedc4 /generic/Group.c
parent3e0441b23b8cd6a7cfbafa7230c1b8c8d36314c1 (diff)
downloadtkzinc-cead3d7978b499e39a03b7f068ea8b1ae7470a21.zip
tkzinc-cead3d7978b499e39a03b7f068ea8b1ae7470a21.tar.gz
tkzinc-cead3d7978b499e39a03b7f068ea8b1ae7470a21.tar.bz2
tkzinc-cead3d7978b499e39a03b7f068ea8b1ae7470a21.tar.xz
* (ToArea): Correction du comportement de ToArea: le test
d'atomicit� �tait effectu� trop t�t emp�chant une recherche overlapping/enclosed � partir d'un groupe(ou d'un fils d'un groupe) atomique. De plus le m�me test empechait le groupe de d�part d'enregistrer ses fils (il ne doit pas se comporter comme un groupe atomique m�me si il l'est).
Diffstat (limited to 'generic/Group.c')
-rw-r--r--generic/Group.c27
1 files changed, 19 insertions, 8 deletions
diff --git a/generic/Group.c b/generic/Group.c
index 4eb356d..201fc11 100644
--- a/generic/Group.c
+++ b/generic/Group.c
@@ -768,15 +768,8 @@ ToArea(Item item,
ZnBBox enclosing, inter;
int result = -1;
ZnBool outside, inside;
- ZnBool atomic = ISSET(item->flags, ATOMIC_BIT);
- ZnBool report, empty = True;
+ ZnBool atomic, report, empty = True;
- /*
- * If this group is ATOMIC, ask the child groups to report
- * instead of adding their children to the result.
- */
- report = ta->report;
- ta->report |= atomic;
PushTransform(item);
@@ -800,6 +793,7 @@ ToArea(Item item,
/* No group found in this subtree. */
goto out;
}
+
/*
* At this point we are either in the target group
* or one of its sub-groups. If in the target group,
@@ -807,8 +801,24 @@ ToArea(Item item,
* the fact.
*/
if (ta->in_group == item) {
+ /*
+ * We are in the target group, mark the fact and bypass the group
+ * atomicity.
+ */
ta->in_group = ZN_NO_ITEM;
+ atomic = False;
}
+ else {
+ /*
+ * We are below the start group, If this group is ATOMIC,
+ * ask the child groups to report instead of adding their
+ * children to the result.
+ */
+ atomic = ISSET(item->flags, ATOMIC_BIT);
+ report = ta->report;
+ ta->report |= atomic;
+ }
+
enclosing.orig.x = ta->area->orig.x - 1;
enclosing.orig.y = ta->area->orig.y - 1;
enclosing.corner.x = ta->area->corner.x + 1;
@@ -833,6 +843,7 @@ ToArea(Item item,
if (current_item->class != ZnGroup) {
PushTransform(current_item);
}
+
if ((current_item->class != ZnGroup) || atomic || ta->recursive) {
result = current_item->class->ToArea(current_item, ta);
outside &= (result == -1);