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); }