🐛 Fix wasm problem with horizontal/vertical lines

This commit is contained in:
alonso.torres 2025-06-24 09:18:22 +02:00
parent f54497194a
commit b0d858df2b

View file

@ -115,8 +115,19 @@ fn set_pixel_precision(transform: &mut Matrix, bounds: &mut Bounds) {
let x = bounds.min_x().round(); let x = bounds.min_x().round();
let y = bounds.min_y().round(); let y = bounds.min_y().round();
let scale_width = f32::max(0.01, bounds.width().round() / bounds.width()); let width = bounds.width();
let scale_height = f32::max(0.01, bounds.height().round() / bounds.height()); let height = bounds.height();
let scale_width = if width > 0.1 {
f32::max(0.01, bounds.width().round() / bounds.width())
} else {
1.0
};
let scale_height = if height > 0.1 {
f32::max(0.01, bounds.height().round() / bounds.height())
} else {
1.0
};
if f32::is_finite(scale_width) if f32::is_finite(scale_width)
&& f32::is_finite(scale_height) && f32::is_finite(scale_height)