Fix PNG exports being off by 1 pixel (#3582)

use round() instead of as_uvec2() while exporting
This commit is contained in:
Ayush Amawate 2026-01-06 19:20:32 +05:30 committed by GitHub
parent 9cb856eee4
commit fcf32b3cff
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -201,7 +201,7 @@ impl NodeGraphExecutor {
ExportBounds::Artboard(id) => document.metadata().bounding_box_document(id), ExportBounds::Artboard(id) => document.metadata().bounding_box_document(id),
} }
.ok_or_else(|| "No bounding box".to_string())?; .ok_or_else(|| "No bounding box".to_string())?;
let resolution = (bounds[1] - bounds[0]).as_uvec2(); let resolution = (bounds[1] - bounds[0]).round().as_uvec2();
let transform = DAffine2::from_translation(bounds[0]).inverse(); let transform = DAffine2::from_translation(bounds[0]).inverse();
let render_config = RenderConfig { let render_config = RenderConfig {