pub struct ScrollStates(pub FastHashMap<ExternalScrollId, ScrollState>);Tuple Fields§
§0: FastHashMap<ExternalScrollId, ScrollState>Implementations§
Source§impl ScrollStates
impl ScrollStates
Sourcepub fn should_scroll_render(
&mut self,
(scroll_x, scroll_y): &(f32, f32),
hit_test: &FullHitTest,
) -> bool
pub fn should_scroll_render( &mut self, (scroll_x, scroll_y): &(f32, f32), hit_test: &FullHitTest, ) -> bool
Special rendering function that skips building a layout and only does hit-testing and rendering - called on pure scroll events, since it’s significantly less CPU-intensive to just render the last display list instead of re-layouting on every single scroll event.
pub fn new() -> ScrollStates
pub fn get_scroll_position( &self, scroll_id: &ExternalScrollId, ) -> Option<LogicalPosition>
Sourcepub fn set_scroll_position(
&mut self,
node: &OverflowingScrollNode,
scroll_position: LogicalPosition,
)
pub fn set_scroll_position( &mut self, node: &OverflowingScrollNode, scroll_position: LogicalPosition, )
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 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.
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more