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:
1 parent
2bee0b4b53
commit
dc45f7bb3e
1 file changed
+14
-6
+14
-6
@@ -165,12 +165,20 @@ fn draw(&mut self, painter: &mut Painter) -> Size {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
Across itself a span reports `leftover` if any child does; otherwise the
|
Across itself a span reports the longest child in *frame pixels* among the
|
||||||
longest child in *frame pixels* among `px` and `rel` children, reporting
|
`px` and `rel` parts of its children's reports, as that child's own `Len`.
|
||||||
that child's own `Len`. Comparing in pixels is safe here because the frame
|
Comparing in pixels is safe here because the frame is decided from above
|
||||||
is decided from above and nothing feeds back; the read is a `frame_px_len`
|
and nothing feeds back; the read is a `frame_px_len` and narrows the frame
|
||||||
and narrows the frame range, and at the crossover both candidates are the
|
range, and at the crossover both candidates are the same number of pixels,
|
||||||
same number of pixels, so the drawing is the same on either side of it.
|
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):
|
The shapes the rest of the containers take (write them, they are short):
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user