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 {