pub struct ScrollStates(pub FastHashMap<ExternalScrollId, ScrollState>);
Tuple Fields§
§0: FastHashMap<ExternalScrollId, ScrollState>
Implementations§
Source§impl ScrollStates
impl ScrollStates
pub fn new() -> ScrollStates
pub fn get_scroll_position( &self, scroll_id: &ExternalScrollId, ) -> Option<LayoutPoint>
Sourcepub fn set_scroll_position(
&mut self,
node: &OverflowingScrollNode,
scroll_position: LayoutPoint,
)
pub fn set_scroll_position( &mut self, node: &OverflowingScrollNode, scroll_position: LayoutPoint, )
Set the scroll amount - does not update the entry.used_this_frame
,
since that is only relevant when we are actually querying the renderer.
Sourcepub fn get_scroll_position_and_mark_as_used(
&mut self,
scroll_id: &ExternalScrollId,
) -> Option<LayoutPoint>
pub fn get_scroll_position_and_mark_as_used( &mut self, scroll_id: &ExternalScrollId, ) -> Option<LayoutPoint>
NOTE: This has to be a getter, because we need to update
Sourcepub fn scroll_node(
&mut self,
node: &OverflowingScrollNode,
scroll_by_x: f32,
scroll_by_y: f32,
)
pub fn scroll_node( &mut self, node: &OverflowingScrollNode, scroll_by_x: f32, scroll_by_y: f32, )
Updating (add to) the existing scroll amount does not update the entry.used_this_frame
,
since that is only relevant when we are actually querying the renderer.
Sourcepub fn remove_unused_scroll_states(&mut self)
pub fn remove_unused_scroll_states(&mut self)
Removes all scroll states that weren’t used in the last frame
Trait Implementations§
Source§impl Debug for ScrollStates
impl Debug for ScrollStates
Source§impl Default for ScrollStates
impl Default for ScrollStates
Source§fn default() -> ScrollStates
fn default() -> ScrollStates
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ScrollStates
impl RefUnwindSafe for ScrollStates
impl Send for ScrollStates
impl Sync for ScrollStates
impl Unpin for ScrollStates
impl UnwindSafe for ScrollStates
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