summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--crates/typst-layout/src/math/accent.rs4
-rw-r--r--tests/ref/gradient-math-misc.pngbin2993 -> 2993 bytes
-rw-r--r--tests/ref/issue-math-realize-scripting.pngbin2610 -> 2605 bytes
-rw-r--r--tests/ref/math-accent-align.pngbin614 -> 625 bytes
-rw-r--r--tests/ref/math-accent-bounds.pngbin327 -> 327 bytes
-rw-r--r--tests/ref/math-accent-dotless.pngbin1026 -> 1024 bytes
-rw-r--r--tests/ref/math-accent-func.pngbin284 -> 284 bytes
-rw-r--r--tests/ref/math-accent-sym-call.pngbin926 -> 930 bytes
-rw-r--r--tests/ref/math-spacing-decorated.pngbin2385 -> 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
index acf14c6f..13f5c27b 100644
--- a/tests/ref/gradient-math-misc.png
+++ b/tests/ref/gradient-math-misc.png
Binary files differ
diff --git a/tests/ref/issue-math-realize-scripting.png b/tests/ref/issue-math-realize-scripting.png
index ee2d4cdf..7d721ed7 100644
--- a/tests/ref/issue-math-realize-scripting.png
+++ b/tests/ref/issue-math-realize-scripting.png
Binary files differ
diff --git a/tests/ref/math-accent-align.png b/tests/ref/math-accent-align.png
index 84e8dc8c..efc66ec3 100644
--- a/tests/ref/math-accent-align.png
+++ b/tests/ref/math-accent-align.png
Binary files differ
diff --git a/tests/ref/math-accent-bounds.png b/tests/ref/math-accent-bounds.png
index 6ddc5436..4c347d43 100644
--- a/tests/ref/math-accent-bounds.png
+++ b/tests/ref/math-accent-bounds.png
Binary files differ
diff --git a/tests/ref/math-accent-dotless.png b/tests/ref/math-accent-dotless.png
index 81eb4fa2..389ceb63 100644
--- a/tests/ref/math-accent-dotless.png
+++ b/tests/ref/math-accent-dotless.png
Binary files differ
diff --git a/tests/ref/math-accent-func.png b/tests/ref/math-accent-func.png
index 00821f70..fb3a8c6f 100644
--- a/tests/ref/math-accent-func.png
+++ b/tests/ref/math-accent-func.png
Binary files differ
diff --git a/tests/ref/math-accent-sym-call.png b/tests/ref/math-accent-sym-call.png
index 0837a86c..609197f3 100644
--- a/tests/ref/math-accent-sym-call.png
+++ b/tests/ref/math-accent-sym-call.png
Binary files differ
diff --git a/tests/ref/math-spacing-decorated.png b/tests/ref/math-spacing-decorated.png
index b8846ff0..2f3c704e 100644
--- a/tests/ref/math-spacing-decorated.png
+++ b/tests/ref/math-spacing-decorated.png
Binary files differ