diff --git a/render-wasm/src/shapes.rs b/render-wasm/src/shapes.rs index 4e1f88b031..b17224b90e 100644 --- a/render-wasm/src/shapes.rs +++ b/render-wasm/src/shapes.rs @@ -985,7 +985,7 @@ pub fn modified_children_ids( for st in structure { match st.entry_type { StructureEntryType::AddChild => { - result.insert(st.index as usize, st.id); + result.insert(result.len() - st.index as usize, st.id); } StructureEntryType::RemoveChild => { to_remove.insert(&st.id);