Rename rest to leftover
The length kind that asks for a part of what is left once the fixed lengths are taken is called leftover: Len::leftover(2), Len::LEFTOVER, Size::LEFTOVER, Len::leftover the field, and apply_leftover. It says what it is where "rest" reads as "the remainder of the list" as often as "the remaining space", and every agent who has touched this has reached for a third word for it. Locals called rest that meant a region or a widget are renamed with it, since the word now names something else. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
9644971daf
commit
691e3eb23c
16 files changed
+98
-89
No files matched your search
@@ -14,11 +14,17 @@ impl Widget for Aligned {
|
||||
.map(|(x, y)| Size { x, y }),
|
||||
(Some(_), None) => painter
|
||||
.known_len(&self.inner, Axis::X, UiRegion::FULL)
|
||||
.map(|x| Size { x, y: Len::REST }),
|
||||
.map(|x| Size {
|
||||
x,
|
||||
y: Len::LEFTOVER,
|
||||
}),
|
||||
(None, Some(_)) => painter
|
||||
.known_len(&self.inner, Axis::Y, UiRegion::FULL)
|
||||
.map(|y| Size { x: Len::REST, y }),
|
||||
(None, None) => Some(Size::REST),
|
||||
.map(|y| Size {
|
||||
x: Len::LEFTOVER,
|
||||
y,
|
||||
}),
|
||||
(None, None) => Some(Size::LEFTOVER),
|
||||
};
|
||||
// Drawn where it may be too big only when the aligned axes are not
|
||||
// already known, then given its aligned box once its size is known.
|
||||
@@ -26,8 +32,8 @@ impl Widget for Aligned {
|
||||
let size = known.unwrap_or_else(|| painter.place(&self.inner, UiRegion::FULL).size());
|
||||
let region = match self.align.tuple() {
|
||||
(Some(x), Some(y)) => size.to_uivec2().align(RegionAlign { x, y }),
|
||||
(Some(x), None) => UiRegion::new(size.x.apply_rest().align(x), UiSpan::FULL),
|
||||
(None, Some(y)) => UiRegion::new(UiSpan::FULL, size.y.apply_rest().align(y)),
|
||||
(Some(x), None) => UiRegion::new(size.x.apply_leftover().align(x), UiSpan::FULL),
|
||||
(None, Some(y)) => UiRegion::new(UiSpan::FULL, size.y.apply_leftover().align(y)),
|
||||
(None, None) => UiRegion::FULL,
|
||||
};
|
||||
let placed = painter.place(&self.inner, region).size();
|
||||
|
||||
Reference in new issue
Block a user