pub struct ElasticSlider {
pub value: f32,
pub min: f32,
pub max: f32,
pub step: f32,
pub max_overflow: f32,
/* private fields */
}Expand description
Elastic slider state
Computes slider value with elastic overflow when dragging beyond bounds.
Fields§
§value: f32Current slider value (clamped to min..max when not dragging)
min: f32Minimum value
max: f32Maximum value
step: f32Step size for discrete values (0.0 = continuous)
max_overflow: f32Maximum overflow distance in pixels before full saturation
Implementations§
Source§impl ElasticSlider
impl ElasticSlider
Sourcepub fn new(min: f32, max: f32) -> Self
pub fn new(min: f32, max: f32) -> Self
Create a new elastic slider with given min and max values
Sourcepub fn with_max_overflow(self, max_overflow: f32) -> Self
pub fn with_max_overflow(self, max_overflow: f32) -> Self
Set maximum overflow distance
Sourcepub fn update_from_pointer(&mut self, pointer_x: f32, slider_width: f32)
pub fn update_from_pointer(&mut self, pointer_x: f32, slider_width: f32)
Update slider value from pointer position
§Arguments
pointer_x- Pointer X position relative to slider left edgeslider_width- Total width of slider in pixels
Sourcepub fn release(&mut self, current_time: f64)
pub fn release(&mut self, current_time: f64)
Release pointer - start spring snap-back animation
Sourcepub fn overflow_region(&self) -> OverflowRegion
pub fn overflow_region(&self) -> OverflowRegion
Get overflow region
Sourcepub fn fill_percentage(&self) -> f32
pub fn fill_percentage(&self) -> f32
Calculate fill percentage (0.0 to 1.0)
Trait Implementations§
Source§impl Clone for ElasticSlider
impl Clone for ElasticSlider
Source§fn clone(&self) -> ElasticSlider
fn clone(&self) -> ElasticSlider
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ElasticSlider
impl Debug for ElasticSlider
Auto Trait Implementations§
impl Freeze for ElasticSlider
impl RefUnwindSafe for ElasticSlider
impl Send for ElasticSlider
impl Sync for ElasticSlider
impl Unpin for ElasticSlider
impl UnsafeUnpin for ElasticSlider
impl UnwindSafe for ElasticSlider
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more