From 9991a894286a52dc81c1f8e449a64395bbe5b5fe Mon Sep 17 00:00:00 2001 From: rubik83 <45452623+rubik83@users.noreply.github.com> Date: Tue, 15 Sep 2020 12:56:50 +0200 Subject: [PATCH] fix active_progress_width formula change : let active_progress_width = bounds.width * ((value - range_start) / (range_end - range_start).max(1.0)) to : let active_progress_width = bounds.width * ((value - range_start) / (range_end - range_start).max(f32::EPSILON)).max(0.0).min(1.0) --- graphics/src/widget/progress_bar.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/graphics/src/widget/progress_bar.rs b/graphics/src/widget/progress_bar.rs index 932f4fc2..4105a1aa 100644 --- a/graphics/src/widget/progress_bar.rs +++ b/graphics/src/widget/progress_bar.rs @@ -34,7 +34,7 @@ where let (range_start, range_end) = range.into_inner(); let active_progress_width = bounds.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 background = Primitive::Group { primitives: vec![Primitive::Quad {