diff options
| author | Max <me@mkor.je> | 2024-10-10 15:52:55 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-10 15:52:55 +0000 |
| commit | b5b92e21e9ae345cd900602ddbc6e3a980f538f3 (patch) | |
| tree | 18c884424c1eca34c54948910bfe5b2f24889ff0 /crates | |
| parent | 92aacdb480286a8a1962a49843e0c271f6ef93a8 (diff) | |
Fix bug in `math.frac` layout code (#5177)
Diffstat (limited to 'crates')
| -rw-r--r-- | crates/typst/src/math/frac.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/crates/typst/src/math/frac.rs b/crates/typst/src/math/frac.rs index 3dd6960c..744a15c5 100644 --- a/crates/typst/src/math/frac.rs +++ b/crates/typst/src/math/frac.rs @@ -130,8 +130,9 @@ fn layout( )?; let around = FRAC_AROUND.at(font_size); - let num_gap = (shift_up - axis - num.descent()).max(num_min + thickness / 2.0); - let denom_gap = (shift_down + axis - denom.ascent()).max(denom_min + thickness / 2.0); + let num_gap = (shift_up - (axis + thickness / 2.0) - num.descent()).max(num_min); + let denom_gap = + (shift_down + (axis - thickness / 2.0) - denom.ascent()).max(denom_min); let line_width = num.width().max(denom.width()); let width = line_width + 2.0 * around; |
