From f34704d845da749e8ed32040dab5517d9d6a19f1 Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Fri, 31 May 2024 23:59:15 -0500 Subject: [PATCH] [nostalgia/core/studio] Fix AddSubsheetCommand::undo to undo ID idx change --- .../src/studio/tilesheeteditor/commands/addsubsheetcommand.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/nostalgia/modules/core/src/studio/tilesheeteditor/commands/addsubsheetcommand.cpp b/src/nostalgia/modules/core/src/studio/tilesheeteditor/commands/addsubsheetcommand.cpp index a822cc73..8aa99f17 100644 --- a/src/nostalgia/modules/core/src/studio/tilesheeteditor/commands/addsubsheetcommand.cpp +++ b/src/nostalgia/modules/core/src/studio/tilesheeteditor/commands/addsubsheetcommand.cpp @@ -46,9 +46,11 @@ ox::Error AddSubSheetCommand::undo() noexcept { parent.columns = s.columns; parent.pixels = std::move(s.pixels); parent.subsheets.clear(); + --m_img.idIt; } else { for (auto idx = m_addedSheets.rbegin(); idx != m_addedSheets.rend(); ++idx) { oxReturnError(rmSubSheet(m_img, *idx)); + --m_img.idIt; } } return {};