From cead3d7978b499e39a03b7f068ea8b1ae7470a21 Mon Sep 17 00:00:00 2001 From: lecoanet Date: Wed, 29 May 2002 14:55:53 +0000 Subject: * (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). --- generic/Group.c | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) (limited to 'generic/Group.c') 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); -- cgit v1.1