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§
- Drag
Scroll Finish - Result of releasing a pointer tracked by
DragScroller. - Drag
Scroll Update - Result of moving a pointer tracked by
DragScroller. - Drag
Scroller - 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.
- Kinetic
Sampler - Release-velocity estimator for continuous (pixel) scrolling.
- Scroll
Momentum - 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.
- Sparse
Anchor - Stable scroll anchor captured from a model-resolved sparse viewport.
- Sparse
Virtual Viewport - Virtual geometry for collections whose logical item count is much larger than the set of resident keys.
- Virtual
Viewport - Variable-height virtual collection geometry, keyed by model identity.
Enums§
- Reconcile
Error - A key appeared more than once in a reconciliation input.
- Scroll
Alignment - Where an item should land when explicitly scrolled into view.
- Wheel
Step - What a vertical collection should do with one wheel event, decided by
ScrollMomentum::wheel.