Skip to content

Commit d7904e3

Browse files
committed
Fix a crash encountered while testing
1 parent f24edc7 commit d7904e3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

editor/src/messages/tool/common_functionality/shape_editor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1822,7 +1822,7 @@ impl ShapeState {
18221822
/// Find the `t` value along the path segment we have clicked upon, together with that segment ID.
18231823
fn closest_segment(&self, network_interface: &NodeNetworkInterface, layer: LayerNodeIdentifier, position: glam::DVec2, tolerance: f64) -> Option<ClosestSegment> {
18241824
let transform = network_interface.document_metadata().transform_to_viewport_if_feeds(layer, network_interface);
1825-
let layer_pos = transform.inverse().transform_point2(position);
1825+
let layer_pos = (transform.matrix2.determinant().abs() >= f64::EPSILON).then(|| transform.inverse().transform_point2(position))?;
18261826

18271827
let tolerance = tolerance + 0.5;
18281828

0 commit comments

Comments
 (0)