Skip to main content

Module scroll

Module scroll 

Source
Expand description

Wheel and drag scrolling with optional momentum.

Low-level scroll algorithms (MomentumScroller, HardScroller) accumulate per-axis offsets. Element managers combine wheel input, optional mouse drag, and layout bounds to produce clamped scroll positions.

Scroll positions use 0.0 when content is aligned to the top-left of the clip region. Scrolling content up or left produces negative values. Valid range per axis is [−limits, 0] where limits = (internal_size − bound_size).max(0).

Layout bounds come from cotis_utils::element_state::ElementBoundingBox and internal content size from cotis_utils::element_state::ElementClipInternalSize.

Structs§

DoubleAxisScrollElementManager
Per-element two-axis scroll manager with wheel, optional drag, and clamping.
DoubleAxisScrollManager
Independent scroll algorithms for horizontal ([0]) and vertical ([1]) axes.
HardScroller
Direct scroll offset without momentum.
MomentumScroller
Scroll offset with velocity-based momentum and frame-rate-independent friction.
SingleAxisScrollElementManager
Per-element single-axis scroll manager with wheel, optional drag, and clamping.

Enums§

ScrollAlgorithm
Per-axis scroll algorithm wrapper.
SingleAxisScrollManager
Scroll manager for a single axis.

Traits§

FullElementScrollState
Combines cursor state, wheel input, and layout bounds for element scrolling.