diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-11-02 17:05:43 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-02 17:05:43 +0100 |
commit | be14d9d6448a9017c982fd7e30631525aed8f339 (patch) | |
tree | 5e2995ccc565866ab08b1bd38e2efdcaa51aa82f /editor/plugins/tile_map_editor_plugin.cpp | |
parent | e8794b24bd8523ba28e4bb951764a5a91dad9fe7 (diff) | |
parent | cefca25796c85cf41dad7e7e13b1f534fa5553c1 (diff) |
Merge pull request #42979 from Mallos/fix/tilemap-floodfill
fix(editor): TileMap floodfill with same tile ID and different variation
Diffstat (limited to 'editor/plugins/tile_map_editor_plugin.cpp')
-rw-r--r-- | editor/plugins/tile_map_editor_plugin.cpp | 10 |
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 e43b8c4b7f..7b516175b2 100644 --- a/editor/plugins/tile_map_editor_plugin.cpp +++ b/editor/plugins/tile_map_editor_plugin.cpp @@ -651,9 +651,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(); |