[nostalgia/core/studio] Fix tile insert to correct input when inserting past the last tile
All checks were successful
Build / build (push) Successful in 3m11s
All checks were successful
Build / build (push) Successful in 3m11s
This commit is contained in:
parent
eb4cd7106d
commit
c44d8678cb
@ -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 {
|
void TileSheetEditorView::insertTile(ox::Vec2 const&paneSize, ox::Vec2 const&clickPos) noexcept {
|
||||||
auto pt = clickPoint(paneSize, clickPos);
|
auto pt = clickPoint(paneSize, clickPos);
|
||||||
auto const&s = m_model.activeSubSheet();
|
auto const&s = m_model.activeSubSheet();
|
||||||
pt.x = ox::min(pt.x, s.columns * TileWidth);
|
pt.x = ox::min(pt.x, s.columns * TileWidth - 1);
|
||||||
pt.y = ox::min(pt.y, s.rows * TileHeight);
|
pt.y = ox::min(pt.y, s.rows * TileHeight - 1);
|
||||||
auto const tileIdx = ptToIdx(pt, s.columns) / PixelsPerTile;
|
auto const tileIdx = ptToIdx(pt, s.columns) / PixelsPerTile;
|
||||||
m_model.insertTiles(m_model.activeSubSheetIdx(), tileIdx, 1);
|
m_model.insertTiles(m_model.activeSubSheetIdx(), tileIdx, 1);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user