pub struct AnimatedScrollState {Show 14 fields
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,
pub scrollbar_thickness: f32,
pub visual_width_px: f32,
pub has_horizontal_scrollbar: bool,
pub has_vertical_scrollbar: bool,
}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 VirtualView callback (if this node hosts a VirtualView). When set, clamp logic uses this instead of content_rect for max scroll bounds.
virtual_scroll_offset: Option<LogicalPosition>Virtual scroll offset from VirtualView 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)
scrollbar_thickness: f32CSS-resolved scrollbar thickness (from scrollbar-width property).
Used for rendering and hit-testing. Defaults to 16.0 if not set.
visual_width_px: f32Visual rendering width in CSS pixels (e.g. 8.0 for thin overlay). Non-zero even for overlay scrollbars. Falls back to scrollbar_thickness if 0.
has_horizontal_scrollbar: boolWhether this node also needs a horizontal scrollbar (affects vertical geometry)
has_vertical_scrollbar: boolWhether this node also needs a vertical scrollbar (affects horizontal geometry)
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 VirtualView 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 (const: unstable) · 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