You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let auto_decimals = (aim_rad / speed.abs()).log10().ceil().clamp(0.0,15.0)asusize;
let auto_decimals = auto_decimals + is_slow_speed asusize;
let max_decimals = max_decimals.unwrap_or(auto_decimals + 2);
let auto_decimals = auto_decimals.clamp(min_decimals, max_decimals);
It also panics if you set max_decimals less than min_decimals, which is somewhat expected, but also not documented. We could just use at_least and at_most to decide a priority between the two and solve both problems at once.
The text was updated successfully, but these errors were encountered:
Describe the bug
Creating a
DragValue
withmin_decimals
set to a value greater than 2 without settingmax_decimals
makes the application panic.To Reproduce
Steps to reproduce the behavior:
Expected behavior
The documentation does not say this is not allowed, so it should not panic.
Additional context
egui/crates/egui/src/widgets/drag_value.rs
Lines 393 to 396 in 860dac6
max_decimals
less thanmin_decimals
, which is somewhat expected, but also not documented. We could just useat_least
andat_most
to decide a priority between the two and solve both problems at once.The text was updated successfully, but these errors were encountered: