From 07fdd2c702233571aa49adf648c136f72f843a91 Mon Sep 17 00:00:00 2001 From: Michael Alexsander Silva Dias Date: Mon, 31 Dec 2018 13:36:51 -0200 Subject: Fix incorrect grid snapping in TileSet editor with separation --- editor/plugins/tile_set_editor_plugin.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/editor/plugins/tile_set_editor_plugin.cpp b/editor/plugins/tile_set_editor_plugin.cpp index 297cf6754c..4a37acbd4b 100644 --- a/editor/plugins/tile_set_editor_plugin.cpp +++ b/editor/plugins/tile_set_editor_plugin.cpp @@ -2487,14 +2487,14 @@ void TileSetEditor::update_edited_region(const Vector2 &end_point) { grid_coord *= (snap_step + snap_separation); grid_coord += snap_offset; edited_region.expand_to(grid_coord); - grid_coord += snap_step + snap_separation; + grid_coord += snap_step; edited_region.expand_to(grid_coord); grid_coord = ((end_point - snap_offset) / (snap_step + snap_separation)).floor(); grid_coord *= (snap_step + snap_separation); grid_coord += snap_offset; edited_region.expand_to(grid_coord); - grid_coord += snap_step + snap_separation; + grid_coord += snap_step; edited_region.expand_to(grid_coord); } else { edited_region.expand_to(end_point); -- cgit v1.2.3