fixed image exporting with wrong size
This commit is contained in:
+5
-7
@@ -54,9 +54,9 @@ impl ExportGeometry {
|
|||||||
// Build export geometry with a fixed cell size and padding.
|
// Build export geometry with a fixed cell size and padding.
|
||||||
fn new(cols: usize, rows: usize) -> Self {
|
fn new(cols: usize, rows: usize) -> Self {
|
||||||
let cell = 64.0;
|
let cell = 64.0;
|
||||||
let pad = 40.0;
|
let pad = 0.0;
|
||||||
let width = (pad * 2.0 + cols as f32 * cell).round() as u32;
|
let width = (cols as f32 * cell).round() as u32;
|
||||||
let height = (pad * 2.0 + rows as f32 * cell).round() as u32;
|
let height = (rows as f32 * cell).round() as u32;
|
||||||
Self {
|
Self {
|
||||||
cols,
|
cols,
|
||||||
rows,
|
rows,
|
||||||
@@ -513,10 +513,8 @@ fn raster_mask_image_from_pixmap(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Compute the mask target size based on export width scaling.
|
// Compute the mask target size based on export width scaling.
|
||||||
fn raster_mask_target_size(settings: &UiSettings, src_w: u32, src_h: u32) -> (u32, u32) {
|
fn raster_mask_target_size(settings: &UiSettings, _src_w: u32, _src_h: u32) -> (u32, u32) {
|
||||||
let (target_w, _target_h) = raster_target_size(settings);
|
raster_target_size(settings)
|
||||||
let scale = ((target_w as f32) / (src_w as f32)).round().max(1.0) as u32;
|
|
||||||
(src_w.saturating_mul(scale), src_h.saturating_mul(scale))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Compute the output raster size while honoring aspect settings.
|
// Compute the output raster size while honoring aspect settings.
|
||||||
|
|||||||
Reference in New Issue
Block a user