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
@@ -7,6 +7,17 @@ pub enum Axis {
|
||||
Y,
|
||||
}
|
||||
|
||||
impl Axis {
|
||||
/// A per-axis pair with `aligned` on this axis and `ortho` on the other,
|
||||
/// which is what `from_axis` does for a vector.
|
||||
pub fn pair<T>(self, aligned: T, ortho: T) -> [T; 2] {
|
||||
match self {
|
||||
Self::X => [aligned, ortho],
|
||||
Self::Y => [ortho, aligned],
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl std::ops::Not for Axis {
|
||||
type Output = Self;
|
||||
|
||||
|
||||
Reference in new issue
Block a user