(
doc: &SceneDoc,
selected_key: Option<u32>,
as_sibling: bool,
)
| 1021 | doc.normalize_links(); |
| 1022 | set_state_scene_doc(state, &doc); |
| 1023 | state.selected_key = Some(next_id); |
| 1024 | state.add_node_as_sibling = false; |
| 1025 | push_recent_node_type(state, node_type.name()); |
| 1026 | if let Some(mode) = viewport_mode_for_node_type(node_type) { |
| 1027 | state.viewport_mode = mode.to_string(); |
| 1028 | } |
| 1029 | state.dirty = true; |
| 1030 | if let Some(path) = state.open_paths.get(state.active_open).cloned() |
| 1031 | && !state.dirty_scene_paths.iter().any(|item| item == &path) |
| 1032 | { |
| 1033 | state.dirty_scene_paths.push(path); |
| 1034 | } |
| 1035 | state.log = match auto_bind { |
| 1036 | Some(binding) => format!("add node\n{name}: {}\n{binding}", node_type.name()), |
| 1037 | None => format!("add node\n{name}: {}", node_type.name()), |
| 1038 | }; |
| 1039 | msg = state.log.clone(); |
| 1040 | }); |
| 1041 | set_log(ctx, &msg); |
| 1042 | rebuild_preview(ctx); |
| 1043 | refresh_all(ctx); |
| 1044 | } |
no test coverage detected