pub struct AnimatedScrollState {
pub current_offset: LogicalPosition,
pub animation: Option<ScrollAnimation>,
pub last_activity: Instant,
pub container_rect: LogicalRect,
pub content_rect: LogicalRect,
pub virtual_scroll_size: Option<LogicalSize>,
pub virtual_scroll_offset: Option<LogicalPosition>,
pub overscroll_behavior_x: OverscrollBehavior,
pub overscroll_behavior_y: OverscrollBehavior,
pub overflow_scrolling: OverflowScrolling,
}Expand description
The complete scroll state for a single node (with animation support)
Fields§
§current_offset: LogicalPositionCurrent scroll offset (live, may be animating)
animation: Option<ScrollAnimation>Ongoing smooth scroll animation, if any
last_activity: InstantLast time scroll activity occurred (for fading scrollbars)
container_rect: LogicalRectBounds of the scrollable container
content_rect: LogicalRectBounds of the total content (for calculating scroll limits)
virtual_scroll_size: Option<LogicalSize>Virtual scroll size from IFrame callback (if this node hosts an IFrame). When set, clamp logic uses this instead of content_rect for max scroll bounds.
virtual_scroll_offset: Option<LogicalPosition>Virtual scroll offset from IFrame callback
overscroll_behavior_x: OverscrollBehaviorPer-node overscroll behavior for X axis (from CSS overscroll-behavior-x)
overscroll_behavior_y: OverscrollBehaviorPer-node overscroll behavior for Y axis (from CSS overscroll-behavior-y)
overflow_scrolling: OverflowScrollingPer-node overflow scrolling mode (from CSS -azul-overflow-scrolling)
Implementations§
Source§impl AnimatedScrollState
impl AnimatedScrollState
Sourcepub fn clamp(&self, position: LogicalPosition) -> LogicalPosition
pub fn clamp(&self, position: LogicalPosition) -> LogicalPosition
Clamp a scroll position to valid bounds (0 to max_scroll).
When virtual_scroll_size is set (for IFrame nodes), the max bounds
are computed from the virtual size instead of content_rect.
Trait Implementations§
Source§impl Clone for AnimatedScrollState
impl Clone for AnimatedScrollState
Source§fn clone(&self) -> AnimatedScrollState
fn clone(&self) -> AnimatedScrollState
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for AnimatedScrollState
impl RefUnwindSafe for AnimatedScrollState
impl Send for AnimatedScrollState
impl Sync for AnimatedScrollState
impl Unpin for AnimatedScrollState
impl UnsafeUnpin for AnimatedScrollState
impl UnwindSafe for AnimatedScrollState
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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