mgui_core/layout/
alignment.rs1#[derive(Debug, Clone, Copy, PartialEq)]
8pub struct Alignment {
9 pub x: f32,
10 pub y: f32,
11}
12
13impl Alignment {
14 pub const TOP_LEFT: Self = Self { x: 0.0, y: 0.0 };
15 pub const TOP_CENTER: Self = Self { x: 0.5, y: 0.0 };
16 pub const TOP_RIGHT: Self = Self { x: 1.0, y: 0.0 };
17 pub const CENTER_LEFT: Self = Self { x: 0.0, y: 0.5 };
18 pub const CENTER: Self = Self { x: 0.5, y: 0.5 };
19 pub const CENTER_RIGHT: Self = Self { x: 1.0, y: 0.5 };
20 pub const BOTTOM_LEFT: Self = Self { x: 0.0, y: 1.0 };
21 pub const BOTTOM_CENTER: Self = Self { x: 0.5, y: 1.0 };
22 pub const BOTTOM_RIGHT: Self = Self { x: 1.0, y: 1.0 };
23}