summaryrefslogtreecommitdiff
path: root/library/src
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2023-02-12 21:14:12 +0100
committerLaurenz <laurmaedje@gmail.com>2023-02-12 21:14:12 +0100
commitd689d706eaf3079877406e71b0d642623c9eb230 (patch)
treead0a4b27f919d34d83eacb5ca758293a7e6810f9 /library/src
parente70fbf5372dcf0c9011f0b7799dfa77194401c4f (diff)
Vertically center non-math content in math by default
Diffstat (limited to 'library/src')
-rw-r--r--library/src/math/mod.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/library/src/math/mod.rs b/library/src/math/mod.rs
index 85bf56ca..76dcdc2e 100644
--- a/library/src/math/mod.rs
+++ b/library/src/math/mod.rs
@@ -294,7 +294,11 @@ impl LayoutMath for Content {
return node.layout_math(ctx);
}
- let frame = ctx.layout_content(self)?;
+ let mut frame = ctx.layout_content(self)?;
+ if !frame.has_baseline() {
+ let axis = scaled!(ctx, axis_height);
+ frame.set_baseline(frame.height() / 2.0 + axis);
+ }
ctx.push(FrameFragment::new(ctx, frame).with_spaced(true));
Ok(())