mirror of
https://github.com/emilk/egui.git
synced 2026-09-02 23:00:04 -04:00
Remove special case for 0 in DragValue default formatter (#4639)
* Closes <https://github.com/emilk/egui/issues/4610>
This commit is contained in:
@@ -452,13 +452,7 @@ impl<'a> Widget for DragValue<'a> {
|
|||||||
|
|
||||||
let value_text = match custom_formatter {
|
let value_text = match custom_formatter {
|
||||||
Some(custom_formatter) => custom_formatter(value, auto_decimals..=max_decimals),
|
Some(custom_formatter) => custom_formatter(value, auto_decimals..=max_decimals),
|
||||||
None => {
|
None => emath::format_with_decimals_in_range(value, auto_decimals..=max_decimals),
|
||||||
if value == 0.0 {
|
|
||||||
"0".to_owned()
|
|
||||||
} else {
|
|
||||||
emath::format_with_decimals_in_range(value, auto_decimals..=max_decimals)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
let text_style = ui.style().drag_value_text_style.clone();
|
let text_style = ui.style().drag_value_text_style.clone();
|
||||||
|
|||||||
Reference in New Issue
Block a user