clean up compiler warnings in egui_node_graph2
This commit is contained in:
parent
da147fe6d4
commit
6c88c4a8da
|
|
@ -627,11 +627,11 @@ where
|
||||||
ui: &mut Ui,
|
ui: &mut Ui,
|
||||||
user_state: &mut UserState,
|
user_state: &mut UserState,
|
||||||
) -> Vec<NodeResponse<UserResponse, NodeData>> {
|
) -> Vec<NodeResponse<UserResponse, NodeData>> {
|
||||||
let mut child_ui = ui.child_ui_with_id_source(
|
let mut child_ui = ui.new_child(
|
||||||
Rect::from_min_size(*self.position + self.pan, Self::MAX_NODE_SIZE.into()),
|
egui::UiBuilder::new()
|
||||||
Layout::default(),
|
.max_rect(Rect::from_min_size(*self.position + self.pan, Self::MAX_NODE_SIZE.into()))
|
||||||
self.node_id,
|
.layout(Layout::default())
|
||||||
None,
|
.id_salt(self.node_id),
|
||||||
);
|
);
|
||||||
|
|
||||||
Self::show_graph_node(self, pan_zoom, &mut child_ui, user_state)
|
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.x = inner_rect.max.x.max(inner_rect.min.x);
|
||||||
inner_rect.max.y = inner_rect.max.y.max(inner_rect.min.y);
|
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.
|
// Get interaction rect from memory, it may expand after the window response on resize.
|
||||||
let interaction_rect = ui
|
let interaction_rect = ui
|
||||||
|
|
|
||||||
|
|
@ -241,14 +241,14 @@ impl<NodeData> Node<NodeData> {
|
||||||
pub fn inputs<'a, DataType, DataValue>(
|
pub fn inputs<'a, DataType, DataValue>(
|
||||||
&'a self,
|
&'a self,
|
||||||
graph: &'a Graph<NodeData, DataType, DataValue>,
|
graph: &'a Graph<NodeData, DataType, DataValue>,
|
||||||
) -> impl Iterator<Item = &InputParam<DataType, DataValue>> + 'a {
|
) -> impl Iterator<Item = &'a InputParam<DataType, DataValue>> + 'a {
|
||||||
self.input_ids().map(|id| graph.get_input(id))
|
self.input_ids().map(|id| graph.get_input(id))
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn outputs<'a, DataType, DataValue>(
|
pub fn outputs<'a, DataType, DataValue>(
|
||||||
&'a self,
|
&'a self,
|
||||||
graph: &'a Graph<NodeData, DataType, DataValue>,
|
graph: &'a Graph<NodeData, DataType, DataValue>,
|
||||||
) -> impl Iterator<Item = &OutputParam<DataType>> + 'a {
|
) -> impl Iterator<Item = &'a OutputParam<DataType>> + 'a {
|
||||||
self.output_ids().map(|id| graph.get_output(id))
|
self.output_ids().map(|id| graph.get_output(id))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -84,7 +84,7 @@ pub trait DataTypeTrait<UserState>: PartialEq + Eq {
|
||||||
/// }
|
/// }
|
||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
fn name(&self) -> std::borrow::Cow<str>;
|
fn name(&self) -> std::borrow::Cow<'_, str>;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// This trait must be implemented for the `NodeData` generic parameter of the
|
/// 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<str> to allow returning owned or borrowed values
|
/// The return type is Cow<str> to allow returning owned or borrowed values
|
||||||
/// more flexibly. Refer to the documentation for `DataTypeTrait::name` for
|
/// more flexibly. Refer to the documentation for `DataTypeTrait::name` for
|
||||||
/// more information
|
/// more information
|
||||||
fn node_finder_label(&self, user_state: &mut Self::UserState) -> std::borrow::Cow<str>;
|
fn node_finder_label(&self, user_state: &mut Self::UserState) -> std::borrow::Cow<'_, str>;
|
||||||
|
|
||||||
/// Vec of categories to which the node belongs.
|
/// Vec of categories to which the node belongs.
|
||||||
///
|
///
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue