I still suck at drawing with canvas. Hopefully a s...
# compose-android
c
I still suck at drawing with canvas. Hopefully a simple question. I can't use a CornerRadius of 4.dp here. Need px. What's would be the preferred way to get px here?
Copy code
Box(
    modifier.drawWithContent {
        drawRoundRect(
            Color.Black,
            style = Fill,
            cornerRadius = CornerRadius(4.dp)
        )
    })
l
Copy code
Box(
    modifier.drawWithContent {
        drawRoundRect(
            Color.Black,
            style = Fill,
            cornerRadius = CornerRadius(4.dp.toPx())
        )
    })
`drawWithContent`’s scope extends
Density
, so you can convert directly inside this block
c
amazing. okay that simplify all of the composition local stuff i was doing. i knew i was missing something simple. thanks for teaching