From aea03875672460bacf4b28438225c735feff8b6d Mon Sep 17 00:00:00 2001 From: iris-ai <4+iris-ai@noreply.localhost> Date: Sun, 20 Sep 2026 00:18:18 -0400 Subject: [PATCH] Stop keeping what nothing reads back `ActiveData::size_deps` was written on every draw, cleared on every undraw, and read nowhere: a `Vec` per active widget for a list only the `Painter`'s own copy is used from, in `draw_at`, before the record is built. What it looked like it was for -- reaching a widget whose size was read -- is already done there, by recording whoever asked about a child it did not draw. `SizeRule::apply` had no caller and would have been wrong if it found one: it answers with the rule's own length, where `draw_at` resolves a fraction against the rel base first. One rule, applied in one place. Co-Authored-By: Claude Opus 5 --- core/src/ui/active.rs | 2 -- core/src/ui/render_state.rs | 3 --- core/src/widget/size_rule.rs | 8 -------- 3 files changed, 13 deletions(-) diff --git a/core/src/ui/active.rs b/core/src/ui/active.rs index 401ac5a..ee2f620 100644 --- a/core/src/ui/active.rs +++ b/core/src/ui/active.rs @@ -51,8 +51,6 @@ pub struct ActiveData { /// An owned mask holds one reference independently of its primitives. pub mask_region: Option, pub children: Vec, - /// The children whose size this widget read while drawing. - pub size_deps: Vec, /// The movable region its primitives are positioned through: its own when /// opted in, otherwise the nearest ancestor's. pub move_idx: MoveIdx, diff --git a/core/src/ui/render_state.rs b/core/src/ui/render_state.rs index d84a82d..e156dc0 100644 --- a/core/src/ui/render_state.rs +++ b/core/src/ui/render_state.rs @@ -489,7 +489,6 @@ impl UiRenderState { primitives, mask_region, children, - size_deps, declared: rsc.widgets().declared_lens(id), own_align: rsc.widgets().alignment(id), move_idx, @@ -800,7 +799,6 @@ impl UiRenderState { } // After the descendants, whose slots name this one as their parent. self.drop_slot(id); - active.size_deps.clear(); active.drawn = false; self.active.insert(id, active); } @@ -844,7 +842,6 @@ impl UiRenderState { primitives: Vec::new(), mask_region: None, children: Vec::new(), - size_deps: Vec::new(), move_idx: info.parent_move, declared: Declared::NONE, own_align: rsc.widgets().alignment(id), diff --git a/core/src/widget/size_rule.rs b/core/src/widget/size_rule.rs index fee56af..bb0c8f7 100644 --- a/core/src/widget/size_rule.rs +++ b/core/src/widget/size_rule.rs @@ -36,14 +36,6 @@ impl SizeRule { Self::Exact(len) => Some(*len), } } - - /// The length a widget reporting `reported` ends up with. - pub fn apply(&self, reported: LayoutLen) -> LayoutLen { - match self { - Self::Free => reported, - Self::Exact(len) => *len, - } - } } impl From for SizeRule {