diff options
| author | Laurenz <laurmaedje@gmail.com> | 2021-08-17 00:17:28 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2021-08-17 00:17:28 +0200 |
| commit | 9a798ce6f6e734a02764473891632c071fed41ee (patch) | |
| tree | cb433d5b6309f55799749c19eec8579d86bf36b2 /src/exec | |
| parent | 9462fb17b390c57846b9215217ca7c32b649f0a5 (diff) | |
Make percentages for h and v relative to area instead of font size
Diffstat (limited to 'src/exec')
| -rw-r--r-- | src/exec/context.rs | 4 | ||||
| -rw-r--r-- | src/exec/mod.rs | 2 |
2 files changed, 3 insertions, 3 deletions
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()), ], }); |
