diff options
Diffstat (limited to 'src/layout/mod.rs')
| -rw-r--r-- | src/layout/mod.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/layout/mod.rs b/src/layout/mod.rs index 2c725e1d..04039d07 100644 --- a/src/layout/mod.rs +++ b/src/layout/mod.rs @@ -307,6 +307,19 @@ pub enum Alignment { End, } +#[derive(Debug, Copy, Clone, PartialEq)] +pub enum SpaceState { + Soft(Size), + Forbidden, + Allowed, +} + +impl SpaceState { + fn soft_or_zero(&self) -> Size { + if let SpaceState::Soft(space) = self { *space } else { Size::zero() } + } +} + /// The error type for layouting. pub enum LayoutError { /// An action is unallowed in the active context. |
