Skip to content

Instantly share code, notes, and snippets.

@AndreVero
Last active February 27, 2024 15:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AndreVero/a63116c856c8138665e94fbd66c0616a to your computer and use it in GitHub Desktop.
Save AndreVero/a63116c856c8138665e94fbd66c0616a to your computer and use it in GitHub Desktop.
Save circles center inside map
val glovoUiItems = remember { mutableStateMapOf<Offset, GlovoItem>() }
// ...
val mainCircleOffset = Offset(x = circleCenter.x, y = circleCenter.y)
glovoUiItems[mainCircleOffset] = mainItem
// ...
val currentOffset = Offset(
x = mainCircleRadius.toPx() * cos(angleInRad) + circleCenter.x,
y = mainCircleRadius.toPx() * sin(angleInRad) + circleCenter.y
)
glovoUiItems[currentOffset] = item
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment