Skip to content

Instantly share code, notes, and snippets.

@IMoHaMeDHaMdYI
Last active August 25, 2019 15:34
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 IMoHaMeDHaMdYI/ce3004386dbb041a8524d22575d580b9 to your computer and use it in GitHub Desktop.
Save IMoHaMeDHaMdYI/ce3004386dbb041a8524d22575d580b9 to your computer and use it in GitHub Desktop.
learn how to use arcTo
val path = Path()
val paint = Paint()
paint.apply {
strokeWidth = 20f
style = Paint.Style.FILL
}
path.apply {
moveTo(xCenter, yCenter)
arcTo(0f, 0f, width, height, 90f, -90f, false)
moveTo(xCenter, yCenter)
arcTo(0f, 0f, width, height, 180f, 90f, false)
moveTo(xCenter, yCenter)
arcTo(shadowSize, shadowSize, width - shadowSize, height - shadowSize, 270f, -90f, false)
}
canvas.drawPath(path,paint)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment