Last active
August 25, 2019 15:34
-
-
Save IMoHaMeDHaMdYI/ce3004386dbb041a8524d22575d580b9 to your computer and use it in GitHub Desktop.
learn how to use arcTo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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