mirror of
https://github.com/typst/typst
synced 2025-08-24 11:44:12 +08:00
Update function name
This commit is contained in:
parent
3b2bb9bbcc
commit
a0f17e4b17
@ -132,7 +132,7 @@ pub fn layout_symbol(
|
|||||||
elem.span(),
|
elem.span(),
|
||||||
) {
|
) {
|
||||||
Some(mut glyph) => {
|
Some(mut glyph) => {
|
||||||
layout_glyph(&mut glyph, ctx, styles);
|
adjust_glyph_layout(&mut glyph, ctx, styles);
|
||||||
glyph.into()
|
glyph.into()
|
||||||
}
|
}
|
||||||
None => {
|
None => {
|
||||||
@ -146,8 +146,13 @@ pub fn layout_symbol(
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Layout a [`GlyphFragment`].
|
/// Centers large glyphs vertically on the axis, scaling them if in display
|
||||||
fn layout_glyph(glyph: &mut GlyphFragment, ctx: &mut MathContext, styles: StyleChain) {
|
/// style.
|
||||||
|
fn adjust_glyph_layout(
|
||||||
|
glyph: &mut GlyphFragment,
|
||||||
|
ctx: &mut MathContext,
|
||||||
|
styles: StyleChain,
|
||||||
|
) {
|
||||||
let math_size = EquationElem::size_in(styles);
|
let math_size = EquationElem::size_in(styles);
|
||||||
if glyph.class == MathClass::Large {
|
if glyph.class == MathClass::Large {
|
||||||
if math_size == MathSize::Display {
|
if math_size == MathSize::Display {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user