Record the PlaceDesc argument in the handoff
This commit is contained in:
1 parent
56437dc90f
commit
265ce6f829
1 file changed
+22
-16
+22
-16
@@ -6,11 +6,11 @@ in `docs/LAYOUT_LOG.md`.
|
||||
|
||||
## The Iris layout repair is submitted
|
||||
|
||||
**Iris PR #19** (`layout/one-ask`) replaces closed #18. The tip is `c55be21`:
|
||||
**Iris PR #19** (`layout/one-ask`) replaces closed #18. The tip is `58ce74d`:
|
||||
`add6774` fixes collapsed-share placement, retained mask ownership and a
|
||||
redraw-on-reparent defect, `84dad21` removes repeated work in the test
|
||||
harness, and `5642f20` through `c55be21` are the vocabulary and API
|
||||
work below.
|
||||
harness, and `5642f20` through `58ce74d` are the vocabulary and API work
|
||||
below.
|
||||
The core design remains sound; round-to-nearest is still unchanged.
|
||||
|
||||
Two checkouts share one Git storage. `/home/bob/repos/iris` is the active
|
||||
@@ -44,19 +44,25 @@ itself. Three names, and only two of them are boxes:
|
||||
`aeb60e5` also cut what a container has to say, since correctness and cost
|
||||
had been paid for and ergonomics had not:
|
||||
|
||||
- `Painter::widget_within(id, region)` takes a box in the widget's own
|
||||
coordinates and derives the child's rel base from it, so `Pad` and
|
||||
`Offset` are one call each. `Offset` had been reading `region_len`, which
|
||||
pinned its drawing to a box length an offset does not depend on.
|
||||
- `Painter::place_at` takes the rel base, returns the answer, and draws the
|
||||
child where there is no answer to re-express. `Span`'s second pass is one
|
||||
call, and its `drawn_across` bookkeeping is gone.
|
||||
- The rel base a container decides for a child is `narrow_rel_base`, and it
|
||||
takes `impl Into<Option<[Option<Len>; 2]>>`, so one that narrows nothing
|
||||
writes `None`. The resolved value stays the bare `rel_base`.
|
||||
- `Part::All` is a `Part::WHOLE` constant rather than a variant. It was
|
||||
exactly `Of(UiSpan::FULL)`; measured at 0.07% of instructions retired
|
||||
against 0.04% run-to-run noise on a 60-seed depth-5 shrink.
|
||||
- **One argument says where a child goes.** `widget_at` and `place_at` take
|
||||
`impl Into<PlaceDesc>`, so a wrapper passes a `UiRegion` and says nothing
|
||||
else -- `Pad` and `Offset` are one call each. `Place` and `Part` are gone:
|
||||
`Place` was a product written as a sum, and `Part`'s three cases named
|
||||
operations the geometry already had (`UiSpan::within`, `UiSpan::shift`,
|
||||
and `placement`'s own body).
|
||||
- **`PlaceDescAxis` is named after the operation**: `within`, `shifted`,
|
||||
`sized`, `WHOLE`, with `fills` and `rel_base` as builders. The rel base a
|
||||
caller does not state follows the constructor -- `within` narrows it,
|
||||
`shifted` passes it through, `sized` is it -- which removes the one rule a
|
||||
caller could get wrong with nothing failing.
|
||||
- **`PlaceDesc` is a proper pair**, with `x`/`y`, `axis`, `axis_mut` and
|
||||
`from_axis` like every other pair here, so joint work is written once
|
||||
rather than per axis.
|
||||
- `Painter::place_at` returns the answer and draws the child where there is
|
||||
no answer to re-express, so `Span`'s second pass is one call and its
|
||||
`drawn_across` bookkeeping is gone.
|
||||
- `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` across all of it, over 400
|
||||
depth-5 trees.
|
||||
|
||||
Reference in new issue
Block a user