diff --git a/crates/typst/src/math/ctx.rs b/crates/typst/src/math/ctx.rs index b93d7cc29..2c88fe3c9 100644 --- a/crates/typst/src/math/ctx.rs +++ b/crates/typst/src/math/ctx.rs @@ -1,3 +1,5 @@ +use std::f64::consts::SQRT_2; + use comemo::Prehashed; use ecow::EcoString; use rustybuzz::Feature; @@ -207,7 +209,8 @@ impl<'a, 'b, 'v> MathContext<'a, 'b, 'v> { let class = self.style.class.as_custom().or(glyph.class); if class == Some(MathClass::Large) { let mut variant = if self.style.size == MathSize::Display { - let height = scaled!(self, display_operator_min_height); + let height = scaled!(self, display_operator_min_height) + .max(SQRT_2 * glyph.height()); glyph.stretch_vertical(self, height, Abs::zero()) } else { glyph.into_variant() diff --git a/tests/ref/math/class.png b/tests/ref/math/class.png index c4a4cecc3..27844ebe1 100644 Binary files a/tests/ref/math/class.png and b/tests/ref/math/class.png differ