Last active
March 21, 2019 15:24
-
-
Save riggaroo/e1e5f00911cefe4fbf6c8c6f9a2dbb3b to your computer and use it in GitHub Desktop.
Custom Drawing on Canvas without KTX
This file contains hidden or 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 translateCheckpoint = canvas.save() | |
canvas.translate(200f, 300f) | |
canvas.drawCircle(150f, 150f, RADIUS, circlePaint) // drawn on the translated canvas | |
val rotateCheckpoint = canvas.save() | |
canvas.rotate(45f) | |
canvas.drawRect(rect, rectPaint) // drawn on the translated and rotated canvas | |
canvas.restoreToCount(rotateCheckpoint) | |
canvas.restoreToCount(translateCheckpoint) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment