From 087c834b252820a5574cae1516ca6510d0ba2d71 Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Tue, 26 Dec 2023 16:34:40 -0600 Subject: [PATCH] [nostalgia/core/studio] Fix Add SubSheet to increment idIt before using it --- .../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 8a31bfb1..6aed9dc0 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); } }