Remove special case for 0 in DragValue default formatter (#4639)
* Closes <https://github.com/emilk/egui/issues/4610>
This commit is contained in:
parent
87021d3fbd
commit
3f53f1738b
|
|
@ -452,13 +452,7 @@ impl<'a> Widget for DragValue<'a> {
|
|||
|
||||
let value_text = match custom_formatter {
|
||||
Some(custom_formatter) => custom_formatter(value, auto_decimals..=max_decimals),
|
||||
None => {
|
||||
if value == 0.0 {
|
||||
"0".to_owned()
|
||||
} else {
|
||||
emath::format_with_decimals_in_range(value, auto_decimals..=max_decimals)
|
||||
}
|
||||
}
|
||||
None => emath::format_with_decimals_in_range(value, auto_decimals..=max_decimals),
|
||||
};
|
||||
|
||||
let text_style = ui.style().drag_value_text_style.clone();
|
||||
|
|
|
|||
Loading…
Reference in New Issue