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)
This commit is contained in:
rubik83 2020-09-15 12:56:50 +02:00 committed by Héctor Ramón Jiménez
parent 1f7e8b7f3d
commit 9991a89428
1 changed files with 1 additions and 1 deletions

View File

@ -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 {