From d0e1d8982fee975d6b07471ba3b737c3f6c43b4d Mon Sep 17 00:00:00 2001 From: HWienhold Date: Wed, 9 Jul 2025 03:47:56 +0200 Subject: [PATCH] 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 --- editor/src/messages/tool/common_functionality/shape_editor.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/editor/src/messages/tool/common_functionality/shape_editor.rs b/editor/src/messages/tool/common_functionality/shape_editor.rs index 581c8990..f98e50f0 100644 --- a/editor/src/messages/tool/common_functionality/shape_editor.rs +++ b/editor/src/messages/tool/common_functionality/shape_editor.rs @@ -1079,7 +1079,7 @@ impl ShapeState { let mut normalized = handle_directions[0].and_then(|a| handle_directions[1].and_then(|b| (a - b).try_normalize())); - if normalized.is_none() { + if normalized.is_none() || handle_directions.iter().any(|&d| d.is_some_and(|d| d.length_squared() < f64::EPSILON * 1e5)) { handle_directions = anchor_positions.map(|relative_anchor| relative_anchor.map(|relative_anchor| (relative_anchor - anchor) / 3.)); normalized = handle_directions[0].and_then(|a| handle_directions[1].and_then(|b| (a - b).try_normalize())) }