diff --git a/app/widget/timelinewidget/timelinewidget.cpp b/app/widget/timelinewidget/timelinewidget.cpp index 49b02f6f50..574bed300f 100644 --- a/app/widget/timelinewidget/timelinewidget.cpp +++ b/app/widget/timelinewidget/timelinewidget.cpp @@ -1700,6 +1700,7 @@ void TimelineWidget::SetSelections(const TimelineWidgetSelections &s, bool proce } } + // NOTE: This loop could do with some optimization for (auto it=s.cbegin(); it!=s.cend(); it++) { Track *track = GetTrackFromReference(it.key()); if (track) { diff --git a/app/widget/timelinewidget/timelinewidget.h b/app/widget/timelinewidget/timelinewidget.h index 418ec41fdc..b942fcb445 100644 --- a/app/widget/timelinewidget/timelinewidget.h +++ b/app/widget/timelinewidget/timelinewidget.h @@ -295,8 +295,6 @@ class TimelineWidget : public TimeBasedWidget, public NodeCopyPasteService, publ QVector GetBlocksInGlobalRect(const QPoint &p1, const QPoint &p2); - QVector GetBlocksInSelection(const TimelineWidgetSelections &sel); - QPoint drag_origin_; QRubberBand rubberband_; diff --git a/app/widget/timelinewidget/tool/pointer.cpp b/app/widget/timelinewidget/tool/pointer.cpp index 1ea1ba7032..171bdbee91 100644 --- a/app/widget/timelinewidget/tool/pointer.cpp +++ b/app/widget/timelinewidget/tool/pointer.cpp @@ -572,7 +572,7 @@ void PointerTool::FinishDrag(TimelineViewMouseEvent *event) } else { new_sel.TrimOut(reference_ghost->GetOutAdjustment()); } - command->add_child(new TimelineWidget::SetSelectionsCommand(parent(), new_sel, parent()->GetSelections(), false)); + command->add_child(new TimelineWidget::SetSelectionsCommand(parent(), new_sel, parent()->GetSelections(), true)); } } @@ -621,7 +621,7 @@ void PointerTool::FinishDrag(TimelineViewMouseEvent *event) TimelineWidgetSelections new_sel = parent()->GetSelections(); new_sel.ShiftTime(blocks_moving.first().ghost->GetInAdjustment()); new_sel.ShiftTracks(drag_track_type_, blocks_moving.first().ghost->GetTrackAdjustment()); - command->add_child(new TimelineWidget::SetSelectionsCommand(parent(), new_sel, parent()->GetSelections(), false)); + command->add_child(new TimelineWidget::SetSelectionsCommand(parent(), new_sel, parent()->GetSelections(), true)); } if (!blocks_sliding.isEmpty()) { @@ -682,7 +682,7 @@ void PointerTool::FinishDrag(TimelineViewMouseEvent *event) // Adjust selections TimelineWidgetSelections new_sel = parent()->GetSelections(); new_sel.ShiftTime(movement); - command->add_child(new TimelineWidget::SetSelectionsCommand(parent(), new_sel, parent()->GetSelections(), false)); + command->add_child(new TimelineWidget::SetSelectionsCommand(parent(), new_sel, parent()->GetSelections(), true)); } }