From a5b3e7c2a66c9d2424f9e86a42b6e3a1de4a72ad Mon Sep 17 00:00:00 2001 From: lecoanet Date: Wed, 21 Jun 2000 14:45:33 +0000 Subject: Correction de la m�thode Clone qui produisait des clones avec des fils en ordre inverse. Modification de Pick afin qu'elle retourne toujours un item : le plus proche. --- generic/Group.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'generic') diff --git a/generic/Group.c b/generic/Group.c index 8a99a0d..268904b 100644 --- a/generic/Group.c +++ b/generic/Group.c @@ -126,7 +126,7 @@ Clone(Item item) Tcl_HashEntry *entry; int new, num_items, i; - current_item = group->head; + current_item = group->tail; group->head = group->tail = ZN_NO_ITEM; #ifdef OM group->call_om = False; @@ -153,7 +153,7 @@ Clone(Item item) if (current_item == group->clip) { group->clip = new_item; } - current_item = current_item->next; + current_item = current_item->previous; } /* @@ -936,10 +936,6 @@ Pick(Item item, ISCLEAR(current_item->flags, VISIBLE_BIT)) { goto cont; } - IntersectBBox(&bbox, ¤t_item->item_bounding_box, &inter); - if (IsEmptyBBox(&inter)) { - goto cont; - } if (current_item->class != ZnGroup) { if (in_depth) { goto cont; @@ -947,8 +943,9 @@ Pick(Item item, PushTransform(current_item); p_item = current_item; p_part = ZN_NO_PART; - dist = current_item->class->Pick(current_item, p, NULL, aperture, + dist = current_item->class->Pick(current_item, p, NULL, 0, &p_item, &p_part); + dist -= aperture; PopTransform(current_item); } else { @@ -956,7 +953,10 @@ Pick(Item item, in_depth ? start_item : NULL, aperture, &p_item, &p_part); } - if ((dist > aperture) || (dist >= best)) { + if (dist < 0.0) { + dist = 0.0; + } + if (dist >= best) { goto cont; } if (ISSET(item->flags, ATOMIC_BIT)) { @@ -968,7 +968,7 @@ Pick(Item item, } best = dist; /*printf("found %d:%d, at %g\n", (*a_item)->id, *a_part, dist);*/ - if (dist <= 0.0) { + if (dist == 0.0) { break; } cont: @@ -1054,7 +1054,7 @@ PostScript(Item item, static ItemClassStruct GROUP_ITEM_CLASS = { sizeof(GroupItemStruct), False, /* has_fields */ - False, /* has_parts */ + 0, /* num_parts */ False, /* has_anchors */ "group", group_attrs, @@ -1071,6 +1071,7 @@ static ItemClassStruct GROUP_ITEM_CLASS = { NULL, /* DeleteChars */ NULL, /* Cursor */ NULL, /* Index */ + NULL, /* Part */ NULL, /* Selection */ NULL, /* Contour */ ComputeCoordinates, -- cgit v1.1