Remove special case for 0 in DragValue default formatter (#4639)

* Closes <https://github.com/emilk/egui/issues/4610>
This commit is contained in:
YgorSouza 2024-06-18 22:36:42 +02:00 committed by GitHub
parent 87021d3fbd
commit 3f53f1738b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 7 deletions

View File

@ -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();