Commit 1793e8a3 authored by Nicolas Carion's avatar Nicolas Carion

[Timeline2] Check if move is possible before changing track

parent aec2d041
......@@ -113,7 +113,7 @@ Column{
// Prevent dragging left of multitracks origin.
console.log("dragging clip x: ", clip.x, " ID: "<<clip.originalClipIndex)
clip.x = Math.max(0, clip.x)
if (!timeline.allowMoveClip(toTrack, cIndex, frame, false)) {
if (!timeline.allowMoveClip(toTrack, cIndex, frame)) {
// Abort move
clip.x = clip.draggedX
}
......
......@@ -374,11 +374,14 @@ Rectangle {
}
onClipDraggedToTrack: {
var i = clip.trackIndex + direction
var frame = Math.round(clip.x / timeScale)
if (i >= 0 && i < tracksRepeater.count) {
var track = tracksRepeater.itemAt(i)
clip.reparent(track)
clip.trackIndex = track.DelegateModel.itemsIndex
clip.trackId = track.trackId
if (timeline.allowMoveClip(track.trackId, clip.clipId, frame)) {
clip.reparent(track)
clip.trackIndex = track.DelegateModel.itemsIndex
clip.trackId = track.trackId
}
}
}
onCheckSnap: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment