aboutsummaryrefslogtreecommitdiff
path: root/generic
diff options
context:
space:
mode:
authorlecoanet2005-10-05 14:28:05 +0000
committerlecoanet2005-10-05 14:28:05 +0000
commit158bd87185d2d961fb3f21bcaf1f56689e41033c (patch)
tree40cdfe948081751506bc63e82a85cacc8b38131b /generic
parent254a8be91aa06f2bf8e14de3389f5326083d2669 (diff)
downloadtkzinc-158bd87185d2d961fb3f21bcaf1f56689e41033c.zip
tkzinc-158bd87185d2d961fb3f21bcaf1f56689e41033c.tar.gz
tkzinc-158bd87185d2d961fb3f21bcaf1f56689e41033c.tar.bz2
tkzinc-158bd87185d2d961fb3f21bcaf1f56689e41033c.tar.xz
Found at more general way to fix Bug 41. Try to insert the item
a bit more cleverly in the dependant list.
Diffstat (limited to 'generic')
-rw-r--r--generic/Group.c30
1 files changed, 22 insertions, 8 deletions
diff --git a/generic/Group.c b/generic/Group.c
index 9346f31..ce581a8 100644
--- a/generic/Group.c
+++ b/generic/Group.c
@@ -738,13 +738,12 @@ ComputeCoordinates(ZnItem item,
current_item = current_item->next) {
/*
* Skip the clip item, it has been already updated.
- * Do not skip as well items with a dependency, it is
- * useful to update them early (connection between tracks
- * or wp) they will be updated again later.
+ * Skip as well items with a dependency, they will
+ * be updated later.
*/
//printf("Trying to update: %d\n", current_item->id);
- if ((current_item == group->clip) /*||
- (current_item->connected_item != ZN_NO_ITEM)*/) {
+ if ((current_item == group->clip) ||
+ (current_item->connected_item != ZN_NO_ITEM)) {
continue;
}
if (force ||
@@ -1509,9 +1508,11 @@ ZnGroupRemoveClip(ZnItem group,
**********************************************************************************
*/
void
-ZnInsertDependentItem(ZnItem item)
+ZnInsertDependentItem(ZnItem item)
{
- GroupItem group = (GroupItem) item->parent;
+ GroupItem group = (GroupItem) item->parent;
+ ZnItem *dep_list;
+ unsigned int i, num_deps;
if (!group) {
return;
@@ -1519,7 +1520,20 @@ ZnInsertDependentItem(ZnItem item)
if (!group->dependents) {
group->dependents = ZnListNew(2, sizeof(ZnItem));
}
- ZnListAdd(group->dependents, &item, ZnListTail);
+ dep_list = (ZnItem *) ZnListArray(group->dependents);
+ num_deps = ZnListSize(group->dependents);
+ //
+ // Insert the farther possible but not past an item
+ // dependent on this item.
+ for (i = 0; i < num_deps; i++) {
+ if (dep_list[i]->connected_item == item) {
+ //printf("item %d depends on %d inserting before\n",
+ // dep_list[i]->id, item->id);
+ break;
+ }
+ }
+ //printf("adding %d at position %d\n", item->id, i);
+ ZnListAdd(group->dependents, &item, i);
}