Copy pasting ColorPainter and replacing onDraw with
override fun DrawScope.onDraw() {
val outline = shape.createOutline(size, layoutDirection, this)
when (outline) {
is Outline.Generic -> {
drawPath(
outline.path,
color = color,
alpha = alpha,
colorFilter = colorFilter,
)
}
is Outline.Rectangle -> {
drawRect(color = color, alpha = alpha, colorFilter = colorFilter)
}
is Outline.Rounded -> {
// drawCircle maybe not what I want here exactly, but good enough for me for now
drawCircle(color = color, alpha = alpha, colorFilter = colorFilter)
}
}
}
Seems to work perfectly fine actually. In my case I only needed the
Outline.Generic
case, since I want to use
this squircle shape here, but I added the others just in case.