mirror of
https://github.com/griffi-gh/hUI.git
synced 2024-11-29 18:28:55 -06:00
34 lines
625 B
Rust
34 lines
625 B
Rust
|
//! Layout related types and functions
|
||
|
|
||
|
use glam::Vec2;
|
||
|
|
||
|
#[derive(Clone, Copy, PartialEq, Eq, Debug, Default, PartialOrd, Ord)]
|
||
|
pub enum Alignment {
|
||
|
#[default]
|
||
|
Begin = 0,
|
||
|
Center = 1,
|
||
|
End = 2,
|
||
|
}
|
||
|
|
||
|
#[derive(Default, Debug, Clone, Copy)]
|
||
|
pub enum UiSize {
|
||
|
#[default]
|
||
|
Auto,
|
||
|
Fraction(f32),
|
||
|
Static(f32),
|
||
|
}
|
||
|
|
||
|
#[derive(Default, Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord)]
|
||
|
pub enum UiDirection {
|
||
|
#[default]
|
||
|
Vertical,
|
||
|
Horizontal,
|
||
|
}
|
||
|
|
||
|
pub struct LayoutInfo {
|
||
|
///Not availabe during measuring step
|
||
|
pub position: Vec2,
|
||
|
pub max_size: Vec2,
|
||
|
pub direction: UiDirection,
|
||
|
}
|