fill original handles on integrity restoration step
@@ -755,10 +755,10 @@ impl Graph {
);
// Instantiate missing node.
- let (copy, mapping) =
+ let (copy, old_to_new_mapping) =
resource_graph.copy_node(resource_node_handle, self, &mut |_, _| true);
- restored_count += mapping.len();
+ restored_count += old_to_new_mapping.len();
let mut stack = vec![copy];
while let Some(node_handle) = stack.pop() {
@@ -767,6 +767,10 @@ impl Graph {
stack.extend_from_slice(node.children());
}
+ for (&old, &new) in old_to_new_mapping.iter() {
+ self[new].original_handle_in_resource = old;
+ }
+
// Link it with existing node.
if resource_node.parent().is_some() {
let parent = self.find_by_name(
