Skip to content

Instantly share code, notes, and snippets.

@akexorcist
Last active January 28, 2021 07:32
Show Gist options
  • Save akexorcist/ea39edd43df0aaaf640995517ca05820 to your computer and use it in GitHub Desktop.
Save akexorcist/ea39edd43df0aaaf640995517ca05820 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 {
/* ... */
// Top right corner
arcTo(
left = areaWidth - ((cornerRadius * 2f) + (borderWidth / 2f)),
top = borderWidth / 2f,
right = areaWidth - (borderWidth / 2f),
bottom = (cornerRadius * 2f) + (borderWidth / 2f),
startAngle = 270f,
sweepAngle = 90f,
forceMoveTo = false
)
/* ... */
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment