pub struct SingleAxisScrollElementManager { /* private fields */ }Expand description
Per-element single-axis scroll manager with wheel, optional drag, and clamping.
Same wheel/drag/clamp behavior as DoubleAxisScrollElementManager, but
scrolls only the axis selected by manager.
Implementations§
Source§impl SingleAxisScrollElementManager
impl SingleAxisScrollElementManager
Sourcepub fn new(
manager: SingleAxisScrollManager,
id: ElementId,
child_elements: Vec<ElementId>,
button: Option<MouseButton>,
) -> Self
pub fn new( manager: SingleAxisScrollManager, id: ElementId, child_elements: Vec<ElementId>, button: Option<MouseButton>, ) -> Self
Creates a single-axis scroll manager for id.
Sourcepub fn update(&mut self, provider: &dyn FullElementScrollState, dt: f32)
pub fn update(&mut self, provider: &dyn FullElementScrollState, dt: f32)
Advances scroll state for one frame.
No-op when layout bounds or internal size are unavailable for id.
Sourcepub fn get_position(&self) -> Vector2
pub fn get_position(&self) -> Vector2
Returns the current clamped scroll offset.
Auto Trait Implementations§
impl Freeze for SingleAxisScrollElementManager
impl RefUnwindSafe for SingleAxisScrollElementManager
impl Send for SingleAxisScrollElementManager
impl Sync for SingleAxisScrollElementManager
impl Unpin for SingleAxisScrollElementManager
impl UnsafeUnpin for SingleAxisScrollElementManager
impl UnwindSafe for SingleAxisScrollElementManager
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