Commit 1f157460 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Fix crash dragging clip in insert mode.

Bug: 409577
parent 7eceb7e5
Pipeline #6516 failed with stage
in 2 minutes and 37 seconds
......@@ -339,7 +339,7 @@ bool TimelineFunctions::insertZone(const std::shared_ptr<TimelineItemModel> &tim
auto it = timeline->m_allTracks.cbegin();
while (it != timeline->m_allTracks.cend()) {
int target_track = (*it)->getId();
if (timeline->getTrackById_const(target_track)->shouldReceiveTimelineOp()) {
if (!useTargets || timeline->getTrackById_const(target_track)->shouldReceiveTimelineOp()) {
affectedTracks << target_track;
} else if (trackIds.contains(target_track)) {
// Track is marked as target but not active, remove it
......
......@@ -402,8 +402,12 @@ Rectangle {
} else {
// we want insert/overwrite mode, make a fake insert at end of timeline, then move to position
clipBeingDroppedId = insertAndMaybeGroup(timeline.activeTrack, timeline.fullDuration, clipBeingDroppedData)
fakeFrame = controller.suggestClipMove(clipBeingDroppedId, timeline.activeTrack, frame, timeline.position, Math.floor(root.snapping))
fakeTrack = timeline.activeTrack
if (clipBeingDroppedId > -1) {
fakeFrame = controller.suggestClipMove(clipBeingDroppedId, timeline.activeTrack, frame, timeline.position, Math.floor(root.snapping))
fakeTrack = timeline.activeTrack
} else {
drag.accepted = false
}
}
continuousScrolling(drag.x + scrollView.flickableItem.contentX)
} else {
......
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