From 7e7bcaebe4aa83d5eab35f5bd5ba656aa9b52d0e Mon Sep 17 00:00:00 2001 From: manongjohn Date: Wed, 6 Apr 2022 13:53:53 -0400 Subject: [PATCH] Fix selection after Increase Step, undo and redo --- toonz/sources/toonz/cellselectioncommand.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/toonz/sources/toonz/cellselectioncommand.cpp b/toonz/sources/toonz/cellselectioncommand.cpp index 8bfcbc1d..35332c25 100644 --- a/toonz/sources/toonz/cellselectioncommand.cpp +++ b/toonz/sources/toonz/cellselectioncommand.cpp @@ -1025,6 +1025,10 @@ void IncreaseStepUndo::redo() const { TApp::instance()->getCurrentXsheet()->notifyXsheetChanged(); TApp::instance()->getCurrentScene()->setDirtyFlag(true); + + TCellSelection *cellSelection = dynamic_cast( + TApp::instance()->getCurrentSelection()->getSelection()); + if (cellSelection) cellSelection->selectCells(m_r0, m_c0, m_newR1, m_c1); } //----------------------------------------------------------------------------- @@ -1043,6 +1047,11 @@ void IncreaseStepUndo::undo() const { app->getCurrentXsheet()->notifyXsheetChanged(); TApp::instance()->getCurrentScene()->setDirtyFlag(true); + + TCellSelection *cellSelection = dynamic_cast( + TApp::instance()->getCurrentSelection()->getSelection()); + if (cellSelection) + cellSelection->selectCells(m_r0, m_c0, (m_r0 + (m_rowsCount - 1)), m_c1); } } // namespace @@ -1069,11 +1078,6 @@ void TCellSelection::increaseStepCells() { TUndoManager::manager()->add(undo); undo->redo(); - - if (undo->m_newR1 != m_range.m_r1) { - m_range.m_r1 = undo->m_newR1; - TApp::instance()->getCurrentSelection()->notifySelectionChanged(); - } } //*********************************************************************************