This repository was archived by the owner on Apr 9, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
egui_node_graph_example/src Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -111,6 +111,7 @@ where
111
111
ui : & mut Ui ,
112
112
all_kinds : impl NodeTemplateIter < Item = NodeTemplate > ,
113
113
user_state : & mut UserState ,
114
+ prepend_responses : Vec < NodeResponse < UserResponse , NodeData > > ,
114
115
) -> GraphResponse < UserResponse , NodeData > {
115
116
// This causes the graph editor to use as much free space as it can.
116
117
// (so for windows it will use up to the resizeably set limit
@@ -130,7 +131,7 @@ where
130
131
131
132
// The responses returned from node drawing have side effects that are best
132
133
// executed at the end of this function.
133
- let mut delayed_responses: Vec < NodeResponse < UserResponse , NodeData > > = vec ! [ ] ;
134
+ let mut delayed_responses: Vec < NodeResponse < UserResponse , NodeData > > = prepend_responses ;
134
135
135
136
// Used to detect when the background was clicked
136
137
let mut click_on_background = false ;
Original file line number Diff line number Diff line change @@ -417,8 +417,12 @@ impl eframe::App for NodeGraphExample {
417
417
} ) ;
418
418
let graph_response = egui:: CentralPanel :: default ( )
419
419
. show ( ctx, |ui| {
420
- self . state
421
- . draw_graph_editor ( ui, AllMyNodeTemplates , & mut self . user_state )
420
+ self . state . draw_graph_editor (
421
+ ui,
422
+ AllMyNodeTemplates ,
423
+ & mut self . user_state ,
424
+ Vec :: default ( ) ,
425
+ )
422
426
} )
423
427
. inner ;
424
428
for node_response in graph_response. node_responses {
You can’t perform that action at this time.
0 commit comments