Add AnyParameterId argument to NodeDataTrait::separator

This commit is contained in:
Kamil Koczurek 2023-05-13 12:40:29 +02:00
parent 2976153046
commit 02e625ccd7
2 changed files with 6 additions and 2 deletions

View File

@ -603,6 +603,7 @@ where
self.graph[self.node_id].user_data.separator( self.graph[self.node_id].user_data.separator(
ui, ui,
self.node_id, self.node_id,
AnyParameterId::Input(param_id),
self.graph, self.graph,
user_state, user_state,
); );
@ -615,7 +616,7 @@ where
} }
let outputs = self.graph[self.node_id].outputs.clone(); let outputs = self.graph[self.node_id].outputs.clone();
for (param_name, _param) in outputs { for (param_name, param_id) in outputs {
let height_before = ui.min_rect().bottom(); let height_before = ui.min_rect().bottom();
responses.extend( responses.extend(
self.graph[self.node_id] self.graph[self.node_id]
@ -627,6 +628,7 @@ where
self.graph[self.node_id].user_data.separator( self.graph[self.node_id].user_data.separator(
ui, ui,
self.node_id, self.node_id,
AnyParameterId::Output(param_id),
self.graph, self.graph,
user_state, user_state,
); );

View File

@ -162,13 +162,15 @@ where
/// ///
/// Invoked between inputs, outputs and bottom UI. Useful for /// Invoked between inputs, outputs and bottom UI. Useful for
/// complicated UIs that start to lose structure without explicit /// complicated UIs that start to lose structure without explicit
/// separators. /// separators. The `param_id` argument is the id of input or output
/// *preceeding* the separator.
/// ///
/// Default implementation does nothing. /// Default implementation does nothing.
fn separator( fn separator(
&self, &self,
_ui: &mut egui::Ui, _ui: &mut egui::Ui,
_node_id: NodeId, _node_id: NodeId,
_param_id: AnyParameterId,
_graph: &Graph<Self, Self::DataType, Self::ValueType>, _graph: &Graph<Self, Self::DataType, Self::ValueType>,
_user_state: &mut Self::UserState, _user_state: &mut Self::UserState,
) { ) {