From 0474ea9e1bb2eb809a02f6a3173301dbc5f709fe Mon Sep 17 00:00:00 2001 From: NetterSilver <133535268+Silvertree2010@users.noreply.github.com> Date: Tue, 27 Oct 2026 20:26:19 +0000 Subject: [PATCH] Drop the sign from slider text that rounds to zero Found while testing crates/develop/src/controls.rs:98 (ControlSpec::format) Co-Authored-By: Claude Haiku 5.5 Co-Authored-By: Claude Sonnet 5.5 --- crates/develop/src/controls.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/crates/develop/src/controls.rs b/crates/develop/src/controls.rs index 715e8ac33..f58cb17bb 100644 --- a/crates/develop/src/controls.rs +++ b/crates/develop/src/controls.rs @@ -97,6 +97,10 @@ impl ControlSpec { } pub fn format(&self, v: f64) -> String { let s = format!("{:.*}", self.decimals as usize, v); + if v.is_finite() && !s.bytes().any(|b| matches!(b, b'1'..=b'9')) { + // Rounds to zero: no sign. + return s.trim_start_matches('-').to_string(); + } if v > 0.0 && self.min < 0.0 { format!("+{s}") } else { s } } /// Where `v` sits on the slider track, from 0 (left end) to 1 (right end). Linear, except for the Kelvin @@ -493,6 +497,17 @@ pub fn in_section(section: Section) -> impl Iterator