[nostalgia/core/studio] Revert new subsheet index increment to happen after index assignment
This commit is contained in:
parent
eae9972f85
commit
b52124a0c5
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user