From 686c008dc853a5a591d765380236be09d16bb991 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Ram=C3=B3n=20Jim=C3=A9nez?= Date: Tue, 29 Jul 2025 22:42:20 +0200 Subject: [PATCH] Make `toggler` always perfectly round --- widget/src/toggler.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/widget/src/toggler.rs b/widget/src/toggler.rs index 02c53671..7f6e6795 100644 --- a/widget/src/toggler.rs +++ b/widget/src/toggler.rs @@ -394,9 +394,6 @@ where _cursor: mouse::Cursor, viewport: &Rectangle, ) { - /// Makes sure that the border radius of the toggler looks good at every size. - const BORDER_RADIUS_RATIO: f32 = 32.0 / 13.0; - /// The space ratio between the background Quad and the Toggler bounds, and /// between the background Quad and foreground Quad. const SPACE_RATIO: f32 = 0.05; @@ -423,7 +420,7 @@ where let style = theme .style(&self.class, self.last_status.unwrap_or(Status::Disabled)); - let border_radius = bounds.height / BORDER_RADIUS_RATIO; + let border_radius = bounds.height / 2.0; let space = (SPACE_RATIO * bounds.height).round(); let toggler_background_bounds = Rectangle {