summaryrefslogtreecommitdiff
path: root/crates/typst-layout/src/math/attach.rs
diff options
context:
space:
mode:
authorMax <max@mkor.je>2025-06-03 14:08:18 +0000
committerGitHub <noreply@github.com>2025-06-03 14:08:18 +0000
commitdd95f7d59474800a83a4d397dd13e34de35d56be (patch)
treecbdb7215ada833300cf07a2d138feba9e61173f2 /crates/typst-layout/src/math/attach.rs
parent1b399646c270d518af250db3afb7ba35992e8751 (diff)
Fix bottom accent positioning in math (#6187)
Diffstat (limited to 'crates/typst-layout/src/math/attach.rs')
-rw-r--r--crates/typst-layout/src/math/attach.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/crates/typst-layout/src/math/attach.rs b/crates/typst-layout/src/math/attach.rs
index e1d7d7c9..90aad941 100644
--- a/crates/typst-layout/src/math/attach.rs
+++ b/crates/typst-layout/src/math/attach.rs
@@ -434,9 +434,13 @@ fn compute_script_shifts(
}
if bl.is_some() || br.is_some() {
+ let descent = match &base {
+ MathFragment::Frame(frame) => frame.base_descent,
+ _ => base.descent(),
+ };
shift_down = shift_down
.max(sub_shift_down)
- .max(if is_text_like { Abs::zero() } else { base.descent() + sub_drop_min })
+ .max(if is_text_like { Abs::zero() } else { descent + sub_drop_min })
.max(measure!(bl, ascent) - sub_top_max)
.max(measure!(br, ascent) - sub_top_max);
}