11use crate :: messages:: frontend:: utility_types:: { ExportBounds , FileType } ;
22use crate :: messages:: prelude:: * ;
33use glam:: { DAffine2 , DVec2 , UVec2 } ;
4- use graph_craft:: document:: value:: { RenderOutput , TaggedValue } ;
4+ use graph_craft:: application_io:: EditorPreferences ;
5+ use graph_craft:: document:: value:: { RenderOutput , RenderOutputType , TaggedValue } ;
56use graph_craft:: document:: { DocumentNode , DocumentNodeImplementation , NodeId , NodeInput } ;
67use graph_craft:: proto:: GraphErrors ;
7- use graph_craft:: wasm_application_io:: EditorPreferences ;
88use graphene_std:: application_io:: { NodeGraphUpdateMessage , RenderConfig , TimingInformation } ;
99use graphene_std:: raster:: { CPU , Raster } ;
10- use graphene_std:: renderer:: { RenderMetadata , format_transform_matrix } ;
10+ use graphene_std:: renderer:: RenderMetadata ;
1111use graphene_std:: text:: FontCache ;
1212use graphene_std:: transform:: Footprint ;
1313use graphene_std:: vector:: Vector ;
14- use graphene_std:: wasm_application_io:: RenderOutputType ;
1514use interpreted_executor:: dynamic_executor:: ResolvedDocumentNodeTypesDelta ;
1615
1716mod runtime_io;
@@ -380,6 +379,7 @@ impl NodeGraphExecutor {
380379 let ( data, width, height) = raster. to_flat_u8 ( ) ;
381380 responses. add ( EyedropperToolMessage :: PreviewImage { data, width, height } ) ;
382381 }
382+ NodeGraphUpdate :: NodeGraphUpdateMessage ( _) => { }
383383 }
384384 }
385385
@@ -397,12 +397,11 @@ impl NodeGraphExecutor {
397397 responses. add ( FrontendMessage :: UpdateImageData { image_data } ) ;
398398 responses. add ( FrontendMessage :: UpdateDocumentArtwork { svg } ) ;
399399 }
400- RenderOutputType :: CanvasFrame ( frame) => {
401- let matrix = format_transform_matrix ( frame. transform ) ;
402- let transform = if matrix. is_empty ( ) { String :: new ( ) } else { format ! ( " transform=\" {matrix}\" " ) } ;
400+ #[ cfg( target_family = "wasm" ) ]
401+ RenderOutputType :: CanvasFrame { canvas_id, resolution } => {
403402 let svg = format ! (
404- r#"<svg><foreignObject width="{}" height="{}"{transform} ><div data-canvas-placeholder="{}" data-is-viewport="true"></div></foreignObject></svg>"# ,
405- frame . resolution. x, frame . resolution. y, frame . surface_id . 0 ,
403+ r#"<svg><foreignObject width="{}" height="{}"><div data-canvas-placeholder="{}" data-is-viewport="true"></div></foreignObject></svg>"# ,
404+ resolution. x, resolution. y, canvas_id ,
406405 ) ;
407406 responses. add ( FrontendMessage :: UpdateDocumentArtwork { svg } ) ;
408407 }
0 commit comments