pub struct ScrollState { /* private fields */ }Expand description
Inertial scroll state (single axis Y).
Implementations§
Source§impl ScrollState
impl ScrollState
pub fn new() -> Self
pub fn set_viewport_height(&self, h: f32)
pub fn set_content_height(&self, h: f32)
pub fn set_offset(&self, off: f32)
pub fn get(&self) -> f32
Sourcepub fn scroll_immediate(&self, dy: f32) -> f32
pub fn scroll_immediate(&self, dy: f32) -> f32
Consume dy (pixels), clamp to bounds, return leftover.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for ScrollState
impl !RefUnwindSafe for ScrollState
impl !Send for ScrollState
impl !Sync for ScrollState
impl Unpin for ScrollState
impl !UnwindSafe for ScrollState
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