Slackbot
03/22/2025, 9:18 PMDovydas
03/22/2025, 9:20 PMBox(
contentAlignment = Alignment.Center,
modifier = modifier.size(300.dp).drawBehind {
val bounds = morph.getBounds()
val offsetX = (size.width - bounds.width) / 2f - bounds.left
val offsetY = (size.height - bounds.height) / 2f - <http://bounds.top|bounds.top>
withTransform({
translate(left = offsetX, top = offsetY)
}) {
drawPath(
path = morph,
color = colorScheme.secondaryContainer
)
}
})
{
content()
}
The size modifier has no effect since the path radius is defined above as a float. Is there a way to make the size modifier work? I could add a scale transformation but I think that would be difficult to manage with DP.Dovydas
03/23/2025, 12:19 PM