From 65b74fe15003ed8818bbd2f314f3fae4d4e584bd Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 9 Jun 2026 01:20:13 +0000 Subject: [PATCH] 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. --- .../vitorpamplona/amethyst/ui/components/RichTextViewer.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/components/RichTextViewer.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/components/RichTextViewer.kt index cd82b3d6f2..7192c486a2 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/components/RichTextViewer.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/components/RichTextViewer.kt @@ -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)