fix(math): center inline equations on the text line

The equation image is taller than a text line, and the paragraph FlowRow
top-aligned its items, so equations hung below the baseline. Center items
on the cross axis (itemVerticalAlignment) so the equation sits centered
on the line; no-op for the common all-text row where every item is the
same height.
This commit is contained in:
Claude
2026-06-09 01:20:13 +00:00
parent be06b7335b
commit 65b74fe150
@@ -395,6 +395,10 @@ fun RenderTextParagraph(
FlowRow(
modifier = modifier,
horizontalArrangement = Arrangement.spacedBy(spaceWidth),
// Center items on the cross axis so a taller item (an equation, whose image
// is taller than a text line) sits centered on the line instead of hanging
// below the baseline. No-op for the common all-text row.
itemVerticalAlignment = Alignment.CenterVertically,
) {
paragraph.words.forEach { word ->
renderWord(word)