Take a span child's length from its hint, and ask it once in its slot
A share child was drawn in the measuring room and again in its slot, and one record holding two questions made every local change under it defer to the span. Where a rule or a hint gives the length along the span, the first ask answers nothing the rule does not, so the child is asked once, in its slot; the widgets that always report the whole of their box now say so. A hint with a fraction resolves against the frame and pins it. The dump rig prints every cold layout so a change to it shows in a diff.
This commit is contained in:
1 parent
a888717ee9
commit
f6242aa33c
7 files changed
+120
-33
No files matched your search
@@ -49,6 +49,15 @@ impl Widget for Stack {
|
||||
}
|
||||
size
|
||||
}
|
||||
|
||||
/// Without a sizing child a stack is whatever box it is given, which it
|
||||
/// can say without drawing anything.
|
||||
fn size_hint(&self, _: Axis) -> Option<LayoutLen> {
|
||||
match self.size {
|
||||
StackSize::Default => Some(LayoutLen::LEFTOVER),
|
||||
StackSize::Child(_) => None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Default, Debug)]
|
||||
|
||||
Reference in new issue
Block a user