Struggling with `LineHeightStyle.Mode.Minimum` of ...
# compose
l
Struggling with
LineHeightStyle.Mode.Minimum
of
BasicText
, after diving into the source code, I found the
LineHeightStyleSpan
class, but the logic inside
Copy code
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?
What I'm doing is to workaround this issue https://kotlinlang.slack.com/archives/CJLTWPH7S/p1741651234253239 . My project has set
lineHeight
and I want to set
lineHeightStyle.mode
to
LineHeightStyle.Mode.Minimum
workaround.