diff options
Diffstat (limited to 'src/layout')
| -rw-r--r-- | src/layout/spacing.rs | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/src/layout/spacing.rs b/src/layout/spacing.rs index 1ba3b54a..c9a9c233 100644 --- a/src/layout/spacing.rs +++ b/src/layout/spacing.rs @@ -1,14 +1,21 @@ use std::fmt::{self, Debug, Formatter}; use super::*; +use crate::eval::Softness; /// A spacing node. #[derive(Copy, Clone, PartialEq)] pub struct Spacing { /// The amount of spacing to insert. pub amount: Length, - /// Spacing interaction, see [`Softness`]'s documentation for more - /// information. + /// Defines how spacing interacts with surrounding spacing. + /// + /// Hard spacing assures that a fixed amount of spacing will always be + /// inserted. Soft spacing will be consumed by previous soft spacing or + /// neighbouring hard spacing and can be used to insert overridable spacing, + /// e.g. between words or paragraphs. + /// + /// This field is only used in evaluation, not in layouting. pub softness: Softness, } @@ -32,18 +39,3 @@ impl From<Spacing> for LayoutNode { Self::Spacing(spacing) } } - -/// Defines how spacing interacts with surrounding spacing. -/// -/// Hard spacing assures that a fixed amount of spacing will always be inserted. -/// Soft spacing will be consumed by previous soft spacing or neighbouring hard -/// spacing and can be used to insert overridable spacing, e.g. between words or -/// paragraphs. -#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] -pub enum Softness { - /// Soft spacing is not laid out if it directly follows other soft spacing - /// or if it touches hard spacing. - Soft, - /// Hard spacing is always laid out and consumes surrounding soft spacing. - Hard, -} |
