From 955b62ea2deec383fe693d169dba8d35633876a3 Mon Sep 17 00:00:00 2001 From: rubik83 <45452623+rubik83@users.noreply.github.com> Date: Tue, 15 Sep 2020 13:00:38 +0200 Subject: [PATCH] fix slider handle_offset formula change : let handle_offset = (bounds.width - handle_width) * ((value - range_start) / (range_end - range_start).max(1.0)) to : let handle_offset = (bounds.width - handle_width) * ((value - range_start) / (range_end - range_start).max(f32::EPSILON)).max(0.0).min(1.0) --- graphics/src/widget/slider.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/graphics/src/widget/slider.rs b/graphics/src/widget/slider.rs index 9a4af9ac..87780d38 100644 --- a/graphics/src/widget/slider.rs +++ b/graphics/src/widget/slider.rs @@ -88,7 +88,7 @@ where }; let handle_offset = (bounds.width - handle_width) - * ((value - range_start) / (range_end - range_start).max(1.0)); + * ((value - range_start) / (range_end - range_start).max(f32::EPSILON)).max(0.0).min(1.0); let handle = Primitive::Quad { bounds: Rectangle {