#[repr(C)]pub struct ScrollPhysics {
pub smooth_scroll_duration_ms: u32,
pub deceleration_rate: f32,
pub min_velocity_threshold: f32,
pub max_velocity: f32,
pub wheel_multiplier: f32,
pub invert_direction: bool,
pub overscroll_elasticity: f32,
pub max_overscroll_distance: f32,
pub bounce_back_duration_ms: u32,
}Expand description
Scroll physics configuration for momentum scrolling
This controls how scrolling feels - the “weight” and “friction” of the scroll. Different platforms have different scroll physics (iOS vs Android vs Windows).
Fields§
§smooth_scroll_duration_ms: u32Smooth scroll animation duration in milliseconds (default: 300ms) Only used when scroll-behavior: smooth
deceleration_rate: f32Deceleration rate for momentum scrolling (0.0 = instant stop, 1.0 = never stops) Typical values: 0.95 (fast deceleration) to 0.998 (slow, iOS-like) Default: 0.95
min_velocity_threshold: f32Minimum velocity threshold to start momentum scrolling (pixels/second) Below this, scrolling stops immediately. Default: 50.0
max_velocity: f32Maximum scroll velocity (pixels/second). Default: 8000.0
wheel_multiplier: f32Scroll wheel multiplier. Default: 1.0 Values > 1.0 make scrolling faster, < 1.0 slower
invert_direction: boolWhether to invert scroll direction (natural scrolling). Default: false
overscroll_elasticity: f32Overscroll elasticity (0.0 = no bounce, 1.0 = full bounce like iOS) Only applies when overscroll-behavior: auto. Default: 0.0 (no bounce)
max_overscroll_distance: f32Maximum overscroll distance in pixels before rubber-banding stops Default: 100.0
bounce_back_duration_ms: u32Bounce-back duration when releasing overscroll (milliseconds) Default: 400
Implementations§
Source§impl ScrollPhysics
impl ScrollPhysics
Trait Implementations§
Source§impl Clone for ScrollPhysics
impl Clone for ScrollPhysics
Source§fn clone(&self) -> ScrollPhysics
fn clone(&self) -> ScrollPhysics
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more