summaryrefslogtreecommitdiff
path: root/src/layout
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2020-12-17 00:20:27 +0100
committerLaurenz <laurmaedje@gmail.com>2020-12-17 00:20:27 +0100
commit81e80ecfba80f5bffab45719c1f2aba4f9b91b4f (patch)
tree03452a7ef0361f24159a60c93fb543263afb91e3 /src/layout
parent2336aeb4c32864f53a4d4e0f72e54a174df47a60 (diff)
Test [page] function 📕
- Make page break behaviour more consistent - Allow skipping reference image testing for single tests with `// compare-ref: false` (useful for tests which only check error messages)
Diffstat (limited to 'src/layout')
-rw-r--r--src/layout/spacing.rs26
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,
-}