summaryrefslogtreecommitdiff
path: root/src/eval
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2021-11-02 10:42:32 +0100
committerLaurenz <laurmaedje@gmail.com>2021-11-02 10:42:32 +0100
commitea6ee3f667e922ed2f21b08719a45d2395787932 (patch)
tree75d777dcbc96c708b470af2270a3f3bad4993d1f /src/eval
parentc4a87e5e7c5032d2579cdd23939aedec499f93f0 (diff)
Fix page breaks in lists and enums
Diffstat (limited to 'src/eval')
-rw-r--r--src/eval/walk.rs17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/eval/walk.rs b/src/eval/walk.rs
index 06747e40..96138338 100644
--- a/src/eval/walk.rs
+++ b/src/eval/walk.rs
@@ -2,9 +2,9 @@ use std::rc::Rc;
use super::{Eval, EvalContext, Str, Template, Value};
use crate::diag::TypResult;
-use crate::geom::Align;
+use crate::geom::Spec;
use crate::layout::BlockLevel;
-use crate::library::{ParChild, ParNode, Spacing, StackChild, StackNode};
+use crate::library::{GridNode, ParChild, ParNode, TrackSizing};
use crate::syntax::*;
use crate::util::BoolExt;
@@ -116,13 +116,12 @@ fn walk_item(ctx: &mut EvalContext, label: Str, body: Template) {
Rc::clone(&style.text),
)],
};
- StackNode {
- dir: style.dir,
- children: vec![
- StackChild::Node(label.pack(), Align::Start),
- StackChild::Spacing(Spacing::Linear((style.text.size / 2.0).into())),
- StackChild::Node(body.to_stack(&style).pack(), Align::Start),
- ],
+
+ let spacing = style.text.size / 2.0;
+ GridNode {
+ tracks: Spec::new(vec![TrackSizing::Auto; 2], vec![]),
+ gutter: Spec::new(vec![TrackSizing::Linear(spacing.into())], vec![]),
+ children: vec![label.pack(), body.to_stack(&style).pack()],
}
});
}