WIP: a widget's region stays put and its placement moves in it
The protocol split: `region` is the box a parent gives a widget -- what a fraction it declares or reports is a fraction of, and the coordinates every region it writes composes within -- and it is the same box on the ask that measures and the ask that places. `placement` is what of that region the drawing takes, chosen by the parent per axis or by the widget's own answer and alignment. That is what stops a fraction being resolved twice: the placing ask no longer hands the widget its own answer as its box, so nothing under it re-resolves against a box that came from its own report. `reports_of` and `decided` are gone, folded into the two regions; `box_of` is gone; `declared_box` becomes `ask_box`, which gives a rule the region's length and takes the position from the placement. 84 of 92 suite tests pass. Five text and region-node cases still diverge warm against cold, and three count a second widget draw where a span's measuring ask and its placing ask give different placements.
This commit is contained in:
1 parent
e44dea34b4
commit
5fcace1bfa
11 files changed
+346
-206
No files matched your search
@@ -89,7 +89,7 @@ impl TextView {
|
||||
// hair under that line, and the break made in it is not the break a
|
||||
// cold layout makes there.
|
||||
let size = Size::from_px(PxVec2::ceil_from_f32(tex.size));
|
||||
let within = region.within(&painter.region());
|
||||
let within = region.within(&painter.placement());
|
||||
painter.glyphs(tex, within);
|
||||
(region, size)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user