diff --git a/core/src/ui/painter.rs b/core/src/ui/painter.rs index ec3993e..c2dc94f 100644 --- a/core/src/ui/painter.rs +++ b/core/src/ui/painter.rs @@ -648,7 +648,7 @@ impl Widgets { pub(crate) fn declared_lens(&self, id: WidgetId) -> Declared { let rules = self.size_rules(id); let widget = self.get_dyn(id); - Declared::per_axis(|axis| { + Declared::from_axes(|axis| { rules[axis].declared().or_else(|| { // A hint still narrows the box where no rule does, which is // how a widget with a natural pixel size -- an image, a gap diff --git a/core/src/ui/place.rs b/core/src/ui/place.rs index c821d91..fe51d64 100644 --- a/core/src/ui/place.rs +++ b/core/src/ui/place.rs @@ -147,7 +147,7 @@ impl PlaceDesc { /// A description per axis, where the two differ and neither is the /// axis a container divides. - pub fn per_axis(f: impl Fn(Axis) -> PlaceDescAxis) -> Self { + pub fn from_axes(f: impl Fn(Axis) -> PlaceDescAxis) -> Self { Self::new(f(Axis::X), f(Axis::Y)) } diff --git a/core/src/widget/size_rule.rs b/core/src/widget/size_rule.rs index 728a107..fee56af 100644 --- a/core/src/widget/size_rule.rs +++ b/core/src/widget/size_rule.rs @@ -83,7 +83,7 @@ pub struct Declared { impl Declared { pub const NONE: Self = Self { x: None, y: None }; - pub fn per_axis(f: impl Fn(Axis) -> Option) -> Self { + pub fn from_axes(f: impl Fn(Axis) -> Option) -> Self { Self { x: f(Axis::X), y: f(Axis::Y), diff --git a/src/widget/position/stack.rs b/src/widget/position/stack.rs index a5a6323..4e5639f 100644 --- a/src/widget/position/stack.rs +++ b/src/widget/position/stack.rs @@ -31,7 +31,7 @@ impl Widget for Stack { // fraction under them is a fraction of it. A share leaves the axis // to whoever gave the stack its box. Where a child sits in a box // bigger than itself is its own business. - let place = PlaceDesc::per_axis(|axis| { + let place = PlaceDesc::from_axes(|axis| { let len = size[axis]; match len.leftover == Weight::ZERO { true => len.without_leftover().as_desc().fills(),