mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-15 22:28:10 +08:00
Fix crash when scaling something with 0 width or height (#1078)
* resolve NaN value when trying to change scale value from zero to other numbers * resolve NaN value when trying to change scale value from zero to other numbers --------- Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
committed by
Keavon Chambers
parent
d6ab417bcb
commit
dbcb854cd2
@@ -48,6 +48,9 @@ pub fn apply_transform_operation(layer: &Layer, transform_op: TransformOp, value
|
||||
|
||||
// Find the delta transform
|
||||
let mut delta = layer.transform.inverse() * transform;
|
||||
if !delta.is_finite() {
|
||||
return layer.transform.to_cols_array();
|
||||
}
|
||||
|
||||
// Preserve aspect ratio
|
||||
if matches!(transform_op, TransformOp::ScaleX | TransformOp::Width) && layer.preserve_aspect {
|
||||
|
||||
Reference in New Issue
Block a user