Skip to content

Commit

Permalink
make the clicked tile the top left of the selection that's replacing it
Browse files Browse the repository at this point in the history
  • Loading branch information
Narre committed Jul 15, 2023
1 parent 8e9e205 commit f83b2a3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/editor/overlay_widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,8 @@ EditorOverlayWidget::replace()
{
if (tilemap->get_tile_id(x, y) == replace_tile)
{
tilemap->change(x, y, m_editor.get_tiles()->pos(x % m_editor.get_tiles()->m_width, y % m_editor.get_tiles()->m_height));
tilemap->change(x, y, m_editor.get_tiles()->pos((x + static_cast<int>(m_hovered_tile.x)) % m_editor.get_tiles()->m_width,
(y + static_cast<int>(m_hovered_tile.y)) % m_editor.get_tiles()->m_height));
}
}
}
Expand Down

0 comments on commit f83b2a3

Please sign in to comment.