pub enum SingleAxisScrollManager {
Horizontal(ScrollAlgorithm),
Vertical(ScrollAlgorithm),
}Expand description
Scroll manager for a single axis.
Variants§
Horizontal(ScrollAlgorithm)
Horizontal scrolling; vertical component of get_position is zero.
Vertical(ScrollAlgorithm)
Vertical scrolling; horizontal component of get_position is zero.
Implementations§
Source§impl SingleAxisScrollManager
impl SingleAxisScrollManager
Sourcepub fn direct_set_position(&mut self, position: f32)
pub fn direct_set_position(&mut self, position: f32)
Sets scroll position on the active axis.
Sourcepub fn update(&mut self, d_scroll: f32, dt: f32)
pub fn update(&mut self, d_scroll: f32, dt: f32)
Applies a scroll delta on the active axis for one frame.
Sourcepub fn get_position(&self) -> Vector2
pub fn get_position(&self) -> Vector2
Returns the current scroll offset; the inactive axis is 0.0.
Auto Trait Implementations§
impl Freeze for SingleAxisScrollManager
impl RefUnwindSafe for SingleAxisScrollManager
impl Send for SingleAxisScrollManager
impl Sync for SingleAxisScrollManager
impl Unpin for SingleAxisScrollManager
impl UnsafeUnpin for SingleAxisScrollManager
impl UnwindSafe for SingleAxisScrollManager
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