summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--crates/typst/src/math/ctx.rs5
-rw-r--r--tests/ref/math/class.pngbin6454 -> 6460 bytes
2 files changed, 4 insertions, 1 deletions
diff --git a/crates/typst/src/math/ctx.rs b/crates/typst/src/math/ctx.rs
index b93d7cc2..2c88fe3c 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 c4a4cecc..27844ebe 100644
--- a/tests/ref/math/class.png
+++ b/tests/ref/math/class.png
Binary files differ