diff options
| author | Laurenz <laurmaedje@gmail.com> | 2023-02-12 21:14:12 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2023-02-12 21:14:12 +0100 |
| commit | d689d706eaf3079877406e71b0d642623c9eb230 (patch) | |
| tree | ad0a4b27f919d34d83eacb5ca758293a7e6810f9 /library/src/math | |
| parent | e70fbf5372dcf0c9011f0b7799dfa77194401c4f (diff) | |
Vertically center non-math content in math by default
Diffstat (limited to 'library/src/math')
| -rw-r--r-- | library/src/math/mod.rs | 6 |
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(()) |
