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

+7 -7
View File
@@ -216,8 +216,8 @@ impl Widget for FromHint {
let top = UiSpan::new(Len::ZERO, Len::from_parts(Rel::ZERO, len.px));
painter.widget_at(
&self.inner,
[None; 2],
[Place::Within(Part::WHOLE), Place::Within(Part::From(top))],
None,
);
Size::LEFTOVER
}
@@ -877,11 +877,11 @@ fn resizing_a_fixed_frame_recomposes_its_contents_without_drawing_them() {
fn draw(&mut self, painter: &mut Painter) -> Size {
painter.widget_at(
&self.child,
[None; 2],
[
Place::Within(Part::From(self.region.x)),
Place::Within(Part::From(self.region.y)),
],
None,
);
Size::LEFTOVER
}
@@ -966,11 +966,11 @@ fn glyph_origins_compose_identically_when_drawn_and_when_retained() {
fn draw(&mut self, painter: &mut Painter) -> Size {
painter.widget_at(
&self.child,
[Some(self.frame.x.len()), None],
[
Place::Fill(Part::From(self.region.x)),
Place::Fill(Part::From(self.region.y)),
],
[Some(self.frame.x.len()), None],
);
Size::LEFTOVER
}
@@ -1136,11 +1136,11 @@ fn padding_and_stack_boxes_follow_the_region_without_drawing_again() {
fn draw(&mut self, painter: &mut Painter) -> Size {
painter.widget_at(
&self.child,
[None; 2],
[
Place::Fill(Part::From(self.region.x)),
Place::Fill(Part::From(self.region.y)),
],
None,
);
Size::LEFTOVER
}
@@ -1224,7 +1224,6 @@ fn moving_a_childs_region_preserves_the_slot_chosen_from_its_measurement() {
fn draw(&mut self, painter: &mut Painter) -> Size {
painter.widget_at(
&self.child,
[None; 2],
[
Place::Fill(Part::From(UiSpan::new(
Len::px(self.start),
@@ -1232,6 +1231,7 @@ fn moving_a_childs_region_preserves_the_slot_chosen_from_its_measurement() {
))),
Place::Fill(Part::From(UiSpan::FULL)),
],
None,
);
Size::LEFTOVER
}
@@ -1266,11 +1266,11 @@ fn changing_regions_keep_fractional_reports_and_numeric_dependencies_valid() {
painter
.widget_at(
&self.child,
[None; 2],
[
Place::Within(Part::From(self.region.x)),
Place::Within(Part::From(self.region.y)),
],
None,
)
.size()
}
@@ -1286,11 +1286,11 @@ fn changing_regions_keep_fractional_reports_and_numeric_dependencies_valid() {
painter
.widget_at(
&self.child,
[None; 2],
[
Place::Fill(Part::From(self.region.x)),
Place::Fill(Part::From(self.region.y)),
],
None,
)
.size(),
);