Put place before the rel base, and say what a Place decides

An argument that is usually `None` goes last. So `widget_at` and `place_at`
take the place first, and `narrow_rel_base` after it.

`Place` and `Part` also now say which of the two boxes they decide, since
that is the question a caller has to answer to pick between them: `Part` is
the child's region, said as a part of the caller's own, and `Within`/`Fill`
is what becomes of the placement in it.
This commit is contained in:
iris-ai committed 2026-09-19 17:16:41 -04:00
1 parent beb138632a
commit c55be21761
8 files changed
+41 -38

No files matched your search

+2 -2
View File
@@ -36,7 +36,7 @@ impl Widget for Span {
None => {
let room = Place::Within(Part::From(along(cursor, far)));
painter
.widget_at(child, None, axis.pair(room, across))
.widget_at(child, axis.pair(room, across), None)
.len(axis)
}
};
@@ -123,7 +123,7 @@ impl Widget for Span {
let place = axis.pair(Place::Fill(Part::From(slot)), across);
let narrow =
(len.leftover > Weight::ZERO && shares).then(|| axis.pair(Some(slot.len()), None));
let used = painter.place_at(child, narrow, place).len(!axis);
let used = painter.place_at(child, place, narrow).len(!axis);
if shrinks {
// Choosing between a fixed and a relative length from the
// span's own eventual width admits multiple fixed points.