diff options
author | Michael Alexsander Silva Dias <michaelalexsander@protonmail.com> | 2018-12-31 13:36:51 -0200 |
---|---|---|
committer | Michael Alexsander Silva Dias <michaelalexsander@protonmail.com> | 2018-12-31 13:36:51 -0200 |
commit | 07fdd2c702233571aa49adf648c136f72f843a91 (patch) | |
tree | a72b9b6819a7ea0ebe51c063dc98eb1c501740e0 | |
parent | 89560c2138d00c6b64f09dda97a18cb84ab76aff (diff) |
Fix incorrect grid snapping in TileSet editor with separation
-rw-r--r-- | editor/plugins/tile_set_editor_plugin.cpp | 4 |
1 files 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); |