Add `Slider::max_decimals_opt` (#4953)
As mentioned in #4950 I added `max_decimals_opt` to the Slider * Closes <https://github.com/emilk/egui/issues/4950> * [x] I have followed the instructions in the PR template * [x] I ran the script in `scripts/check.sh`
This commit is contained in:
parent
9f2f5f7292
commit
5a1ab9b2b8
|
|
@ -279,6 +279,12 @@ impl<'a> Slider<'a> {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline]
|
||||||
|
pub fn max_decimals_opt(mut self, max_decimals: Option<usize>) -> Self {
|
||||||
|
self.max_decimals = max_decimals;
|
||||||
|
self
|
||||||
|
}
|
||||||
|
|
||||||
/// Set an exact number of decimals to display.
|
/// Set an exact number of decimals to display.
|
||||||
///
|
///
|
||||||
/// Values will also be rounded to this number of decimals.
|
/// Values will also be rounded to this number of decimals.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue