Skip to main content

OofAxis

Struct OofAxis 

Source
struct OofAxis {
    cb_size: f32,
    inset: Line<Option<f32>>,
    margin: Line<Option<f32>>,
    static_position: AxisStaticPosition,
    alignment: OofAlignment,
    safety: AlignmentSafety,
    is_inline: bool,
    reversed: bool,
    is_scroll_axis: bool,
}
Expand description

The inputs to the absolute positioning layout model (https://www.w3.org/TR/css-position-3/#abspos-layout) in a single axis. All coordinates are physical (left-to-right / top-to-bottom) and relative to the start of the containing block’s inset-resolution area.

Fields§

§cb_size: f32

The size of the containing block in this axis

§inset: Line<Option<f32>>

The box’s resolved inset properties (None = auto)

§margin: Line<Option<f32>>

The box’s resolved margins (None = auto)

§static_position: AxisStaticPosition

The box’s static position (relative to the containing block’s inset-resolution area)

§alignment: OofAlignment

The box’s self-alignment in this axis

§safety: AlignmentSafety

The overflow-position modifier of the box’s self-alignment in this axis

§is_inline: bool

Whether this is the inline axis of the containing block

§reversed: bool

Whether the logical start edge of the containing block is the physical end edge of this axis (the inline axis of an RTL containing block)

§is_scroll_axis: bool

Whether the containing block is a scroll container which scrolls in this axis

Implementations§

Source§

impl OofAxis

Source

fn start_edge(&self) -> AxisStaticEdge

The physical edge corresponding to the logical start edge of the containing block

Source

fn end_edge(&self) -> AxisStaticEdge

The physical edge corresponding to the logical end edge of the containing block

Source

fn inset_modified_containing_block(&self) -> Line<f32>

The inset-modified containing block (IMCB) in this axis https://www.w3.org/TR/css-position-3/#resolving-insets

Source

fn inset_modified_containing_block_size(&self) -> f32

The size of the IMCB in this axis: the space available to the box’s margin box

Source

fn stretch_fit_size(&self) -> f32

The stretch-fit size of the box’s border box: the IMCB minus the non-auto margins (auto margins are treated as zero) https://www.w3.org/TR/css-position-3/#abspos-auto-size

Source

fn is_stretch_sized(&self, is_replaced: bool, is_table: bool) -> bool

Whether an auto size in this axis is the stretch-fit size (rather than fit-content) https://www.w3.org/TR/css-position-3/#abspos-auto-size

Source

fn resolve_margins(&self, size: f32) -> Line<f32>

Resolve the box’s auto margins given its final size https://www.w3.org/TR/css-position-3/#abspos-margins

Source

fn position(&self, size: f32, margin: Line<f32>) -> f32

Compute the physical start of the box’s border box given its final size and margins https://www.w3.org/TR/css-position-3/#abspos-alignment

Trait Implementations§

Source§

impl Clone for OofAxis

Source§

fn clone(&self) -> OofAxis

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for OofAxis

Source§

impl Debug for OofAxis

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.