From b52124a0c5e27212ea1b4b043749b9039d47be28 Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Tue, 26 Dec 2023 20:14:16 -0600 Subject: [PATCH] [nostalgia/core/studio] Revert new subsheet index increment to happen after index assignment --- .../studio/tilesheeteditor/commands/addsubsheetcommand.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 6aed9dc0..8a31bfb1 100644 --- a/src/nostalgia/modules/core/src/studio/tilesheeteditor/commands/addsubsheetcommand.cpp +++ b/src/nostalgia/modules/core/src/studio/tilesheeteditor/commands/addsubsheetcommand.cpp @@ -28,12 +28,12 @@ void AddSubSheetCommand::redo() noexcept { auto &parent = m_img.getSubSheet(m_parentIdx); if (m_addedSheets.size() < 2) { auto i = parent.subsheets.size(); - parent.subsheets.emplace_back(++m_img.idIt, ox::sfmt("Subsheet {}", i), 1, 1, m_img.bpp); + parent.subsheets.emplace_back(m_img.idIt++, ox::sfmt("Subsheet {}", i), 1, 1, m_img.bpp); } else { - parent.subsheets.emplace_back(++m_img.idIt, "Subsheet 0", parent.columns, parent.rows, std::move(parent.pixels)); + parent.subsheets.emplace_back(m_img.idIt++, "Subsheet 0", parent.columns, parent.rows, std::move(parent.pixels)); parent.rows = 0; parent.columns = 0; - parent.subsheets.emplace_back(++m_img.idIt, "Subsheet 1", 1, 1, m_img.bpp); + parent.subsheets.emplace_back(m_img.idIt++, "Subsheet 1", 1, 1, m_img.bpp); } }