pub struct TreeNode {Show 28 fields
pub children: Vec<NodeId>,
pub keyed_children: HashMap<u64, NodeId>,
pub hits: Vec<HitRegion>,
pub hits_at: Vec<HitRegionAt>,
pub nested_scrolls: Vec<(Rect, ScrollHandler)>,
pub scrolls: Vec<ScrollRegion>,
pub zooms: Vec<ZoomRegion>,
pub focus: Vec<FocusNode>,
pub overlays: Vec<OverlayEntry>,
pub transforms: Vec<TransformLayerEntry>,
pub semantics: Vec<Semantics>,
pub editable: Option<EditableDecl>,
pub scroll_ctrl: Option<ScrollController>,
pub anim: Option<f32>,
pub anim_channels: Vec<Option<f32>>,
pub focus_node: Option<FocusNode>,
pub text_edit: TextEditState,
pub tag: &'static str,
pub last_constraints: Option<Constraints>,
pub cached_size: Option<Size>,
pub cached_picture: Option<Arc<Picture>>,
pub cached_rect: Option<Rect>,
pub paint_dirty: bool,
pub hovered: bool,
pub pressed: bool,
pub pointer_mode: u8,
pub hover_regions: Vec<Rect>,
pub long_hits: Vec<HitRegion>,
/* private fields */
}Expand description
One render-tree node. Declared data is cleared when the node is repainted
(begin) and persists untouched otherwise.
Fields§
§children: Vec<NodeId>§keyed_children: HashMap<u64, NodeId>Children addressed by RenderTree::keyed_slot instead of position
— see the module doc’s “Identity” section. Only ScreenTransitionView
(screen_transition_view.rs) uses this; every other widget’s children
live in children/cursor above, untouched.
hits: Vec<HitRegion>§hits_at: Vec<HitRegionAt>§nested_scrolls: Vec<(Rect, ScrollHandler)>Nested-scroll chain links declared this node (D-NESTED-SCROLL) —
see ScrollHandler’s own doc. Separate from hits_at: a plain
slider-style positional drag always fully “consumes” a gesture by
definition, but a ScrollView’s pan needs to report exhaustion so
an enclosing scrollable ancestor gets a turn.
scrolls: Vec<ScrollRegion>§zooms: Vec<ZoomRegion>§focus: Vec<FocusNode>§overlays: Vec<OverlayEntry>§transforms: Vec<TransformLayerEntry>§semantics: Vec<Semantics>§editable: Option<EditableDecl>Editable text content declared this paint (D112/Phase 28 Step 1) —
current value, rect, and the on_change callback. Cleared each
repaint like hits/scrolls; the engine’s key/click dispatch
reads it fresh rather than caching, since a rebuild may swap in a
different on_change closure.
scroll_ctrl: Option<ScrollController>The node’s implicit scroll position (D101) — created lazily by the first scrollable painted at this position, survives rebuilds like Flutter’s ScrollPosition.
anim: Option<f32>A persistent eased scalar (0..1) for toggle transitions — advanced by
PaintCtx::animate_to. None until first observed (then snaps).
anim_channels: Vec<Option<f32>>Multiple independent persistent eased scalars for a widget that needs
to animate more than one value at once (e.g. a Switch’s position AND
its hover/press state-layer) — advanced by PaintCtx::animate_channel,
indexed by an explicit channel id. Each entry is None until first
observed (then snaps), exactly like anim. Grows on demand; persists
across repaints and cache-hit frames like the other retained state.
focus_node: Option<FocusNode>This node’s rosace_a11y::FocusNode (D112/Phase 28 Step 1) —
created lazily by super::PaintCtx::focus_node, survives
rebuilds like scroll_ctrl above.
text_edit: TextEditStatePersistent cursor/selection state for an editable node (D091/D112) — NOT cleared on repaint, so the caret survives a rebuild with the same displayed value.
tag: &'static strWidget type name at this position; a mismatch resets the caches.
last_constraints: Option<Constraints>Constraints used for the last successful layout pass.
cached_size: Option<Size>Size returned by the last layout pass.
cached_picture: Option<Arc<Picture>>Display list from the last paint pass.
cached_rect: Option<Rect>World-space rect of the last paint (also the damage extent).
paint_dirty: boolWhen true, the subtree must re-layout/re-paint this frame.
hovered: boolTrue while the cursor is over this node’s hit/hover region.
pressed: boolTrue from MouseDown until MouseUp on this node — drives press/tap
feedback (D108/Phase 26 Step 1), same dispatcher-owned shape as
hovered.
pointer_mode: u8Pointer interception: 1 = ignore (subtree transparent to hits), 2 = absorb (consume everything in rect). Declared per paint.
hover_regions: Vec<Rect>Hover-only regions (tooltips) — participate in hover_test but not in click dispatch.
long_hits: Vec<HitRegion>Long-press callbacks with their rects.