2019-09-24 15:15:34 +02:00
|
|
|
/// The strategy used to fill space in a specific dimension.
|
2019-11-10 06:05:20 +01:00
|
|
|
#[derive(Debug, Clone, Copy, PartialEq, Hash)]
|
2019-09-20 19:15:31 +02:00
|
|
|
pub enum Length {
|
|
|
|
|
Fill,
|
|
|
|
|
Shrink,
|
|
|
|
|
Units(u16),
|
|
|
|
|
}
|
2019-11-10 06:05:20 +01:00
|
|
|
|
|
|
|
|
impl Length {
|
|
|
|
|
pub fn fill_factor(&self) -> u16 {
|
|
|
|
|
match self {
|
|
|
|
|
Length::Fill => 1,
|
|
|
|
|
Length::Shrink => 0,
|
|
|
|
|
Length::Units(_) => 0,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|