From cefca25796c85cf41dad7e7e13b1f534fa5553c1 Mon Sep 17 00:00:00 2001 From: Eric Tuvesson Date: Wed, 21 Oct 2020 23:56:44 +0200 Subject: [PATCH] fix(editor): TileMap floodfill with same tile ID and different variation Closes https://github.com/godotengine/godot/issues/40435 --- editor/plugins/tile_map_editor_plugin.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/editor/plugins/tile_map_editor_plugin.cpp b/editor/plugins/tile_map_editor_plugin.cpp index 92611137067..2c22d18c072 100644 --- a/editor/plugins/tile_map_editor_plugin.cpp +++ b/editor/plugins/tile_map_editor_plugin.cpp @@ -649,9 +649,15 @@ Vector TileMapEditor::_bucket_fill(const Point2i &p_start, bool erase, return Vector(); } + // 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(); + 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(); + } } Rect2i r = node->get_used_rect();