summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Tuvesson <eric.tuvesson@gmail.com>2020-10-21 23:56:44 +0200
committerEric Tuvesson <eric.tuvesson@gmail.com>2020-10-21 23:56:44 +0200
commitcefca25796c85cf41dad7e7e13b1f534fa5553c1 (patch)
tree74fc9a0c569a3e1ec435b3c1c63b00ff56f4e149
parenta4548a079bc975411269abe2ba917ee825e90d23 (diff)
fix(editor): TileMap floodfill with same tile ID and different variation
Closes https://github.com/godotengine/godot/issues/40435
-rw-r--r--editor/plugins/tile_map_editor_plugin.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/editor/plugins/tile_map_editor_plugin.cpp b/editor/plugins/tile_map_editor_plugin.cpp
index 9261113706..2c22d18c07 100644
--- a/editor/plugins/tile_map_editor_plugin.cpp
+++ b/editor/plugins/tile_map_editor_plugin.cpp
@@ -649,9 +649,15 @@ Vector<Vector2> TileMapEditor::_bucket_fill(const Point2i &p_start, bool erase,
return Vector<Vector2>();
}
+ // 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) {
- // Same ID, nothing to change
- return Vector<Vector2>();
+ int current = manual_palette->get_current();
+ Vector2 position = manual_palette->get_item_metadata(current);
+ if (prev_position == position) {
+ // Same ID and variation, nothing to change
+ return Vector<Vector2>();
+ }
}
Rect2i r = node->get_used_rect();