From 64bfbffc0b6b03468e4472ff55c1652a5b259cd8 Mon Sep 17 00:00:00 2001 From: Nicolas Silva Date: Sun, 8 Mar 2026 11:45:23 +0100 Subject: [PATCH] A fix in lyon_algorithm's ToRectangle It was missing the exit conditions and accepting cases it shouldn't have. --- crates/algorithms/src/rect.rs | 4 ++-- crates/algorithms/src/rounded_polygon.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/algorithms/src/rect.rs b/crates/algorithms/src/rect.rs index eb8479bb..9307d474 100644 --- a/crates/algorithms/src/rect.rs +++ b/crates/algorithms/src/rect.rs @@ -102,7 +102,7 @@ pub fn to_axis_aligned_rectangle>( } } - ctx.edge(from, to); + ctx.edge(from, to)?; } PathEvent::Cubic { from, @@ -139,7 +139,7 @@ pub fn to_axis_aligned_rectangle>( return None; } - ctx.edge(from, to); + ctx.edge(from, to)?; } } } diff --git a/crates/algorithms/src/rounded_polygon.rs b/crates/algorithms/src/rounded_polygon.rs index fdf7e6c1..6a7228aa 100644 --- a/crates/algorithms/src/rounded_polygon.rs +++ b/crates/algorithms/src/rounded_polygon.rs @@ -203,7 +203,7 @@ fn rounded_polygon() { let mut previous = actual_events[0].to(); for e in actual_events { - e.from().approx_eq(&previous); + assert!(e.from().approx_eq(&previous)); previous = e.to(); } }