From e43111922f7d091adb40cafde23ef797801eb50f Mon Sep 17 00:00:00 2001 From: Semphriss <66701383+Semphriss@users.noreply.github.com> Date: Sun, 10 Jan 2021 14:04:41 -0500 Subject: [PATCH] Fixed tile selection not rendering properly on tilemaps with an offset (#1636) Co-authored-by: Semphris --- src/editor/overlay_widget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/editor/overlay_widget.cpp b/src/editor/overlay_widget.cpp index bdf405630e7..dbe2f75c4f1 100644 --- a/src/editor/overlay_widget.cpp +++ b/src/editor/overlay_widget.cpp @@ -1170,7 +1170,7 @@ EditorOverlayWidget::align_to_tilemap(const Vector& sp, int tile_size) const return Vector(0, 0); } - Vector sp_ = sp - tilemap->get_offset(); + Vector sp_ = sp + tilemap->get_offset() / static_cast(tile_size); return (sp_ - (sp_ % 1.f)) * static_cast(tile_size); }