Stop keeping what nothing reads back
`ActiveData::size_deps` was written on every draw, cleared on every undraw, and read nowhere: a `Vec<WidgetId>` 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 <noreply@anthropic.com>
This commit is contained in:
1 parent
1ebd4d3a05
commit
aea0387567
3 files changed
-13
No files matched your search
@@ -51,8 +51,6 @@ pub struct ActiveData {
|
||||
/// An owned mask holds one reference independently of its primitives.
|
||||
pub mask_region: Option<UiRegion>,
|
||||
pub children: Vec<WidgetId>,
|
||||
/// The children whose size this widget read while drawing.
|
||||
pub size_deps: Vec<WidgetId>,
|
||||
/// The movable region its primitives are positioned through: its own when
|
||||
/// opted in, otherwise the nearest ancestor's.
|
||||
pub move_idx: MoveIdx,
|
||||
|
||||
@@ -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),
|
||||
|
||||
Reference in new issue
Block a user