pub struct ScrollState {
pub scroll_position: LayoutPoint,
pub used_this_frame: bool,
}
Fields§
§scroll_position: LayoutPoint
Amount in pixel that the current node is scrolled
used_this_frame: bool
Was the scroll amount used in this frame?
Implementations§
Source§impl ScrollState
impl ScrollState
Sourcepub fn get(&self) -> LayoutPoint
pub fn get(&self) -> LayoutPoint
Return the current position of the scroll state
Sourcepub fn add(&mut self, x: f32, y: f32, child_rect: &LayoutRect)
pub fn add(&mut self, x: f32, y: f32, child_rect: &LayoutRect)
Add a scroll X / Y onto the existing scroll state
Sourcepub fn set(&mut self, x: f32, y: f32, child_rect: &LayoutRect)
pub fn set(&mut self, x: f32, y: f32, child_rect: &LayoutRect)
Set the scroll state to a new position
Sourcepub fn get_and_mark_as_used(&mut self) -> LayoutPoint
pub fn get_and_mark_as_used(&mut self) -> LayoutPoint
Returns the scroll position and also set the “used_this_frame” flag
Trait Implementations§
Source§impl Clone for ScrollState
impl Clone for ScrollState
Source§fn clone(&self) -> ScrollState
fn clone(&self) -> ScrollState
Returns a copy 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 ScrollState
impl Debug for ScrollState
Source§impl Default for ScrollState
impl Default for ScrollState
Source§impl PartialEq for ScrollState
impl PartialEq for ScrollState
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 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)