Skip to main content

align_offset

Function align_offset 

Source
pub fn align_offset(
    text_width: u32,
    available_width: u32,
    align: &TextAlign,
) -> u32
Expand description

Compute horizontal tile offset for a given alignment.

Returns the number of tile columns to shift right so that a text_width-tile-wide string sits at the left, centre, or right of an available_width-tile-wide area.