@@ -238,15 +238,19 @@ impl NodeGraphExecutor {
238238 ExportBounds :: Artboard ( id) => document. metadata ( ) . bounding_box_document ( id) ,
239239 }
240240 . ok_or_else ( || "No bounding box" . to_string ( ) ) ?;
241- let resolution = ( bounds[ 1 ] - bounds[ 0 ] ) . round ( ) . as_uvec2 ( ) ;
241+
242+ let resolution_in_document_space = bounds[ 1 ] - bounds[ 0 ] ;
243+ let export_resolution = resolution_in_document_space * export_config. scale_factor ;
244+ let resolution = export_resolution. round ( ) . as_uvec2 ( ) ;
242245 let transform = DAffine2 :: from_translation ( bounds[ 0 ] ) . inverse ( ) ;
246+ let viewport = Footprint {
247+ resolution,
248+ transform,
249+ ..Default :: default ( )
250+ } ;
243251
244252 let render_config = RenderConfig {
245- viewport : Footprint {
246- resolution,
247- transform,
248- ..Default :: default ( )
249- } ,
253+ viewport,
250254 scale : export_config. scale_factor ,
251255 time : Default :: default ( ) ,
252256 pointer : DVec2 :: ZERO ,
@@ -256,7 +260,7 @@ impl NodeGraphExecutor {
256260 for_export : true ,
257261 for_eyedropper : false ,
258262 } ;
259- export_config. size = resolution. as_dvec2 ( ) ;
263+ export_config. size = resolution;
260264
261265 // Execute the node graph
262266 self . runtime_io
@@ -425,7 +429,6 @@ impl NodeGraphExecutor {
425429 file_type,
426430 name,
427431 size,
428- scale_factor,
429432 #[ cfg( feature = "gpu" ) ]
430433 transparent_background,
431434 artboard_name,
@@ -456,7 +459,7 @@ impl NodeGraphExecutor {
456459 } ) ;
457460 } else {
458461 let mime = file_type. to_mime ( ) . to_string ( ) ;
459- let size = ( size * scale_factor ) . into ( ) ;
462+ let size = size. as_dvec2 ( ) . into ( ) ;
460463 responses. add ( FrontendMessage :: TriggerExportImage { svg, name, mime, size } ) ;
461464 }
462465 }
0 commit comments