diff --git a/document-legacy/src/layers/shape_layer.rs b/document-legacy/src/layers/shape_layer.rs index 48873ba3..43236f7c 100644 --- a/document-legacy/src/layers/shape_layer.rs +++ b/document-legacy/src/layers/shape_layer.rs @@ -59,7 +59,7 @@ impl LayerData for ShapeLayer { fn bounding_box(&self, transform: glam::DAffine2, _render_data: &RenderData) -> Option<[DVec2; 2]> { let mut subpath = self.shape.clone(); - if transform.matrix2 == DMat2::ZERO { + if transform.matrix2 == DMat2::ZERO || !transform.is_finite() { return None; } subpath.apply_affine(transform); diff --git a/editor/src/messages/portfolio/document/properties_panel/utility_functions.rs b/editor/src/messages/portfolio/document/properties_panel/utility_functions.rs index c7804447..60ed8b06 100644 --- a/editor/src/messages/portfolio/document/properties_panel/utility_functions.rs +++ b/editor/src/messages/portfolio/document/properties_panel/utility_functions.rs @@ -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 {