Skip to main content

resolve_static_offset

Function resolve_static_offset 

Source
pub fn resolve_static_offset(
    static_position: Point<AxisStaticPosition>,
    final_size: Size<f32>,
    resolved_margin: Rect<f32>,
) -> Point<f32>
Expand description

Resolve the final static offset of an out-of-flow box from its static position, given the box’s final size and resolved margins.

In each axis the box’s margin box is aligned within the static-position area according to the recorded alignment keyword. When the alignment is safe and the margin box overflows the area, the fallback keyword is used instead (the safe overflow-position keyword from CSS Box Alignment). The returned offset locates the box’s border box and is relative to whatever the static-position areas are relative to (the containing block’s border box once a candidate has bubbled to its containing block).