Reserve full fraction extents in math layout

Fraction layout scaled numerator and denominator extents by 0.7 while painting
both at the full size, underestimating the box height and depth. Use the full
extents plus the bar clearance so the display equation no longer compresses its
fraction vertically.

Test count stays 1077.
This commit is contained in:
gloamxun committed 2026-10-28 00:39:05 +08:00
1 parent 764bc18850
commit 802526c352
3 files changed
+5 -4

No files matched your search

+2 -2
View File
@@ -1335,8 +1335,8 @@ pub fn layout_math(atom: &MathAtom, font: &Cmr10Metrics) -> MathBox {
.saturating_add(2 * 65_536);
MathBox {
width,
height: scaled(numerator_box.height + numerator_box.depth, 0.7) + 2 * 65_536,
depth: scaled(denominator_box.height + denominator_box.depth, 0.7) + 2 * 65_536,
height: numerator_box.height + numerator_box.depth + 2 * 65_536,
depth: denominator_box.height + denominator_box.depth + 2 * 65_536,
}
}
}