mirror of
https://github.com/godotengine/godot.git
synced 2025-11-10 02:21:15 +00:00
fix(editor): TileMap floodfill with same tile ID and different variation
Closes https://github.com/godotengine/godot/issues/40435
(cherry picked from commit cefca25796)
This commit is contained in:
parent
7db872b55a
commit
be72285c70
1 changed files with 8 additions and 2 deletions
|
|
@ -661,9 +661,15 @@ PoolVector<Vector2> TileMapEditor::_bucket_fill(const Point2i &p_start, bool era
|
|||
return PoolVector<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 PoolVector<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 PoolVector<Vector2>();
|
||||
}
|
||||
}
|
||||
|
||||
Rect2i r = node->get_used_rect();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue