summaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2020-10-03 13:23:59 +0200
committerLaurenz <laurmaedje@gmail.com>2020-10-03 13:23:59 +0200
commit0fc25d732d7cbc37cf801645849d1060f2cec4a3 (patch)
tree706aa8d1bf4135d1dd3ac17a5023bc5e24ded69d /src/lib.rs
parent8dbc5b60cc4a88f68ee82607af3a3c454cd8f68b (diff)
Port to kurbo 🎋
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 8bf5398d..3be97873 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -93,17 +93,17 @@ impl Typesetter {
/// Layout a syntax tree and return the produced layout.
pub async fn layout(&self, tree: &SynTree) -> Pass<MultiLayout> {
- let margins = self.style.page.margins();
+ let space = LayoutSpace {
+ size: self.style.page.size,
+ insets: self.style.page.insets(),
+ expansion: LayoutExpansion::new(true, true),
+ };
layout(&tree, LayoutContext {
loader: &self.loader,
scope: &self.std,
style: &self.style,
- base: self.style.page.size.unpadded(margins),
- spaces: vec![LayoutSpace {
- size: self.style.page.size,
- padding: margins,
- expansion: LayoutExpansion::new(true, true),
- }],
+ base: space.usable(),
+ spaces: vec![space],
repeat: true,
sys: LayoutSystem::new(Dir::LTR, Dir::TTB),
align: LayoutAlign::new(GenAlign::Start, GenAlign::Start),