Print the box a widget drew in, not the rel base labelled as it

`DrawInfo::px` was the child's rel base in pixels, resolved at all four
construction sites on every draw and read only by three diagnostics --
each of which called it the box: `diag::draw_request`'s `pixel_size`,
printed by `trace_unsettled` as "draw in"; and two `debug_assert`
messages saying "clips to" and "drew in". A rel base and a box differ
wherever a parent hands down part of its own, which is every child of a
span, so all three said something that was not true.

The field is gone and each site reads `region.to_px(window)`, which is
the box it claimed to be printing and costs nothing outside a failing
assert. The trace field is `region_px`. `Placing::window` existed only
to resolve that value and follows it out.

The 23-line counter block inside `try_reuse`'s "outside its range"
branch is `diag::outside`, beside the other diagnostics, so the decision
reads as its six checks.

fmt, workspace clippy under `-D warnings` with and without
`layout-diagnostics`, and the workspace tests under both are clean. The
cold dump over 400 depth-5 trees is byte-identical: 34,492 boxes. The
trace now prints "draw in 189.00x176.00" beside a region 189 by 176.
This commit is contained in:
iris-ai committed 2026-09-19 23:28:36 -04:00
1 parent 3da1c71870
commit 7e2b4cd9db
4 files changed
+51 -49

No files matched your search

-3
View File
@@ -196,7 +196,6 @@ impl<'a> Painter<'a> {
if !re_asked {
self.children.push(id.id());
}
let px = rel_base.to_px(self.window);
let drawn = self.state.draw_inner(
id.id(),
DrawInfo {
@@ -211,7 +210,6 @@ impl<'a> Painter<'a> {
placed: place,
asked: place,
re_asked,
px,
},
None,
self.rsc,
@@ -280,7 +278,6 @@ impl<'a> Painter<'a> {
id: self.id,
region: self.region,
rel_base: self.rel_base,
window: self.window,
depth: self.depth,
move_idx: self.move_idx,
mask: self.mask,