pub struct Min(/* private fields */);Expand description
A lower clamp on one axis: a number of logical px, or the node’s own
fit size on that axis (Min::FIT, minWidth: "fit" in the
bindings). FIT is what lets a Grow child keep a content floor, like
CSS’s flex: 1 0 auto: tabs split a bar evenly while they fit and sit
at their label’s width, scrolling, once they do not. Layout resolves it
to a number in the fit pass of its axis, so every later clamp reads
one; until then it clamps like no floor at all.
Undeclared is Min::AUTO, which clamps as 0 everywhere but one
place: a child giving in an overflowing row that holds a share of the
room, where it is CSS’s min-width: auto, the child’s min-content. A
declared 0 (Min::px(0.0)) is no floor there either, as CSS’s
min-width: 0 is how a flex item is let go below its content.
Stored as one f32 with FIT and a calc as negatives (the form the
C struct’s min_w takes too), because LayoutSpec is copied per node
per frame.
Implementations§
Source§impl Min
impl Min
Sourcepub const AUTO: Min
pub const AUTO: Min
No floor declared: the node’s min-content where a share of the room
gives in CSS’s way and down a column of fit children; 0 across a
run of fit children alone, across a column, where a fit node is
held to the column’s box, and for a node that scrolls or clips.
Negative zero, so it is 0 to every clamp and to ==, and told
apart from a declared 0 by its sign alone (Min::is_auto).
Sourcepub fn px(v: f32) -> Min
pub fn px(v: f32) -> Min
A floor of v logical px; a negative (or NaN) is a floor of 0,
declared — no automatic one either.