From c05afc6b44d5ed7c4398ddd5ed9a22b30ea122ed Mon Sep 17 00:00:00 2001 From: aiongg <67543387+aiongg@users.noreply.github.com> Date: Wed, 4 Nov 2026 01:54:40 +0000 Subject: [PATCH] Apply review fixes - crates/geom/src/path.rs --- crates/geom/src/path.rs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/crates/geom/src/path.rs b/crates/geom/src/path.rs index a9d9ead65..2f17c49fa 100644 --- a/crates/geom/src/path.rs +++ b/crates/geom/src/path.rs @@ -414,7 +414,19 @@ impl PathData { /// True if some subpath encloses an area once closed: a frame, or an open path such as a V. /// A line, or a path whose points all lie on one line, encloses none. pub fn encloses_area(&self) -> bool { - self.subpaths.iter().any(|sp| SubPath::new(sp.anchors.clone(), true).area().abs() > 1e-6) + self.subpaths.iter().any(|sp| { + let mut anchors = sp.anchors.clone(); + // An open subpath closes with a straight segment: its end handles are unused. + if !sp.closed { + if let Some(a) = anchors.first_mut() { + a.h_in = a.p; + } + if let Some(a) = anchors.last_mut() { + a.h_out = a.p; + } + } + SubPath::new(anchors, true).area().abs() > 1e-6 + }) } }