One argument says where a child goes and what its fractions are of
`Place` was a product written as a sum -- a `Part` and a fill flag -- and `Part` named three operations the geometry already had, under words that did not match them. `Of` was `UiSpan::within`, `From` was `UiSpan::shift`, and `Sized` was `placement`'s own body with the length given rather than reported. Both enums are gone. `PlaceDescAxis` says one axis, named after the operation it performs: `within`, `shifted`, `sized`, and `WHOLE`. What is optional is a builder -- `fills` and `rel_base` -- so a caller writes only what it decided, and the rel base it does not write follows the constructor: a span composed into the caller's box narrows it, a span along a cursor does not, a decided length is it. That was the one rule a caller could get wrong with nothing failing. `PlaceDesc` says both axes with named fields, so `axis`, `axis_mut` and `from_axis` work the way they do on every other pair here, and the joint work -- resolving a region, reading the fill flags -- is written once rather than per axis. `widget_at` and `place_at` take `impl Into<PlaceDesc>`, so a wrapper passes a `UiRegion` and says nothing else. `widget_within` and `ActiveData::narrow_rel_base` are deleted; `asked` and `placed` carry the rel base their ask stated. Cold layout is byte-identical to `84dad21`.
This commit is contained in:
1 parent
c55be21761
commit
58ce74dd7d
12 files changed
+367
-271
No files matched your search
@@ -8,7 +8,7 @@ pub struct Offset {
|
||||
impl Widget for Offset {
|
||||
fn draw(&mut self, painter: &mut Painter) -> Size {
|
||||
painter
|
||||
.widget_within(&self.inner, UiRegion::FULL.offset(self.amt))
|
||||
.widget_at(&self.inner, UiRegion::FULL.offset(self.amt))
|
||||
.size()
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user