From f83b2a31556ada35f386cdd1816e14566798b510 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Pale=C4=8Dek?= Date: Sun, 16 Jul 2023 01:03:28 +0200 Subject: [PATCH] make the clicked tile the top left of the selection that's replacing it --- src/editor/overlay_widget.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/editor/overlay_widget.cpp b/src/editor/overlay_widget.cpp index 31f790febf8..6079afe2299 100644 --- a/src/editor/overlay_widget.cpp +++ b/src/editor/overlay_widget.cpp @@ -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(m_hovered_tile.x)) % m_editor.get_tiles()->m_width, + (y + static_cast(m_hovered_tile.y)) % m_editor.get_tiles()->m_height)); } } }