Expand description
Persistent render tree — the single owner of per-node retained state (D091).
Every widget position gets a node. During paint a widget declares its interactive regions and attachments onto its node; the frame pipeline then derives hit-test order, scroll routing, the overlay stack, focus order, and transform layers from the tree. Nothing is re-emitted per frame through side channels, so state survives cache-hit frames by construction.
§Identity
A node’s identity is its position within its parent’s paint order. This is safe because widget paint recursion always descends fully once entered — only the element walker may skip a subtree (picture cache hit), and it consumes the child slot without resetting it, keeping siblings aligned and the skipped subtree’s state intact.
The one place positional identity is NOT safe: ScreenTransitionView
(screen_transition_view.rs), where the exact same tree position holds a
completely different, unrelated screen’s subtree every time navigation
changes. Positional reuse there silently aliased one screen’s scroll
offset/animation state onto the next screen that happened to land on the
same NodeId (2026-08-01, real trackpad + navigation testing). Its child
is addressed through RenderTree::keyed_slot instead of the ordinary
RenderTree::slot — a small, explicitly-keyed side table scoped to
that one call site, not a general per-widget keying system.
Structs§
- Inspect
Node - One node in an
RenderTree::inspectsnapshot — plain data only. - Render
Tree - Arena-allocated persistent render tree. Node 0 is always the root.
- Scroll
Axes - Which wheel/trackpad axes a scroll region can consume. Routing prefers the innermost region that handles the DOMINANT axis of a delta — an x-only carousel must not swallow a vertical page scroll.
- Tree
Node - One render-tree node. Declared data is cleared when the node is repainted
(
begin) and persists untouched otherwise.
Functions§
- select_
scroll_ handler - Shared axis-preference selection (also used for overlay scroll routes): first candidate handling the dominant delta axis, else first handling the other axis.
Type Aliases§
- HitHandler
- A resolved hit/scroll handler — invoked with the event’s (x, y) in window-space logical pixels.
- HitRegion
- A click callback with its hit rect in window-space logical pixels.
- HitRegion
At - A positional click callback — receives the click point in window-space logical pixels (sliders, color pickers, canvases).
- NodeId
- Scroll
Handler - A nested-scroll chain link (D-NESTED-SCROLL, 2026-08-02) — takes a
(dx, dy)DELTA (not an absolute position, unlikeHitHandler) and returns whether it actually moved:trueif it consumed some or all of the delta,falseif it’s already fully exhausted in that exact direction (hard-clamped, or stretched toBounce’s own overscroll limit) and had NO effect. A gesture starting inside nested scrollable regions (an innerScrollView/carousel sitting inside an outer one, or a plain-hitButton/ListTilesitting inside anyScrollView) tries the innermost link first each move and only offers the SAME delta to the next link outward once the current one declines — so scrolling naturally “hands off” to an enclosing scrollable ancestor exactly when, and only when, the inner one has nothing left to give. - Scroll
Region - A
(delta_x, delta_y)scroll callback with its viewport rect and the axes it handles. - Zoom
Region - A registered pinch-to-zoom region (
InteractiveViewer, Phase 32) — the callback receives the gesture’sdelta(winit’sPinchGesture::delta: positive = magnify, negative = shrink; NOT a multiplier, an increment — callers typically dozoom *= 1.0 + delta).