mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-15 22:28:10 +08:00
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>
This commit is contained in:
@@ -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()))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user