From 9a798ce6f6e734a02764473891632c071fed41ee Mon Sep 17 00:00:00 2001 From: Laurenz Date: Tue, 17 Aug 2021 00:17:28 +0200 Subject: Make percentages for h and v relative to area instead of font size --- src/exec/context.rs | 4 ++-- src/exec/mod.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/exec') diff --git a/src/exec/context.rs b/src/exec/context.rs index 9b235c29..2b0ef9fa 100644 --- a/src/exec/context.rs +++ b/src/exec/context.rs @@ -93,7 +93,7 @@ impl ExecContext { } /// Push spacing into the active paragraph or stack depending on the `axis`. - pub fn push_spacing(&mut self, axis: GenAxis, amount: Length) { + pub fn push_spacing(&mut self, axis: GenAxis, amount: Linear) { match axis { GenAxis::Main => { self.stack.finish_par(&self.state); @@ -114,7 +114,7 @@ impl ExecContext { pub fn parbreak(&mut self) { let amount = self.state.par_spacing(); self.stack.finish_par(&self.state); - self.stack.push_soft(StackChild::Spacing(amount)); + self.stack.push_soft(StackChild::Spacing(amount.into())); } /// Apply a forced page break. diff --git a/src/exec/mod.rs b/src/exec/mod.rs index dc3054d2..63e47995 100644 --- a/src/exec/mod.rs +++ b/src/exec/mod.rs @@ -119,7 +119,7 @@ fn exec_item(ctx: &mut ExecContext, label: EcoString, body: &SyntaxTree, map: &E aspect: None, children: vec![ StackChild::Any(label.into(), Gen::default()), - StackChild::Spacing(ctx.state.font.size / 2.0), + StackChild::Spacing((ctx.state.font.size / 2.0).into()), StackChild::Any(body.into(), Gen::default()), ], }); -- cgit v1.2.3