aboutsummaryrefslogtreecommitdiff
path: root/generic/Group.c
diff options
context:
space:
mode:
authorlecoanet2000-06-21 14:45:33 +0000
committerlecoanet2000-06-21 14:45:33 +0000
commita5b3e7c2a66c9d2424f9e86a42b6e3a1de4a72ad (patch)
tree55a5db941fc088e17cdac4b8ed3584182527b70d /generic/Group.c
parentdb4dc418f59fe5498fddb450a78f677a05cf40ed (diff)
downloadtkzinc-a5b3e7c2a66c9d2424f9e86a42b6e3a1de4a72ad.zip
tkzinc-a5b3e7c2a66c9d2424f9e86a42b6e3a1de4a72ad.tar.gz
tkzinc-a5b3e7c2a66c9d2424f9e86a42b6e3a1de4a72ad.tar.bz2
tkzinc-a5b3e7c2a66c9d2424f9e86a42b6e3a1de4a72ad.tar.xz
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.
Diffstat (limited to 'generic/Group.c')
-rw-r--r--generic/Group.c21
1 files changed, 11 insertions, 10 deletions
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, &current_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,