summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThibault Saunier <thibault.saunier@collabora.com>2013-07-09 21:30:59 -0400
committerThibault Saunier <thibault.saunier@collabora.com>2013-07-09 21:30:59 -0400
commitb0202ed22b2126884299ed2ff3633c64524e1036 (patch)
treec1c218ee70cc8f16cdb5c6c438ca35ccf8fb889c
parenta933d9540d4677c055d6b1e9a9fe6e9821d59478 (diff)
timeline: Append missing layers when moving groups between layers
This was a missing feature of the newly added groups
-rw-r--r--ges/ges-timeline.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/ges/ges-timeline.c b/ges/ges-timeline.c
index d10bdb0..f89acd5 100644
--- a/ges/ges-timeline.c
+++ b/ges/ges-timeline.c
@@ -1760,6 +1760,17 @@ timeline_context_to_layer (GESTimeline * timeline, gint offset)
ret &= ges_clip_move_to_layer (GES_CLIP (key), new_layer);
} else if (GES_IS_GROUP (value)) {
+ guint32 last_prio = _PRIORITY (value) + offset +
+ GES_CONTAINER_HEIGHT (value) - 1;
+
+ new_layer = GES_LAYER (g_list_nth_data (timeline->layers, last_prio));
+
+ if (new_layer == NULL) {
+ do {
+ new_layer = ges_timeline_append_layer (timeline);
+ } while (ges_layer_get_priority (new_layer) < last_prio);
+ }
+
_set_priority0 (GES_TIMELINE_ELEMENT (value),
_PRIORITY (value) + offset);
}