From 7436c1e213be68675b6e9b05618e8718d0e56c66 Mon Sep 17 00:00:00 2001 From: itsmattkc <34096995+itsmattkc@users.noreply.github.com> Date: Mon, 24 Jan 2022 12:19:55 -0800 Subject: [PATCH] timeline: perform transition removal before calculating clips --- app/widget/timelinewidget/timelinewidget.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/app/widget/timelinewidget/timelinewidget.cpp b/app/widget/timelinewidget/timelinewidget.cpp index 23a182cde..d827af5d5 100644 --- a/app/widget/timelinewidget/timelinewidget.cpp +++ b/app/widget/timelinewidget/timelinewidget.cpp @@ -495,8 +495,6 @@ void TimelineWidget::DeleteSelected(bool ripple) return; } - MultiUndoCommand* command = new MultiUndoCommand(); - QVector clips_to_delete; QVector transitions_to_delete; @@ -508,9 +506,16 @@ void TimelineWidget::DeleteSelected(bool ripple) } } + MultiUndoCommand* command = new MultiUndoCommand(); + // For transitions, remove them but extend their attached blocks to fill their place foreach (TransitionBlock* transition, transitions_to_delete) { - command->add_child(new TransitionRemoveCommand(transition, true)); + TransitionRemoveCommand *trc = new TransitionRemoveCommand(transition, true); + + // Perform the transition removal now so that replacing blocks with gaps below won't get confused + trc->redo_now(); + + command->add_child(trc); } // Replace clips with gaps (effectively deleting them)