Retain frame and extent dependencies independently
Keep the original measurement placement separate from the assigned slot.
Validate frame and extent lengths before reusing an answer or drawing, and
represent hint-only records as having no measured answer.
Retain primitive and mask coordinates with their frame/extent reference.
Forwarded children follow a reused wrapper's placement without rerunning
valid draw bodies. Keep the single Widget::draw API.
Restore the eight failing suite cases from the region/placement prototype,
with regressions for mixed coordinate references, a changed inherited
extent, the sizing-stack fraction, and an undrawn share becoming visible.
This remains experimental: nested container updates do substantially more
work than e44dea3 despite restoring the leaf and wrapper reuse guarantees.
Do not merge it as a performance improvement.
This commit is contained in:
1 parent
5fcace1bfa
commit
efb416bbc3
14 files changed
+548
-166
No files matched your search
@@ -699,3 +699,20 @@ fn equal_shares_differ_by_at_most_two_steps_and_fill_the_row() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_stack_sized_by_a_child_does_not_take_that_childs_fraction_twice() {
|
||||
let mut h = Harness::new((400, 200));
|
||||
let half = rect(Color::RED).width(rel(0.5)).add(&mut h.rsc);
|
||||
let behind = rect(Color::BLUE).add(&mut h.rsc);
|
||||
let stack = Stack {
|
||||
children: vec![behind.add_strong(&mut h.rsc), half.add_strong(&mut h.rsc)],
|
||||
size: StackSize::Child(1),
|
||||
}
|
||||
.add(&mut h.rsc);
|
||||
h.set_root((stack,).span(Dir::RIGHT).width(rel(1.0)));
|
||||
|
||||
assert_corners!(h, stack, (0, 0), (200, 200));
|
||||
assert_corners!(h, half, (0, 0), (200, 200));
|
||||
assert_corners!(h, behind, (0, 0), (200, 200));
|
||||
}
|
||||
Reference in new issue
Block a user