[nostalgia/core/studio] Fix DrawCommand not to allow appending of duplicates

This commit is contained in:
2022-02-13 23:46:45 -06:00
parent 95f3c5b62a
commit 0e041a666a
2 changed files with 10 additions and 4 deletions
@@ -19,7 +19,6 @@ void TileSheetEditorModel::draw(const geo::Point &pt, std::size_t palIdx) noexce
m_updated = m_ongoingDrawCommand->append(ptToIdx(pt, m_img.columns));
} else {
pushCommand(new DrawCommand(&m_img, ptToIdx(pt, m_img.columns), palIdx));
m_updated = true;
}
}
@@ -70,6 +69,7 @@ void TileSheetEditorModel::getFillPixels(bool *pixels, const geo::Point &pt, int
void TileSheetEditorModel::pushCommand(studio::UndoCommand *cmd) noexcept {
m_undoStack.push(cmd);
m_ongoingDrawCommand = dynamic_cast<DrawCommand*>(cmd);
m_updated = true;
}
}