Ask whether a rule gives the length, not whether there is one

`Painter::ruled` answered "is there a rule beside me on this axis", which is
the same question as "is my report moot" only while `Exact` is the only rule
there is. `Min`, `Max` and `Clamp` are queued, and under one of those the
answer is still the widget's to give and a span across itself still has to
read its children -- so the name would have been true and the meaning wrong,
which is the worst way for a predicate to age.

It is `has_exact_size` now, over `SizeRule::exact` rather than `known`.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
iris-aiandClaude Opus 5 committed 2026-09-16 13:40:51 -04:00
1 parent a8898aaa54
commit 490918b789
4 files changed
+24 -17

No files matched your search

+5 -3
View File
@@ -80,9 +80,11 @@ impl Widget for Span {
}
// Across itself a span is as long as its longest child -- unless a
// rule beside it already says how long it is, and then reading them
// answers nothing and makes its size depend on theirs for it.
let shrinks = !painter.ruled(!axis);
// rule beside it gives that length outright, and then reading them
// answers nothing and makes its size depend on theirs for it. A rule
// that only bounds the length does not count: the answer is still
// this span's to give.
let shrinks = !painter.has_exact_size(!axis);
// What the fixed parts and the gaps before here take, which is a sum
// of lengths and exact, and how much of the leftover weight is
// spoken for. A position is one from the other rather than a step