diff --git a/lightningbeam-ui/egui_node_graph2/src/editor_ui.rs b/lightningbeam-ui/egui_node_graph2/src/editor_ui.rs index 75b7a92..72d436e 100644 --- a/lightningbeam-ui/egui_node_graph2/src/editor_ui.rs +++ b/lightningbeam-ui/egui_node_graph2/src/editor_ui.rs @@ -627,11 +627,11 @@ where ui: &mut Ui, user_state: &mut UserState, ) -> Vec> { - let mut child_ui = ui.child_ui_with_id_source( - Rect::from_min_size(*self.position + self.pan, Self::MAX_NODE_SIZE.into()), - Layout::default(), - self.node_id, - None, + let mut child_ui = ui.new_child( + egui::UiBuilder::new() + .max_rect(Rect::from_min_size(*self.position + self.pan, Self::MAX_NODE_SIZE.into())) + .layout(Layout::default()) + .id_salt(self.node_id), ); Self::show_graph_node(self, pan_zoom, &mut child_ui, user_state) @@ -676,7 +676,11 @@ where inner_rect.max.x = inner_rect.max.x.max(inner_rect.min.x); inner_rect.max.y = inner_rect.max.y.max(inner_rect.min.y); - let mut child_ui = ui.child_ui(inner_rect, *ui.layout(), None); + let mut child_ui = ui.new_child( + egui::UiBuilder::new() + .max_rect(inner_rect) + .layout(*ui.layout()), + ); // Get interaction rect from memory, it may expand after the window response on resize. let interaction_rect = ui diff --git a/lightningbeam-ui/egui_node_graph2/src/graph_impls.rs b/lightningbeam-ui/egui_node_graph2/src/graph_impls.rs index a117b95..9ab0e3e 100644 --- a/lightningbeam-ui/egui_node_graph2/src/graph_impls.rs +++ b/lightningbeam-ui/egui_node_graph2/src/graph_impls.rs @@ -241,14 +241,14 @@ impl Node { pub fn inputs<'a, DataType, DataValue>( &'a self, graph: &'a Graph, - ) -> impl Iterator> + 'a { + ) -> impl Iterator> + 'a { self.input_ids().map(|id| graph.get_input(id)) } pub fn outputs<'a, DataType, DataValue>( &'a self, graph: &'a Graph, - ) -> impl Iterator> + 'a { + ) -> impl Iterator> + 'a { self.output_ids().map(|id| graph.get_output(id)) } diff --git a/lightningbeam-ui/egui_node_graph2/src/traits.rs b/lightningbeam-ui/egui_node_graph2/src/traits.rs index 694c090..0c40207 100644 --- a/lightningbeam-ui/egui_node_graph2/src/traits.rs +++ b/lightningbeam-ui/egui_node_graph2/src/traits.rs @@ -84,7 +84,7 @@ pub trait DataTypeTrait: PartialEq + Eq { /// } /// } /// ``` - fn name(&self) -> std::borrow::Cow; + fn name(&self) -> std::borrow::Cow<'_, str>; } /// This trait must be implemented for the `NodeData` generic parameter of the @@ -251,7 +251,7 @@ pub trait NodeTemplateTrait: Clone { /// The return type is Cow to allow returning owned or borrowed values /// more flexibly. Refer to the documentation for `DataTypeTrait::name` for /// more information - fn node_finder_label(&self, user_state: &mut Self::UserState) -> std::borrow::Cow; + fn node_finder_label(&self, user_state: &mut Self::UserState) -> std::borrow::Cow<'_, str>; /// Vec of categories to which the node belongs. ///