summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-01-01 19:04:04 +0100
committerGitHub <noreply@github.com>2019-01-01 19:04:04 +0100
commitf1d1ecb383d79e0fb494977b072209aa5f998c08 (patch)
tree8502c8a0a5425d2d7c396e5e83ba93d84cebdce5
parentc7c87a06244af46271e38738260f922b5fb82559 (diff)
parent07fdd2c702233571aa49adf648c136f72f843a91 (diff)
Merge pull request #24686 from YeldhamDev/autotile_grid_separation_fix
Fix incorrect grid snapping in TileSet editor with separation
-rw-r--r--editor/plugins/tile_set_editor_plugin.cpp4
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 d69e0c157f..1a687a4009 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);