Anyone aware of a bug where live-editing literals ...
# compose
c
Anyone aware of a bug where live-editing literals in Android Studio causes Canvas drawing to draw incorrectly?
I have the following simple canvas (copied verbatim):
Copy code
Canvas(
    modifier = Modifier
      .clickable {
        onClick()
      },
  ) {
    drawCircle(
      color = Color.White,
      radius = 96f,
      style = Stroke(8f),
    )
    drawRoundRect(
      color = Color.Red,
      topLeft = Offset(-42f, -42f),
      size = Size(84f, 84f),
      cornerRadius = CornerRadius(4f, 4f),
    )
  }
I am doing some live-editing of literals in a seemingly unrelated area of the code, and this is causing the
drawRoundRect
to ignore its
topLeft
Offset
The literal I’m editing is also in an
Offset
, in that case for a
Shadow
Restarting the app seems to fix it.
c
I’ve had this general issue with Canvas in Preview but yeah Live Literals causes some funky drawings often. Please file a bug on this if you can with screenshots. Would be very helpful for the team.
c
I have filed https://issuetracker.google.com/issues/218542098 with attached screenshots
c
Thank you!