From d689d706eaf3079877406e71b0d642623c9eb230 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Sun, 12 Feb 2023 21:14:12 +0100 Subject: Vertically center non-math content in math by default --- library/src/math/mod.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'library/src') 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(()) -- cgit v1.2.3