Is there a more optimal way of creating alignment ...
# compose
p
Is there a more optimal way of creating alignment to the center of first text line?
Copy code
var centerLine by remember { mutableIntStateOf(0) }
Text(
    text = text,
    modifier = Modifier.alignBy { centerLine },
    onTextLayout = {
        val top = it.getLineTop(0)
        val bot = it.getLineBottom(0)
        centerLine = ((bot - top) / 2f).toInt()
    }
)
For reference, I'm aligning icon with first line of the text

https://miro.medium.com/v2/resize:fit:700/0*DBZmT0tfk_gRZnuR.png