Skip to main content

Module scroll

Module scroll 

Source

Structs§

HorizontalScrollState
X-only state
ScrollAxisBinding
Callbacks for a single-axis (vertical or horizontal) scroll container.
ScrollBothBinding
Callbacks for a 2D (both-axis) scroll container.
ScrollPhysics
Handles velocity estimation from input deltas, frame-rate-independent exponential decay, edge snapping, and animation state tracking.
ScrollState
Inertial scroll state (single axis Y).
ScrollStateXY
2D state
ScrollbarStyle

Enums§

ScrollAxis
Axis (or axes) a scroll modifier operates on.
ScrollBinding

Constants§

SCROLL_DECAY_PER_60HZ
Per-60Hz-frame velocity decay at low speed. Higher stops the fling sooner.
SCROLL_FLING_ACTIVATE_VELOCITY
A gesture must exceed this speed (px/s) to leave a fling behind.
SCROLL_OVERSROLL_BAND_MAX
Rubber-band asymptote: overscroll never stretches past this many px.
SCROLL_STOP_VELOCITY
Fling is abandoned once speed falls below this (px/s).

Functions§

os_scroll_axis
Fold leftover into one axis’s rubber band after the nested parent chain has declined it. Returns whatever is still unconsumed.
rubber_band
Asymptotic rubber band: never reaches max, so pulling harder always moves a little more without ever running away.
run_post_scroll
run_pre_scroll
tick_os_axis
Decay one axis’s rubber band back to rest. Returns true while it is active.