summaryrefslogtreecommitdiffstats
path: root/core/src/length.rs
blob: 73c227d8bcf136b145151945a27cb929fe8282da (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/// The strategy used to fill space in a specific dimension.
#[derive(Debug, Clone, Copy, PartialEq, Hash)]
pub enum Length {
    Fill,
    Shrink,
    Units(u16),
}

impl Length {
    pub fn fill_factor(&self) -> u16 {
        match self {
            Length::Fill => 1,
            Length::Shrink => 0,
            Length::Units(_) => 0,
        }
    }
}