Landerl Young
06/30/2026, 1:51 PMLineHeightStyle.Mode.Minimum of BasicText, after diving into the source code, I found the LineHeightStyleSpan class, but the logic inside
override fun chooseHeight(...) {
// some logic...
if (firstAscent == Int.MIN_VALUE) { // why? only calculate for the first line?
calculateTargetMetrics(fontMetricsInt)
}
fontMetricsInt.ascent = if (isFirstLine) firstAscent else ascent
fontMetricsInt.descent = if (isLastLine) lastDescent else descent
}
really made me confused.
Why is there an if guard, theratically, the ParagraphStyleSpan::chooseHeight is called for every line of a paragraph.
Is this a BUG?Landerl Young
06/30/2026, 2:01 PMlineHeight and I want to set lineHeightStyle.mode to LineHeightStyle.Mode.Minimum workaround.