From a0f17e4b1715c94f06d32d019308f66f0b382923 Mon Sep 17 00:00:00 2001 From: mkorje Date: Tue, 10 Jun 2025 14:10:31 +1000 Subject: [PATCH] Update function name --- crates/typst-layout/src/math/text.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/crates/typst-layout/src/math/text.rs b/crates/typst-layout/src/math/text.rs index 018e162f1..02b5b5cc4 100644 --- a/crates/typst-layout/src/math/text.rs +++ b/crates/typst-layout/src/math/text.rs @@ -132,7 +132,7 @@ pub fn layout_symbol( elem.span(), ) { Some(mut glyph) => { - layout_glyph(&mut glyph, ctx, styles); + adjust_glyph_layout(&mut glyph, ctx, styles); glyph.into() } None => { @@ -146,8 +146,13 @@ pub fn layout_symbol( Ok(()) } -/// Layout a [`GlyphFragment`]. -fn layout_glyph(glyph: &mut GlyphFragment, ctx: &mut MathContext, styles: StyleChain) { +/// Centers large glyphs vertically on the axis, scaling them if in display +/// style. +fn adjust_glyph_layout( + glyph: &mut GlyphFragment, + ctx: &mut MathContext, + styles: StyleChain, +) { let math_size = EquationElem::size_in(styles); if glyph.class == MathClass::Large { if math_size == MathSize::Display {