From 1747e55567c8f6533a9c7a56e8d597466a7533a6 Mon Sep 17 00:00:00 2001 From: shun-iwasawa Date: Feb 08 2021 08:05:17 +0000 Subject: fix deleting fx link --- diff --git a/toonz/sources/toonz/tpanels.cpp b/toonz/sources/toonz/tpanels.cpp index a743d82..48c427c 100644 --- a/toonz/sources/toonz/tpanels.cpp +++ b/toonz/sources/toonz/tpanels.cpp @@ -225,6 +225,7 @@ int SchematicScenePanel::getViewType() { //----------------------------------------------------------------------------- void SchematicScenePanel::onDeleteFxs(const FxSelection *selection) { + if (selection->isEmpty()) return; std::set colIndices; std::set fxs; for (auto index : selection->getColumnIndexes()) colIndices.insert(index); diff --git a/toonz/sources/toonzlib/fxcommand.cpp b/toonz/sources/toonzlib/fxcommand.cpp index 2825851..9c16a6b 100644 --- a/toonz/sources/toonzlib/fxcommand.cpp +++ b/toonz/sources/toonzlib/fxcommand.cpp @@ -2051,6 +2051,7 @@ static void deleteLinks(const std::list &links, TXsheetHandle *xshHandle) { std::unique_ptr undo(new DeleteLinksUndo(links, xshHandle)); if (undo->isConsistent()) { + undo->m_isLastInRedoBlock = false; undo->redo(); TUndoManager::manager()->add(undo.release()); } @@ -2337,9 +2338,6 @@ static void deleteFxs(const std::list &fxs, TXsheetHandle *xshHandle, } undoManager->endBlock(); - - // emit xsheetChanged once here - xshHandle->notifyXsheetChanged(); } //********************************************************************** @@ -2393,9 +2391,6 @@ static void deleteColumns(const std::list &columns, } undoManager->endBlock(); - - // emit xsheetChanged once here - xshHandle->notifyXsheetChanged(); } //********************************************************************** @@ -2408,8 +2403,7 @@ void TFxCommand::deleteSelection(const std::list &fxs, TXsheetHandle *xshHandle, TFxHandle *fxHandle) { // Prepare selected fxs - column fxs would be done twice if the corresponding - // columns have - // been supplied for deletion too + // columns have been supplied for deletion too ::FilterColumnFxs filterColumnFxs; std::list filteredFxs(fxs); @@ -2425,6 +2419,8 @@ void TFxCommand::deleteSelection(const std::list &fxs, if (!links.empty()) deleteLinks(links, xshHandle); TUndoManager::manager()->endBlock(); + // emit xsheetChanged once here + xshHandle->notifyXsheetChanged(); } //**********************************************************************