[nostalgia/core/studio] Fix TileSheet Editor paste bounds checking
This commit is contained in:
@@ -71,8 +71,10 @@ void TileSheetEditorModel::paste() {
|
||||
oxErrf("Could not read clipboard: {}", toStr(err));
|
||||
return;
|
||||
}
|
||||
const auto pt = m_selectionOrigin == geo::Point(-1, -1) ? geo::Point(0, 0) : m_selectionOrigin;
|
||||
pushCommand(new PasteCommand(&m_img, m_activeSubsSheetIdx, pt, cb));
|
||||
const auto s = activeSubSheet();
|
||||
const auto pt1 = m_selectionOrigin == geo::Point(-1, -1) ? geo::Point(0, 0) : m_selectionOrigin;
|
||||
const auto pt2 = geo::Point(s->columns * TileWidth, s->rows * TileHeight);
|
||||
pushCommand(new PasteCommand(&m_img, m_activeSubsSheetIdx, pt1, pt2, cb));
|
||||
}
|
||||
|
||||
void TileSheetEditorModel::drawCommand(const geo::Point &pt, std::size_t palIdx) noexcept {
|
||||
|
||||
Reference in New Issue
Block a user