DEV Community

Discussion on: Drawing and painting in Jetpack Compose #1

Collapse
 
varshakulkarni profile image
Varsha Kulkarni • Edited
drawCircle(
  Color.Red, 64f,
  Offset(size.width / 2, size.height / 2),
  style = Stroke(width = 8f,
    pathEffect = DashPathEffect(floatArrayOf(10f, 10f), 0f)
  ),
)
Enter fullscreen mode Exit fullscreen mode

I keep getting this error after upgrading to beta. How do we solve that?
"Type mismatch: inferred type is DashPathEffect but PathEffect was expected."

Collapse
 
tkuenneth profile image
Thomas Künneth

I'll loook into this shortly. Will keep you posted.

Collapse
 
varshakulkarni profile image
Varsha Kulkarni • Edited

Got a workaround for this.

drawCircle(
  Color.Red, 64f,
  Offset(size.width / 2, size.height / 2),
  style = Stroke(width = 8f,
    pathEffect = DashPathEffect(floatArrayOf(10f, 10f), 0f)
  ),
)
Enter fullscreen mode Exit fullscreen mode

This has to be changed to this:

drawCircle(
  Color.Red, 64f,
  Offset(size.width / 2, size.height / 2),
  style = Stroke(width = 8f,
    pathEffect = PathEffect.dashPathEffect(floatArrayOf(10f, 10f), 0f)
  ),
)
Enter fullscreen mode Exit fullscreen mode