@@ -48,7 +48,15 @@ impl WinitApp {
4848 self . send_messages_to_editor ( responses) ;
4949 }
5050
51- fn send_messages_to_editor ( & mut self , responses : Vec < FrontendMessage > ) {
51+ fn send_messages_to_editor ( & mut self , mut responses : Vec < FrontendMessage > ) {
52+ for message in responses. extract_if ( .., |m| matches ! ( m, FrontendMessage :: RenderOverlays ( _) ) ) {
53+ let FrontendMessage :: RenderOverlays ( overlay_context) = message else { unreachable ! ( ) } ;
54+ if let Some ( graphics_state) = & mut self . graphics_state {
55+ let scene = overlay_context. take_scene ( ) ;
56+ graphics_state. set_overlays_scene ( scene) ;
57+ }
58+ }
59+
5260 if responses. is_empty ( ) {
5361 return ;
5462 }
@@ -110,8 +118,8 @@ impl ApplicationHandler<CustomEvent> for WinitApp {
110118 match event {
111119 CustomEvent :: UiUpdate ( texture) => {
112120 if let Some ( graphics_state) = self . graphics_state . as_mut ( ) {
113- graphics_state. bind_ui_texture ( & texture) ;
114121 graphics_state. resize ( texture. width ( ) , texture. height ( ) ) ;
122+ graphics_state. bind_ui_texture ( texture) ;
115123 }
116124 if let Some ( window) = & self . window {
117125 window. request_redraw ( ) ;
@@ -125,7 +133,7 @@ impl ApplicationHandler<CustomEvent> for WinitApp {
125133 }
126134 }
127135 CustomEvent :: MessageReceived { message } => {
128- if let Message :: InputPreprocessor ( ipp_message ) = & message {
136+ if let Message :: InputPreprocessor ( _ ) = & message {
129137 if let Some ( window) = & self . window {
130138 window. request_redraw ( ) ;
131139 }
@@ -144,13 +152,14 @@ impl ApplicationHandler<CustomEvent> for WinitApp {
144152 panic ! ( "graphics state not intialized, viewport offset might be lost" ) ;
145153 }
146154 }
155+
147156 self . dispatch_message ( message) ;
148157 }
149158 CustomEvent :: NodeGraphRan { texture } => {
150159 if let Some ( texture) = texture
151160 && let Some ( graphics_state) = & mut self . graphics_state
152161 {
153- graphics_state. bind_viewport_texture ( & texture) ;
162+ graphics_state. bind_viewport_texture ( texture) ;
154163 }
155164 let mut responses = VecDeque :: new ( ) ;
156165 let err = self . editor . poll_node_graph_evaluation ( & mut responses) ;
0 commit comments