#[repr(C)]pub struct ScrollState {
pub scroll_position: LogicalPosition,
}Expand description
Current scroll position for a single scroll frame.
Fields§
§scroll_position: LogicalPositionAmount in pixel that the current node is scrolled
Implementations§
Source§impl ScrollState
impl ScrollState
Sourcepub fn get(&self) -> LogicalPosition
pub fn get(&self) -> LogicalPosition
Return the current position of the scroll state
Sourcepub fn add(&mut self, x: f32, y: f32, child_rect: &LogicalRect)
pub fn add(&mut self, x: f32, y: f32, child_rect: &LogicalRect)
Add a scroll X / Y onto the existing scroll state
Sourcepub fn set(&mut self, x: f32, y: f32, child_rect: &LogicalRect)
pub fn set(&mut self, x: f32, y: f32, child_rect: &LogicalRect)
Set the scroll state to a new position
Trait Implementations§
Source§impl Clone for ScrollState
impl Clone for ScrollState
Source§fn clone(&self) -> ScrollState
fn clone(&self) -> ScrollState
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 ScrollState
impl Debug for ScrollState
Source§impl Default for ScrollState
impl Default for ScrollState
Source§impl PartialEq for ScrollState
impl PartialEq for ScrollState
Source§fn eq(&self, other: &ScrollState) -> bool
fn eq(&self, other: &ScrollState) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for ScrollState
impl PartialOrd for ScrollState
impl Copy for ScrollState
impl StructuralPartialEq for ScrollState
Auto Trait Implementations§
impl Freeze for ScrollState
impl RefUnwindSafe for ScrollState
impl Send for ScrollState
impl Sync for ScrollState
impl Unpin for ScrollState
impl UnsafeUnpin 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