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