seekablewidget: don't allow deleting if dragging

Fixes potential crash if a user does this
This commit is contained in:
itsmattkc
2022-05-11 13:44:59 -07:00
parent d6d26a9a07
commit 78d5314c0a
2 changed files with 14 additions and 10 deletions
+7 -5
View File
@@ -90,13 +90,15 @@ void SeekableWidget::ConnectTimelinePoints(TimelinePoints *points)
void SeekableWidget::DeleteSelected()
{
MultiUndoCommand* command = new MultiUndoCommand();
if (!selection_manager_.IsDragging()) {
MultiUndoCommand* command = new MultiUndoCommand();
foreach (TimelineMarker *marker, selection_manager_.GetSelectedObjects()) {
command->add_child(new MarkerRemoveCommand(marker));
foreach (TimelineMarker *marker, selection_manager_.GetSelectedObjects()) {
command->add_child(new MarkerRemoveCommand(marker));
}
Core::instance()->undo_stack()->pushIfHasChildren(command);
}
Core::instance()->undo_stack()->pushIfHasChildren(command);
}
bool SeekableWidget::CopySelected(bool cut)