pub struct AxisStaticPosition {
pub area: Line<f32>,
pub align: AxisStaticAlign,
}Expand description
The static position of an out-of-flow box in a single axis: the alignment container (start/end coordinates) plus the alignment to apply to the box’s margin box within it.
Area coordinates are initially relative to the border box of the node which produced the candidate and are translated by each node’s location as the candidate bubbles up the tree, so they are always relative to the border box of the node currently holding the candidate.
Emitters which have no alignment area in an axis (e.g. block layout, where the static
position is a point) emit a degenerate area (start == end).
Fields§
§area: Line<f32>The alignment container in this axis
align: AxisStaticAlignThe alignment to apply to the box’s margin box within area
Implementations§
Source§impl AxisStaticPosition
impl AxisStaticPosition
Sourcepub const fn from_edge(anchor: f32, edge: AxisStaticEdge) -> Self
pub const fn from_edge(anchor: f32, edge: AxisStaticEdge) -> Self
Create a AxisStaticPosition with a degenerate (zero-extent) area at anchor and no
safe fallback
Sourcepub fn from_alignment(
alignment: AlignSelf,
area: Line<f32>,
axis_is_rtl: bool,
) -> Self
pub fn from_alignment( alignment: AlignSelf, area: Line<f32>, axis_is_rtl: bool, ) -> Self
Create a AxisStaticPosition which aligns the box within area according to its
self-alignment property in this axis (justify-self in the inline axis, align-self in
the block axis). normal and stretch behave as start. This is the static position
used by block and inline layout.
alignment must already be resolved: auto (None) replaced by the container’s
justify-items/align-items, and self-start/self-end resolved against the
container’s direction (see AlignSelf::resolve_self_relative).
axis_is_rtl is whether this axis is the inline axis of a right-to-left static-position
containing block, in which case start and end are flipped.
Trait Implementations§
Source§impl Clone for AxisStaticPosition
impl Clone for AxisStaticPosition
Source§fn clone(&self) -> AxisStaticPosition
fn clone(&self) -> AxisStaticPosition
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more