Skip to content

Commit d0e1d89

Browse files
HWienholdKeavon
andauthored
Allow tooling to treat near-zero-length handles as zero-length when converting to colinear (#2747)
fix colinear handles on connected path Co-authored-by: Keavon Chambers <keavon@keavon.com>
1 parent d2f8c99 commit d0e1d89

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
@@ -1079,7 +1079,7 @@ impl ShapeState {
10791079

10801080
let mut normalized = handle_directions[0].and_then(|a| handle_directions[1].and_then(|b| (a - b).try_normalize()));
10811081

1082-
if normalized.is_none() {
1082+
if normalized.is_none() || handle_directions.iter().any(|&d| d.is_some_and(|d| d.length_squared() < f64::EPSILON * 1e5)) {
10831083
handle_directions = anchor_positions.map(|relative_anchor| relative_anchor.map(|relative_anchor| (relative_anchor - anchor) / 3.));
10841084
normalized = handle_directions[0].and_then(|a| handle_directions[1].and_then(|b| (a - b).try_normalize()))
10851085
}

0 commit comments

Comments
 (0)