Say what leftover means across a span in the transparent-frames plan

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
iris-aiandClaude Fable 5.1 committed 2026-09-17 22:38:48 -04:00
1 parent 2bee0b4b53
commit dc45f7bb3e
1 file changed
+14 -6
+14 -6
View File
@@ -165,12 +165,20 @@ fn draw(&mut self, painter: &mut Painter) -> Size {
}
```
Across itself a span reports `leftover` if any child does; otherwise the
longest child in *frame pixels* among `px` and `rel` children, reporting
that child's own `Len`. Comparing in pixels is safe here because the frame
is decided from above and nothing feeds back; the read is a `frame_px_len`
and narrows the frame range, and at the crossover both candidates are the
same number of pixels, so the drawing is the same on either side of it.
Across itself a span reports the longest child in *frame pixels* among the
`px` and `rel` parts of its children's reports, as that child's own `Len`.
Comparing in pixels is safe here because the frame is decided from above
and nothing feeds back; the read is a `frame_px_len` and narrows the frame
range, and at the crossover both candidates are the same number of pixels,
so the drawing is the same on either side of it. A child's `leftover`
across a span contributes nothing to that: across, children overlap rather
than divide anything, so a share can only mean "as tall as the span", and
`Place::Within(None)` already fills the extent for a leftover answer. Only
when no child has a `px` or `rel` part does the span report `leftover`
itself and take its parent's room (Bryan, 2026-09-18: "returning rest if
any have it is probably fine", refined to this because it costs nothing).
So `row![text, rect]` is as tall as the text with the rect filling it, and
`row![rect, rect]` fills its column's share.
The shapes the rest of the containers take (write them, they are short):