[vlmc-devel] Timeline: Fix not moving all the clips supposed to be moved

Yikai Lu git at videolan.org
Sat Jul 1 14:55:07 CEST 2017


vlmc | branch: master | Yikai Lu <luyikei.qmltu at gmail.com> | Sat Jul  1 21:53:16 2017 +0900| [442f22b306c9f0bf2c0b11b7fa1a9da4fbd20cf4] | committer: Yikai Lu

Timeline: Fix not moving all the clips supposed to be moved

> https://code.videolan.org/videolan/vlmc/commit/442f22b306c9f0bf2c0b11b7fa1a9da4fbd20cf4
---

 src/Gui/timeline/main.qml | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/Gui/timeline/main.qml b/src/Gui/timeline/main.qml
index 77ad6b70..8c7dd1e7 100644
--- a/src/Gui/timeline/main.qml
+++ b/src/Gui/timeline/main.qml
@@ -323,10 +323,14 @@ Rectangle {
 
     function dragFinished() {
         sortSelectedClips();
+
+        // We don't want to rely on selectedClips while moving since it "will" be changed
+        // I'm aware that it's not the best solution but it's the safest solution for sure
+        var toMove = [];
         for ( var i = 0; i < selectedClips.length; ++i )
-        {
-            moveClipTo( selectedClips[i].uuid, selectedClips[i].newTrackId, selectedClips[i].position );
-        }
+            toMove.push( [selectedClips[i].uuid, selectedClips[i].newTrackId, selectedClips[i].position] );
+        for ( i = 0; i < toMove.length; ++i )
+            moveClipTo( toMove[i][0], toMove[i][1], toMove[i][2] );
 
         adjustTracks( "Audio" );
         adjustTracks( "Video" );



More information about the Vlmc-devel mailing list