Skip to main content

Module virtual_viewport

Module virtual_viewport 

Expand description

Shared one-dimensional virtualization geometry for lists, trees, and tables.

VirtualViewport keeps stable item keys, lazily measured heights, a Fenwick prefix-sum index, and the scroll position in one place. Collection widgets use it for four operations that must agree exactly: visible-range calculation, row placement, hit testing, and scrollbar metrics.

Reconciliation is anchor-preserving. Inserting, removing, or resizing rows above the first visible item does not move the content under the user’s eyes. Measured heights follow stable keys across moves; unseen rows retain the configured estimate until measured.

Structs§

DragScrollFinish
Result of releasing a pointer tracked by DragScroller.
DragScrollUpdate
Result of moving a pointer tracked by DragScroller.
DragScroller
Thresholded, single-axis pointer panning shared by virtual collections. A press remains a click until it moves four logical pixels; once active, offset and release velocity are derived from the same pointer samples.
KineticSampler
Release-velocity estimator for continuous (pixel) scrolling.
ScrollMomentum
Deterministic single-axis momentum used by virtualized collection widgets. Wheel input moves immediately; line-wheel impulses additionally feed this decay curve so detented wheels can traverse long collections without requiring one event per row.
SparseAnchor
Stable scroll anchor captured from a model-resolved sparse viewport.
SparseVirtualViewport
Virtual geometry for collections whose logical item count is much larger than the set of resident keys.
VirtualViewport
Variable-height virtual collection geometry, keyed by model identity.

Enums§

ReconcileError
A key appeared more than once in a reconciliation input.
ScrollAlignment
Where an item should land when explicitly scrolled into view.
WheelStep
What a vertical collection should do with one wheel event, decided by ScrollMomentum::wheel.