Skip to content

Instantly share code, notes, and snippets.

@akexorcist
Last active January 28, 2021 07:32
Show Gist options
  • Save akexorcist/cc971c56684a504434f2393220fbb92e to your computer and use it in GitHub Desktop.
Save akexorcist/cc971c56684a504434f2393220fbb92e to your computer and use it in GitHub Desktop.
val canvas: Canvas = /* ... */
val areaWidth = canvas.width
val areaHeight = canvas.height
val borderWidth = 2
val cornerRadius = 10
val semiCircleRadius = 20
val path = Path().apply {
/* ... */
// Right edge semi circle
arcTo(
left = (areaWidth / 2f) - ((semiCircleRadius / 2f) + (borderWidth / 2f)),
top = (areaHeight / 2f) - (semiCircleRadius / 2f),
right = (areaWidth / 2f) + ((semiCircleRadius / 2f) - (borderWidth / 2f)),
bottom = (areaHeight / 2f) + (semiCircleRadius / 2f),
startAngle = 270,
sweepAngle = -180,
forceMoveTo = false)
/* ... */
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment