@@ -5,8 +5,7 @@ use graph_craft::document::value::{RenderOutput, TaggedValue};
55use graph_craft:: document:: { DocumentNode , DocumentNodeImplementation , NodeId , NodeInput } ;
66use graph_craft:: proto:: GraphErrors ;
77use graph_craft:: wasm_application_io:: EditorPreferences ;
8- use graphene_std:: application_io:: { NodeGraphUpdateMessage , RenderConfig } ;
9- use graphene_std:: application_io:: { SurfaceFrame , TimingInformation } ;
8+ use graphene_std:: application_io:: { NodeGraphUpdateMessage , RenderConfig , TimingInformation } ;
109use graphene_std:: raster:: { CPU , Raster } ;
1110use graphene_std:: renderer:: { RenderMetadata , format_transform_matrix} ;
1211use graphene_std:: text:: FontCache ;
@@ -56,7 +55,6 @@ pub struct NodeGraphExecutor {
5655 futures : VecDeque < ( u64 , ExecutionContext ) > ,
5756 node_graph_hash : u64 ,
5857 previous_node_to_inspect : Option < NodeId > ,
59- last_svg_canvas : Option < SurfaceFrame > ,
6058}
6159
6260#[ derive( Debug , Clone ) ]
@@ -79,7 +77,6 @@ impl NodeGraphExecutor {
7977 node_graph_hash : 0 ,
8078 current_execution_id : 0 ,
8179 previous_node_to_inspect : None ,
82- last_svg_canvas : None ,
8380 } ;
8481 ( node_runtime, node_executor)
8582 }
@@ -94,10 +91,6 @@ impl NodeGraphExecutor {
9491 execution_id
9592 }
9693
97- pub fn clear_canvas_cache ( & mut self ) {
98- self . last_svg_canvas = None ;
99- }
100-
10194 pub fn update_font_cache ( & self , font_cache : FontCache ) {
10295 self . runtime_io . send ( GraphRuntimeRequest :: FontCacheUpdate ( font_cache) ) . expect ( "Failed to send font cache update" ) ;
10396 }
@@ -388,19 +381,14 @@ impl NodeGraphExecutor {
388381 // Send to frontend
389382 responses. add ( FrontendMessage :: UpdateImageData { image_data } ) ;
390383 responses. add ( FrontendMessage :: UpdateDocumentArtwork { svg } ) ;
391- self . last_svg_canvas = None ;
392384 }
393- RenderOutputType :: CanvasFrame ( frame) => ' block: {
394- if self . last_svg_canvas == Some ( frame) {
395- break ' block;
396- }
385+ RenderOutputType :: CanvasFrame ( frame) => {
397386 let matrix = format_transform_matrix ( frame. transform ) ;
398387 let transform = if matrix. is_empty ( ) { String :: new ( ) } else { format ! ( " transform=\" {matrix}\" " ) } ;
399388 let svg = format ! (
400389 r#"<svg><foreignObject width="{}" height="{}"{transform}><div data-canvas-placeholder="{}" data-is-viewport="true"></div></foreignObject></svg>"# ,
401390 frame. resolution. x, frame. resolution. y, frame. surface_id. 0 ,
402391 ) ;
403- self . last_svg_canvas = Some ( frame) ;
404392 responses. add ( FrontendMessage :: UpdateDocumentArtwork { svg } ) ;
405393 }
406394 RenderOutputType :: Texture { .. } => { }
0 commit comments