From c44d8678cb60916ddab68fcc263c69d06c89ba5a Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Sat, 11 Jan 2025 15:38:11 -0600 Subject: [PATCH] [nostalgia/core/studio] Fix tile insert to correct input when inserting past the last tile --- .../core/src/studio/tilesheeteditor/tilesheeteditorview.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nostalgia/modules/core/src/studio/tilesheeteditor/tilesheeteditorview.cpp b/src/nostalgia/modules/core/src/studio/tilesheeteditor/tilesheeteditorview.cpp index 2181d864..0ac18ae8 100644 --- a/src/nostalgia/modules/core/src/studio/tilesheeteditor/tilesheeteditorview.cpp +++ b/src/nostalgia/modules/core/src/studio/tilesheeteditor/tilesheeteditorview.cpp @@ -58,8 +58,8 @@ void TileSheetEditorView::scrollH(ox::Vec2 const&paneSz, float wheelh) noexcept void TileSheetEditorView::insertTile(ox::Vec2 const&paneSize, ox::Vec2 const&clickPos) noexcept { auto pt = clickPoint(paneSize, clickPos); auto const&s = m_model.activeSubSheet(); - pt.x = ox::min(pt.x, s.columns * TileWidth); - pt.y = ox::min(pt.y, s.rows * TileHeight); + pt.x = ox::min(pt.x, s.columns * TileWidth - 1); + pt.y = ox::min(pt.y, s.rows * TileHeight - 1); auto const tileIdx = ptToIdx(pt, s.columns) / PixelsPerTile; m_model.insertTiles(m_model.activeSubSheetIdx(), tileIdx, 1); }