mirror of
https://github.com/emilk/egui.git
synced 2026-06-26 22:53:14 -04:00
[slider] Add Slider::u32
This commit is contained in:
@@ -113,6 +113,18 @@ impl<'a> Slider<'a> {
|
||||
.integer()
|
||||
}
|
||||
|
||||
pub fn u32(value: &'a mut u32, range: RangeInclusive<u32>) -> Self {
|
||||
Self {
|
||||
..Self::from_get_set(to_f64_range(range), move |v: Option<f64>| {
|
||||
if let Some(v) = v {
|
||||
*value = v.round() as u32
|
||||
}
|
||||
*value as f64
|
||||
})
|
||||
}
|
||||
.integer()
|
||||
}
|
||||
|
||||
pub fn usize(value: &'a mut usize, range: RangeInclusive<usize>) -> Self {
|
||||
let range = (*range.start() as f64)..=(*range.end() as f64);
|
||||
Self {
|
||||
|
||||
Reference in New Issue
Block a user