summaryrefslogtreecommitdiff
path: root/src/layout/flex.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2019-10-17 10:12:34 +0200
committerLaurenz <laurmaedje@gmail.com>2019-10-17 10:12:34 +0200
commitf22f9513aea21408ebf6febd01912e630e9ad5e6 (patch)
tree06885bca8bc31d26189f33c059649ed7909af282 /src/layout/flex.rs
parent9a1d57a11a510b8e6af024b4338ee58d791f3088 (diff)
Add pagebreak function ⏭
Diffstat (limited to 'src/layout/flex.rs')
-rw-r--r--src/layout/flex.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/layout/flex.rs b/src/layout/flex.rs
index 98cca2f9..39c16aef 100644
--- a/src/layout/flex.rs
+++ b/src/layout/flex.rs
@@ -17,6 +17,7 @@ use super::*;
/// flows into a new line. A _glue_ layout is typically used for a space character
/// since it prevents a space from appearing in the beginning or end of a line.
/// However, it can be any layout.
+#[derive(Debug, Clone)]
pub struct FlexLayouter {
ctx: FlexContext,
units: Vec<FlexUnit>,
@@ -64,6 +65,7 @@ impl FlexContext {
}
}
+#[derive(Debug, Clone)]
enum FlexUnit {
/// A content unit to be arranged flexibly.
Boxed(Layout),
@@ -73,6 +75,7 @@ enum FlexUnit {
Glue(Size2D),
}
+#[derive(Debug, Clone)]
struct FlexRun {
content: Vec<(Size, Layout)>,
size: Size2D,
@@ -168,7 +171,6 @@ impl FlexLayouter {
}
fn layout_glue(&mut self, glue: Size2D) {
- self.flush_glue();
self.cached_glue = Some(glue);
}