mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-08-10 00:16:59 +00:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user