mirror of
https://github.com/penpot/penpot.git
synced 2025-12-11 22:14:05 +01:00
🐛 Fix create empty text
This commit is contained in:
@@ -428,8 +428,17 @@ pub fn resize_matrix(
|
||||
new_height: f32,
|
||||
) -> Matrix {
|
||||
let mut result = Matrix::default();
|
||||
let scale_width = new_width / child_bounds.width();
|
||||
let scale_height = new_height / child_bounds.height();
|
||||
|
||||
let safe_scale = |value: f32, base: f32| -> f32 {
|
||||
if !value.is_finite() || !base.is_finite() || is_close_to(base, 0.0) {
|
||||
1.0
|
||||
} else {
|
||||
value / base
|
||||
}
|
||||
};
|
||||
|
||||
let scale_width = safe_scale(new_width, child_bounds.width());
|
||||
let scale_height = safe_scale(new_height, child_bounds.height());
|
||||
|
||||
let center = child_bounds.center();
|
||||
let mut parent_transform = parent_bounds.transform_matrix().unwrap_or_default();
|
||||
|
||||
Reference in New Issue
Block a user