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
@@ -14,7 +14,7 @@ impl Widget for Scroll {
let container_len = painter.px_len(self.axis);
// Asked in the whole viewport, then put at the scrolled offset.
let answer_len = painter
.widget_at(&self.inner, None, [Place::Fill(Part::WHOLE); 2])
.widget_at(&self.inner, [Place::Fill(Part::WHOLE); 2], None)
.len(self.axis);
let fixed = painter.to_px(Len::from_parts(answer_len.rel, answer_len.px), self.axis);
self.container_len = container_len;
@@ -64,9 +64,9 @@ impl Widget for Scroll {
// box, scrolled: its drawing moved there, not made again there.
painter.place_at(
&self.inner,
None,
self.axis
.pair(Place::Fill(content), Place::Fill(Part::WHOLE)),
None,
);
// What it occupies is its box, on both axes: it clips its content to
// that box, so it can neither take less of one nor honestly ask for