From 62fcc8859df9cc4a28616d3aec974d4e07644ad2 Mon Sep 17 00:00:00 2001 From: JMS55 <47158642+JMS55@users.noreply.github.com> Date: Fri, 15 Dec 2023 17:51:05 -0800 Subject: [PATCH] Misc --- src/apply_mutations.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/apply_mutations.rs b/src/apply_mutations.rs index 1481c29..83206cf 100644 --- a/src/apply_mutations.rs +++ b/src/apply_mutations.rs @@ -82,6 +82,7 @@ pub fn apply_mutations( } let existing_parent = world.entity(existing).get::().unwrap().get(); let mut existing_parent = world.entity_mut(existing_parent); + let existing_index = existing_parent .get::() .unwrap() @@ -90,6 +91,7 @@ pub fn apply_mutations( .unwrap(); let new = stack.drain((stack.len() - m)..).collect::>(); existing_parent.insert_children(existing_index, &new); + DespawnRecursive { entity: existing }.apply(world); let existing_element_id = bevy_ui_entity_to_element_id.remove(&existing).unwrap(); element_id_to_bevy_ui_entity.remove(&existing_element_id); @@ -108,6 +110,7 @@ pub fn apply_mutations( panic!("Encountered unsupported bevy_dioxus attribute `{name}: {value:?}`.") } }; + let (mut style, mut background_color) = world .query::<(&mut Style, &mut BackgroundColor)>() .get_mut(world, element_id_to_bevy_ui_entity[&id])