mirror of
https://github.com/godotengine/godot
synced 2024-09-05 05:38:35 +00:00
Merge pull request #24686 from YeldhamDev/autotile_grid_separation_fix
Fix incorrect grid snapping in TileSet editor with separation
This commit is contained in:
commit
f1d1ecb383
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue