[nostalgia/core/studio] Fix select not to go beyond the appropriate idx

This commit is contained in:
Gary Talent 2022-03-27 02:35:35 -05:00
parent a02d496de5
commit 041e571626

View File

@ -490,6 +490,11 @@ void TileSheetEditorModel::select(const geo::Point &pt) noexcept {
void TileSheetEditorModel::completeSelection() noexcept { void TileSheetEditorModel::completeSelection() noexcept {
m_selectionOngoing = false; m_selectionOngoing = false;
auto s = activeSubSheet();
auto pt = m_selectionBounds.pt2();
pt.x = ox::min(s->columns * TileWidth, pt.x);
pt.y = ox::min(s->rows * TileHeight, pt.y);
m_selectionBounds.setPt2(pt);
} }
void TileSheetEditorModel::clearSelection() noexcept { void TileSheetEditorModel::clearSelection() noexcept {