Merge pull request #88157 from kleonc/tilemap-move-layer-fix-moving-child-nodes

Fix `TileMap::move_layer` incorrectly moving child `TileMapLayer` nodes
This commit is contained in:
Rémi Verschelde 2024-02-12 13:34:46 +01:00
commit a1aca7e5c9
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

@ -238,7 +238,7 @@ void TileMap::move_layer(int p_layer, int p_to_pos) {
layers.insert(p_to_pos, layer); layers.insert(p_to_pos, layer);
layers.remove_at(p_to_pos < p_layer ? p_layer + 1 : p_layer); layers.remove_at(p_to_pos < p_layer ? p_layer + 1 : p_layer);
for (uint32_t i = 0; i < layers.size(); i++) { for (uint32_t i = 0; i < layers.size(); i++) {
move_child(layer, i); move_child(layers[i], i);
layers[i]->set_layer_index_in_tile_map_node(i); layers[i]->set_layer_index_in_tile_map_node(i);
} }
notify_property_list_changed(); notify_property_list_changed();