This message was deleted.
# compose
s
This message was deleted.
d
Copy code
Box(
        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.
Silly question, nvm