From 59534c1cbbc8ab02a15473fe122798d032c55c5a Mon Sep 17 00:00:00 2001 From: nrq6993-a11y Date: Mon, 19 Oct 2026 13:29:13 +0300 Subject: [PATCH] Fix LiveCorners::style to report stored radii, not fitted draw sizes. Star corners with a large uniform radius kept None in the panel because fitted draw radii differ per tip; tests and UI expect the value the user set. Co-authored-by: Cursor --- crates/doc/src/corners.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/crates/doc/src/corners.rs b/crates/doc/src/corners.rs index e16403376..e69b528e5 100644 --- a/crates/doc/src/corners.rs +++ b/crates/doc/src/corners.rs @@ -187,14 +187,15 @@ impl<'a> LiveCorners<'a> { &self.sources } - /// The radius (document units) and kind `corners` share (each `None` when they differ, or - /// for no corners). + /// The radius and kind `corners` share (each `None` when they differ, or for no corners). + /// Radius is what was set ([`LiveCorners::radius`]: document lengths, or a fraction in 0..1 + /// when [`LiveCorners::radii_relative`]), not the fitted draw size ([`LiveCorners::drawn_radius`]). pub fn style(&self, corners: &BTreeSet) -> (Option, Option) { fn shared(mut it: impl Iterator, same: impl Fn(T, T) -> bool) -> Option { let first = it.next()?; it.all(|x| same(x, first)).then_some(first) } - let radius = shared(corners.iter().map(|k| self.drawn_radius(*k)), |a, b| (a - b).abs() < 1e-9); + let radius = shared(corners.iter().map(|k| self.radius(*k)), |a, b| (a - b).abs() < 1e-9); (radius, shared(corners.iter().map(|k| self.kind(*k)), |a, b| a == b)) } }