Skip to content

Commit

Permalink
Remove special case for 0 in DragValue default formatter (#4639)
Browse files Browse the repository at this point in the history
* Closes <#4610>
  • Loading branch information
YgorSouza authored Jun 18, 2024
1 parent 87021d3 commit 3f53f17
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions crates/egui/src/widgets/drag_value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 3f53f17

Please sign in to comment.