summaryrefslogtreecommitdiff
path: root/library/src/structure
diff options
context:
space:
mode:
Diffstat (limited to 'library/src/structure')
-rw-r--r--library/src/structure/heading.rs13
1 files changed, 7 insertions, 6 deletions
diff --git a/library/src/structure/heading.rs b/library/src/structure/heading.rs
index 87b522f7..e069e3a9 100644
--- a/library/src/structure/heading.rs
+++ b/library/src/structure/heading.rs
@@ -50,20 +50,21 @@ impl Finalize for HeadingNode {
_: StyleChain,
realized: Content,
) -> SourceResult<Content> {
- let size = Em::new(match self.level.get() {
+ let scale = match self.level.get() {
1 => 1.4,
2 => 1.2,
_ => 1.0,
- });
+ };
- let above = Em::new(if self.level.get() == 1 { 1.8 } else { 1.44 });
- let below = Em::new(0.66);
+ let size = Em::new(scale);
+ let above = Em::new(if self.level.get() == 1 { 1.8 } else { 1.44 }) / scale;
+ let below = Em::new(0.66) / scale;
let mut map = StyleMap::new();
map.set(TextNode::SIZE, TextSize(size.into()));
map.set(TextNode::WEIGHT, FontWeight::BOLD);
- map.set(BlockNode::ABOVE, VNode::strong(above.into()));
- map.set(BlockNode::BELOW, VNode::strong(below.into()));
+ map.set(BlockNode::ABOVE, VNode::block_around(above.into()));
+ map.set(BlockNode::BELOW, VNode::block_around(below.into()));
Ok(realized.styled_with_map(map))
}