Last active
November 4, 2018 04:52
-
-
Save tcw165/9f76a9b09bd580eec23b0564bbaaeff1 to your computer and use it in GitHub Desktop.
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
| inline fun Canvas.runSafely( | |
| lambda: Canvas.() -> Unit | |
| ) { | |
| val checkPoint = save() | |
| // "this" is Canvas | |
| lambda.invoke(this) | |
| restoreToCount(checkPoint) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment