pub struct Layout {
pub x_alignment: Alignment,
pub y_alignment: Alignment,
pub x_offset: f32,
pub y_offset: f32,
pub x_size: Size,
pub y_size: Size,
pub padding: (f32, f32, f32, f32),
pub preserve_ratio: bool,
}
Expand description
A struct that contains information about the layout of an UI-Element: their alignment, size, offset and padding.
Fields§
§x_alignment: Alignment
Wether this element aligns left, center or right. See Alignment.
y_alignment: Alignment
Wether this element aligns top, center or bottom. See Alignment.
x_offset: f32
How many pixels away from the most left- or rightmost position this element aligns. Should be positive. Does not work with Alignment::Center.
y_offset: f32
How many pixels away from the most top- or bottommost position this element aligns. Should be positive. Does not work with Alignment::Center.
x_size: Size
The size and growth behaviour of this element in the horizontal direction. See Size.
y_size: Size
The size and growth behaviour of this element in the vertical direction. See Size.
padding: (f32, f32, f32, f32)
Specifies the padding, extra space around the cental element(s), of a container in the order top, right, bottom, left.
preserve_ratio: bool
Specifies wether this elements content will only receive draw rectangles in the size of their content min ratio.