Put place before the rel base, and say what a Place decides
An argument that is usually `None` goes last. So `widget_at` and `place_at` take the place first, and `narrow_rel_base` after it. `Place` and `Part` also now say which of the two boxes they decide, since that is the question a caller has to answer to pick between them: `Part` is the child's region, said as a part of the caller's own, and `Within`/`Fill` is what becomes of the placement in it.
This commit is contained in:
1 parent
beb138632a
commit
c55be21761
8 files changed
+41
-38
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, [Place::Fill(Part::WHOLE); 2])
|
||||
.widget_at(child, [Place::Fill(Part::WHOLE); 2], None)
|
||||
.size()
|
||||
}
|
||||
None => Size::LEFTOVER,
|
||||
@@ -45,7 +45,7 @@ impl Widget for Stack {
|
||||
continue;
|
||||
}
|
||||
painter.child_layer_at(i);
|
||||
painter.widget_at(child, None, place);
|
||||
painter.widget_at(child, place, None);
|
||||
}
|
||||
size
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user