summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-05-03 15:52:26 +0200
committerGitHub <noreply@github.com>2021-05-03 15:52:26 +0200
commit883296382d2d03de6add0868b09577c21a344306 (patch)
treed5c9d9de943fef4486f5a0bcad5ceecbafe12281 /editor
parentf9b9992c255434653cc9b2754ed81513a898c5b2 (diff)
parenta1b903066e7b216176e3f0d646fc36c1720b5792 (diff)
Merge pull request #48400 from kleonc/tilemap_bucket_fill_fix
TileMapEditor::_bucket_fill Check autotile coordinates only if autotile is selected
Diffstat (limited to 'editor')
-rw-r--r--editor/plugins/tile_map_editor_plugin.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/editor/plugins/tile_map_editor_plugin.cpp b/editor/plugins/tile_map_editor_plugin.cpp
index bd721244ea..bbc1666171 100644
--- a/editor/plugins/tile_map_editor_plugin.cpp
+++ b/editor/plugins/tile_map_editor_plugin.cpp
@@ -658,11 +658,15 @@ Vector<Vector2> TileMapEditor::_bucket_fill(const Point2i &p_start, bool erase,
}
// Check if the tile variation is the same
- Vector2 prev_position = node->get_cell_autotile_coord(p_start.x, p_start.y);
if (ids.size() == 1 && ids[0] == prev_id) {
int current = manual_palette->get_current();
- Vector2 position = manual_palette->get_item_metadata(current);
- if (prev_position == position) {
+ if (current == -1) {
+ // Same ID, no variation selected, nothing to change
+ return Vector<Vector2>();
+ }
+ Vector2 prev_autotile_coord = node->get_cell_autotile_coord(p_start.x, p_start.y);
+ Vector2 autotile_coord = manual_palette->get_item_metadata(current);
+ if (autotile_coord == prev_autotile_coord) {
// Same ID and variation, nothing to change
return Vector<Vector2>();
}