Scale inline math proportionally

Inline math in a 12pt paragraph kept 10pt glyphs because paint_math advances
with 10pt metrics. Paint the math atom into a temporary display list at the
10pt baseline and scale that list as a unit (text sizes and positions, rule
widths/heights, line endpoints) to the paragraph size before translating it to
the baseline. The box no longer pins its size, so a scaled math glyph now
reports font-size 12.000 in a 12pt paragraph.

The twelve-point test now also asserts that an italic math glyph is rendered at
the paragraph size; the sized-paragraph test still expects a math box and no
literal dollars.
This commit is contained in:
gloamxun committed 2026-10-27 01:36:59 +08:00
1 parent b3fbbc8dda
commit 88a03ec1a1
5 files changed
+62 -17

No files matched your search

+1 -1
View File
@@ -2055,7 +2055,7 @@ pub fn layout_paragraph_segments(segments: &[InlineSegment], style: &ParagraphSt
italic: 0,
font: None,
math: Some(Box::new(atom.clone())),
size: Some(655_360),
size: None,
raise: 0,
color: None,
background: None,