Skip to content

Instantly share code, notes, and snippets.

@akexorcist
Last active January 28, 2021 07:32
Show Gist options
  • Save akexorcist/1edd91cc2fe68242bd94971a5d317070 to your computer and use it in GitHub Desktop.
Save akexorcist/1edd91cc2fe68242bd94971a5d317070 to your computer and use it in GitHub Desktop.
val canvas: Canvas = /* ... */
val paint: Paint = /* ... */
val path = Path().apply {
reset()
moveTo(/* Start point */)
arcTo(/* Top right corner */) // 1
arcTo(/* Right edge semi circle */) // 2
arcTo(/* Bottom right corner */) // 3
arcTo(/* Bottom edge semi circle */) // 4
arcTo(/* Bottom left corner */) // 5
arcTo(/* Left edge semi circle */) // 6
arcTo(/* Top left corner */) // 7
arcTo(/* Top edge semi circle */) // 8
close()
}
canvas.drawPath(path, paint)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment