From 041e571626340e782f5642c7c49df101dc9099cd Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Sun, 27 Mar 2022 02:35:35 -0500 Subject: [PATCH] [nostalgia/core/studio] Fix select not to go beyond the appropriate idx --- src/nostalgia/core/studio/tilesheeteditormodel.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/nostalgia/core/studio/tilesheeteditormodel.cpp b/src/nostalgia/core/studio/tilesheeteditormodel.cpp index cf4e31a0..11afdc84 100644 --- a/src/nostalgia/core/studio/tilesheeteditormodel.cpp +++ b/src/nostalgia/core/studio/tilesheeteditormodel.cpp @@ -490,6 +490,11 @@ void TileSheetEditorModel::select(const geo::Point &pt) noexcept { void TileSheetEditorModel::completeSelection() noexcept { 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 {