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)
This commit is contained in:
parent
9991a89428
commit
955b62ea2d
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue