diff options
-rw-r--r-- | generic/tkZinc.c | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/generic/tkZinc.c b/generic/tkZinc.c index b47abe1..0dc1f21 100644 --- a/generic/tkZinc.c +++ b/generic/tkZinc.c @@ -384,11 +384,10 @@ ZincCmd(ClientData client_data, /* Main window associated with wi->work_item_list = NULL; wi->work_pts = ZnListNew(8, sizeof(ZnPoint)); + wi->work_xpts = ZnListNew(8, sizeof(XPoint)); - wi->clip_stack = ZnListNew(8, sizeof(ClipState)); - ITEM_P.ResetClipStack(wi); - wi->transfo_stack = ZnListNew(8, sizeof(ZnTransfo)); - ITEM_P.ResetTransformStack(wi); + ITEM_P.InitClipStack(wi); + ITEM_P.InitTransformStack(wi); for (num = 0; num < NUM_ALPHA_STEPS; num++) { char name[INTEGER_SPACE+12]; @@ -1202,7 +1201,7 @@ FindItems(Tcl_Interp *interp, } num_items = ZnItemsWithTagOrId(wi, LangString(args[1]), &item, &items); if (num_items == 0) { - return ZN_ERROR; + Tcl_SetResult(interp, "", TCL_STATIC); } for (i = 0; i < num_items; i++) { if (IsHeirOf(items[i], group)) { @@ -1771,9 +1770,9 @@ WidgetCmd(ClientData client_data, /* Information about the widget. */ goto done; } if (adjust) { - ITEM.GetTransform(grp, &t); + ITEM.GetItemTransform(grp, &t); ZnTransfoInvert(&t, &inv); - ITEM.GetTransform(item->parent, &t); + ITEM.GetItemTransform(item->parent, &t); ZnTransfoCompose(&t2, &t, &inv); this_one = &t2; if (item->transfo) { @@ -2439,12 +2438,12 @@ WidgetCmd(ClientData client_data, /* Information about the widget. */ inv = *((ZnTransfo *) Tcl_GetHashValue(e)); } else { - ITEM.GetTransform(to, &t); + ITEM.GetItemTransform(to, &t); ZnTransfoInvert(&t, &inv); } this_one = &inv; if (argc == 5) { - ITEM.GetTransform(from, &t); + ITEM.GetItemTransform(from, &t); ZnTransfoCompose(&t2, &t, &inv); this_one = &t2; } @@ -3287,6 +3286,7 @@ PickCurrentItem(WidgetInfo *wi, * event handler for <LeaveNotify> that deletes the current item. */ if ((item == wi->current_item) && !button_down) { + /*printf("Removing 'current' to %d\n", wi->current_item->id);*/ ITEM.RemoveTag(item, current_uid); } /* @@ -3313,6 +3313,10 @@ PickCurrentItem(WidgetInfo *wi, * LEFT_GRABBED_ITEM. */ if (wi->current_item != wi->new_item) { + if (wi->current_item != ZN_NO_ITEM) { + /*printf("***Removing 'current' to %d\n", wi->current_item->id);*/ + ITEM.RemoveTag(wi->current_item, current_uid); + } wi->current_item = wi->new_item; wi->new_item = ZN_NO_ITEM; } @@ -3325,6 +3329,7 @@ PickCurrentItem(WidgetInfo *wi, /* * Add the tag 'current' to the current item under the pointer. */ + /*printf("Adding 'current' to %d\n", wi->current_item->id);*/ DoItem((Tcl_Interp *) NULL, wi->current_item, ZN_NO_PART, current_uid); /* * Then emit a fake Enter event on it. @@ -3585,10 +3590,11 @@ Destroy(char *mem_ptr) /* Info about the widget. */ /* * Should be empty by now. */ - ZnListFree(wi->transfo_stack); - ZnListFree(wi->clip_stack); + ITEM_P.FreeTransformStack(wi); + ITEM_P.FreeClipStack(wi); ZnListFree(wi->work_pts); + ZnListFree(wi->work_xpts); ZnFree(wi); /*printf("Destroy ending\n");*/ |