Skip to main content

ScrollPhysics

Struct ScrollPhysics 

Source
pub struct ScrollPhysics {
    pub boundary: ScrollBoundaryMode,
    pub snap_mode: ScrollSnapMode,
    pub snap_extent: f32,
    pub deceleration_per_ms: f32,
    pub spring_omega: f32,
    pub wheel_smooth_tau: f32,
}
Expand description

Optional per-container scroll physics overrides (nv.scroll_physics, sparse, 0 B when absent).

Attach via nv_table: on any scroll container (VirtualList, paging carousel, bottom sheet) to customize bounce, snapping, deceleration, return spring stiffness, or smooth-wheel easing independently from ancestor containers.

Fields§

§boundary: ScrollBoundaryMode

Boundary resistance override (Inherit | Clamp | Bounce).

§snap_mode: ScrollSnapMode

Snap-point mode override (Inherit | None | Page | FixedExtent).

§snap_extent: f32

Item extent in logical px for ScrollSnapMode::FixedExtent (<= 0.0 = inherit/viewport).

§deceleration_per_ms: f32

Per-millisecond momentum deceleration factor in (0.0, 1.0) (<= 0.0 = inherit).

§spring_omega: f32

Critically-damped return/snap spring angular frequency in rad/s (<= 0.0 = inherit).

§wheel_smooth_tau: f32

Smooth-wheel exponential easing time constant in seconds (< 0.0 = inherit; 0.0 = instant).

Implementations§

Source§

impl ScrollPhysics

Source

pub const KEY: TableKey

Stable table key (xxh64 of the table name).

Source

pub const BOUNDARY: Prop<ScrollPhysics, ScrollBoundaryMode>

Boundary resistance override (Inherit | Clamp | Bounce).

Source

pub const SNAP_MODE: Prop<ScrollPhysics, ScrollSnapMode>

Snap-point mode override (Inherit | None | Page | FixedExtent).

Source

pub const SNAP_EXTENT: Prop<ScrollPhysics, f32>

Item extent in logical px for ScrollSnapMode::FixedExtent (<= 0.0 = inherit/viewport).

Source

pub const DECELERATION_PER_MS: Prop<ScrollPhysics, f32>

Per-millisecond momentum deceleration factor in (0.0, 1.0) (<= 0.0 = inherit).

Source

pub const SPRING_OMEGA: Prop<ScrollPhysics, f32>

Critically-damped return/snap spring angular frequency in rad/s (<= 0.0 = inherit).

Source

pub const WHEEL_SMOOTH_TAU: Prop<ScrollPhysics, f32>

Smooth-wheel exponential easing time constant in seconds (< 0.0 = inherit; 0.0 = instant).

Trait Implementations§

Source§

impl NvTable for ScrollPhysics

Source§

const DESC: TableDesc

Source§

type Ref<'a> = ScrollPhysicsRef<'a>

Zero-copy typed row reader tied to the borrowing NodeStore’s lifetime.
Source§

type Mut<'a> = ScrollPhysicsMut<'a>

Fluent typed row writer.
Source§

fn slot() -> TableSlot

Process-local slot, registered on first use.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.