Say narrow_rel_base, and let a container pass None for it
`narrow` said what the argument did to a value it never named, so a reader had to go and find out which value. It is `narrow_rel_base`, and the resolved one stays the bare `rel_base` -- which is also the only one in `Painter`, `Placing` and `LayoutHolds`, where there is nothing to tell it apart from. It takes `impl Into<Option<[Option<Len>; 2]>>`, so a container that does not narrow anything writes `None` rather than `[None; 2]`, and `Span` builds the one case that does with a `then` instead of a mutable array. Cold layout is byte-identical to `84dad21`.
This commit is contained in:
1 parent
aeb60e50f5
commit
beb138632a
8 files changed
+55
-49
No files matched your search
@@ -23,7 +23,7 @@ impl Widget for Stack {
|
||||
Some((i, child)) => {
|
||||
painter.child_layer_at(i);
|
||||
painter
|
||||
.widget_at(child, [None; 2], [Place::Fill(Part::WHOLE); 2])
|
||||
.widget_at(child, None, [Place::Fill(Part::WHOLE); 2])
|
||||
.size()
|
||||
}
|
||||
None => Size::LEFTOVER,
|
||||
@@ -45,7 +45,7 @@ impl Widget for Stack {
|
||||
continue;
|
||||
}
|
||||
painter.child_layer_at(i);
|
||||
painter.widget_at(child, [None; 2], place);
|
||||
painter.widget_at(child, None, place);
|
||||
}
|
||||
size
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user