Drop three things nothing reads, and say what a span makes scalable
`Axis::pair` and `RegionAlign::NEAR` arrived on this branch with no caller and never got one. `Holds::contains` took `&self` where its five siblings on the same `Copy` pair of pixels take `self`. The comment beside a span's cross-axis accumulator said a scalable child "makes Children scalable too"; `Children` names nothing here, and what it makes scalable is the span.
This commit is contained in:
1 parent
9b4cc329ce
commit
750217631d
4 files changed
+2
-19
No files matched your search
@@ -84,14 +84,6 @@ pub struct RegionAlign {
|
|||||||
pub y: AxisAlign,
|
pub y: AxisAlign,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl RegionAlign {
|
|
||||||
/// Both axes at the near edge: the start of a box in its own orientation.
|
|
||||||
pub const NEAR: Self = Self {
|
|
||||||
x: AxisAlign::NEG,
|
|
||||||
y: AxisAlign::NEG,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
impl RegionAlign {
|
impl RegionAlign {
|
||||||
pub const TOP_LEFT: Self = Self::new(AxisAlign::NEG, AxisAlign::NEG);
|
pub const TOP_LEFT: Self = Self::new(AxisAlign::NEG, AxisAlign::NEG);
|
||||||
pub const TOP_CENTER: Self = Self::new(AxisAlign::CENTER, AxisAlign::NEG);
|
pub const TOP_CENTER: Self = Self::new(AxisAlign::CENTER, AxisAlign::NEG);
|
||||||
|
|||||||
@@ -11,15 +11,6 @@ pub enum Axis {
|
|||||||
impl Axis {
|
impl Axis {
|
||||||
/// Both of them, for the layout code that asks the same question of each.
|
/// Both of them, for the layout code that asks the same question of each.
|
||||||
pub const BOTH: [Self; 2] = [Self::X, Self::Y];
|
pub const BOTH: [Self; 2] = [Self::X, Self::Y];
|
||||||
|
|
||||||
/// 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 {
|
impl std::ops::Not for Axis {
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ impl Holds {
|
|||||||
Self { lo: len, hi: len }
|
Self { lo: len, hi: len }
|
||||||
}
|
}
|
||||||
|
|
||||||
pub const fn contains(&self, len: Px) -> bool {
|
pub const fn contains(self, len: Px) -> bool {
|
||||||
len.raw() >= self.lo.raw() && len.raw() <= self.hi.raw()
|
len.raw() >= self.lo.raw() && len.raw() <= self.hi.raw()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -124,7 +124,7 @@ impl Widget for Span {
|
|||||||
if shrinks {
|
if shrinks {
|
||||||
// Choosing between a fixed and a relative length from the
|
// Choosing between a fixed and a relative length from the
|
||||||
// span's own eventual width admits multiple fixed points.
|
// span's own eventual width admits multiple fixed points.
|
||||||
// A scalable child therefore makes Children scalable too;
|
// A scalable child therefore makes the span scalable too;
|
||||||
// only fixed children are compared with one another.
|
// only fixed children are compared with one another.
|
||||||
if !used.is_px() {
|
if !used.is_px() {
|
||||||
ortho = LayoutLen::LEFTOVER;
|
ortho = LayoutLen::LEFTOVER;
|
||||||
|
|||||||
Reference in new issue
Block a user