diff options
| -rw-r--r-- | crates/typst-layout/src/math/accent.rs | 4 | ||||
| -rw-r--r-- | tests/ref/gradient-math-misc.png | bin | 2993 -> 2993 bytes | |||
| -rw-r--r-- | tests/ref/issue-math-realize-scripting.png | bin | 2610 -> 2605 bytes | |||
| -rw-r--r-- | tests/ref/math-accent-align.png | bin | 614 -> 625 bytes | |||
| -rw-r--r-- | tests/ref/math-accent-bounds.png | bin | 327 -> 327 bytes | |||
| -rw-r--r-- | tests/ref/math-accent-dotless.png | bin | 1026 -> 1024 bytes | |||
| -rw-r--r-- | tests/ref/math-accent-func.png | bin | 284 -> 284 bytes | |||
| -rw-r--r-- | tests/ref/math-accent-sym-call.png | bin | 926 -> 930 bytes | |||
| -rw-r--r-- | tests/ref/math-spacing-decorated.png | bin | 2385 -> 2375 bytes |
9 files changed, 2 insertions, 2 deletions
diff --git a/crates/typst-layout/src/math/accent.rs b/crates/typst-layout/src/math/accent.rs index 951870d6..f2dfa2c4 100644 --- a/crates/typst-layout/src/math/accent.rs +++ b/crates/typst-layout/src/math/accent.rs @@ -34,7 +34,7 @@ pub fn layout_accent( // Try to replace accent glyph with flattened variant. let flattened_base_height = scaled!(ctx, styles, flattened_accent_base_height); - if base.height() > flattened_base_height { + if base.ascent() > flattened_base_height { glyph.make_flattened_accent_form(ctx); } @@ -50,7 +50,7 @@ pub fn layout_accent( // minus the accent base height. Only if the base is very small, we need // a larger gap so that the accent doesn't move too low. let accent_base_height = scaled!(ctx, styles, accent_base_height); - let gap = -accent.descent() - base.height().min(accent_base_height); + let gap = -accent.descent() - base.ascent().min(accent_base_height); let size = Size::new(base.width(), accent.height() + gap + base.height()); let accent_pos = Point::with_x(base_attach - accent_attach); let base_pos = Point::with_y(accent.height() + gap); diff --git a/tests/ref/gradient-math-misc.png b/tests/ref/gradient-math-misc.png Binary files differindex acf14c6f..13f5c27b 100644 --- a/tests/ref/gradient-math-misc.png +++ b/tests/ref/gradient-math-misc.png diff --git a/tests/ref/issue-math-realize-scripting.png b/tests/ref/issue-math-realize-scripting.png Binary files differindex ee2d4cdf..7d721ed7 100644 --- a/tests/ref/issue-math-realize-scripting.png +++ b/tests/ref/issue-math-realize-scripting.png diff --git a/tests/ref/math-accent-align.png b/tests/ref/math-accent-align.png Binary files differindex 84e8dc8c..efc66ec3 100644 --- a/tests/ref/math-accent-align.png +++ b/tests/ref/math-accent-align.png diff --git a/tests/ref/math-accent-bounds.png b/tests/ref/math-accent-bounds.png Binary files differindex 6ddc5436..4c347d43 100644 --- a/tests/ref/math-accent-bounds.png +++ b/tests/ref/math-accent-bounds.png diff --git a/tests/ref/math-accent-dotless.png b/tests/ref/math-accent-dotless.png Binary files differindex 81eb4fa2..389ceb63 100644 --- a/tests/ref/math-accent-dotless.png +++ b/tests/ref/math-accent-dotless.png diff --git a/tests/ref/math-accent-func.png b/tests/ref/math-accent-func.png Binary files differindex 00821f70..fb3a8c6f 100644 --- a/tests/ref/math-accent-func.png +++ b/tests/ref/math-accent-func.png diff --git a/tests/ref/math-accent-sym-call.png b/tests/ref/math-accent-sym-call.png Binary files differindex 0837a86c..609197f3 100644 --- a/tests/ref/math-accent-sym-call.png +++ b/tests/ref/math-accent-sym-call.png diff --git a/tests/ref/math-spacing-decorated.png b/tests/ref/math-spacing-decorated.png Binary files differindex b8846ff0..2f3c704e 100644 --- a/tests/ref/math-spacing-decorated.png +++ b/tests/ref/math-spacing-decorated.png |
