From e49c7ee62ca12d0286e5097147f15501a3ca269b Mon Sep 17 00:00:00 2001 From: Nuhiat-Arefin Date: Wed, 28 Jan 2026 01:51:12 +0600 Subject: [PATCH 1/3] Fix scaling while export Update node_graph_executor.rs --- editor/src/node_graph_executor.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/editor/src/node_graph_executor.rs b/editor/src/node_graph_executor.rs index 2b78e595a6..231cb7408f 100644 --- a/editor/src/node_graph_executor.rs +++ b/editor/src/node_graph_executor.rs @@ -253,7 +253,8 @@ impl NodeGraphExecutor { transform, ..Default::default() }, - scale: export_config.scale_factor, + // For exports, keep the internal render scale at 1.0 and apply the user scale factor only to the bitmap size later + scale: 1., time: Default::default(), pointer: DVec2::ZERO, export_format, From 3b1056006246020378a542c98497c45e701c8063 Mon Sep 17 00:00:00 2001 From: Ayush Amawate Date: Wed, 28 Jan 2026 19:48:55 +0530 Subject: [PATCH 2/3] fix desktop png / jpeg exports --- editor/src/node_graph_executor.rs | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/editor/src/node_graph_executor.rs b/editor/src/node_graph_executor.rs index 231cb7408f..0df6595c0a 100644 --- a/editor/src/node_graph_executor.rs +++ b/editor/src/node_graph_executor.rs @@ -244,8 +244,25 @@ impl NodeGraphExecutor { ExportBounds::Artboard(id) => document.metadata().bounding_box_document(id), } .ok_or_else(|| "No bounding box".to_string())?; - let resolution = (bounds[1] - bounds[0]).round().as_uvec2(); - let transform = DAffine2::from_translation(bounds[0]).inverse(); + + // Calculate base resolution from bounds + let base_size = bounds[1] - bounds[0]; + + // For raster exports (PNG/JPG), apply scale factor to resolution for GPU rendering + // For SVG exports, keep original resolution (scaling happens during SVG-to-raster conversion on frontend) + let resolution = if export_format == graphene_std::application_io::ExportFormat::Raster { + (base_size * export_config.scale_factor).round().as_uvec2() + } else { + base_size.round().as_uvec2() + }; + + // Transform from document space to viewport space + // First translate to origin, then scale if doing raster export + let transform = if export_format == graphene_std::application_io::ExportFormat::Raster { + DAffine2::from_scale(DVec2::splat(export_config.scale_factor)) * DAffine2::from_translation(-bounds[0]) + } else { + DAffine2::from_translation(bounds[0]).inverse() + }; let render_config = RenderConfig { viewport: Footprint { From 5933707ca1cec263b28ace16155b608a1b62b32c Mon Sep 17 00:00:00 2001 From: Nuhiat Arefin <99596518+Nuhiat-Arefin@users.noreply.github.com> Date: Wed, 28 Jan 2026 22:01:40 +0600 Subject: [PATCH 3/3] Revert "fix desktop png / jpeg exports" --- editor/src/node_graph_executor.rs | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/editor/src/node_graph_executor.rs b/editor/src/node_graph_executor.rs index 0df6595c0a..231cb7408f 100644 --- a/editor/src/node_graph_executor.rs +++ b/editor/src/node_graph_executor.rs @@ -244,25 +244,8 @@ impl NodeGraphExecutor { ExportBounds::Artboard(id) => document.metadata().bounding_box_document(id), } .ok_or_else(|| "No bounding box".to_string())?; - - // Calculate base resolution from bounds - let base_size = bounds[1] - bounds[0]; - - // For raster exports (PNG/JPG), apply scale factor to resolution for GPU rendering - // For SVG exports, keep original resolution (scaling happens during SVG-to-raster conversion on frontend) - let resolution = if export_format == graphene_std::application_io::ExportFormat::Raster { - (base_size * export_config.scale_factor).round().as_uvec2() - } else { - base_size.round().as_uvec2() - }; - - // Transform from document space to viewport space - // First translate to origin, then scale if doing raster export - let transform = if export_format == graphene_std::application_io::ExportFormat::Raster { - DAffine2::from_scale(DVec2::splat(export_config.scale_factor)) * DAffine2::from_translation(-bounds[0]) - } else { - DAffine2::from_translation(bounds[0]).inverse() - }; + let resolution = (bounds[1] - bounds[0]).round().as_uvec2(); + let transform = DAffine2::from_translation(bounds[0]).inverse(); let render_config = RenderConfig { viewport: Footprint {