Skip to content

Instantly share code, notes, and snippets.

@tcw165
Created November 4, 2018 05:00
Show Gist options
  • Select an option

  • Save tcw165/3fd09df74853e6b2ec7efc45507a5767 to your computer and use it in GitHub Desktop.

Select an option

Save tcw165/3fd09df74853e6b2ec7efc45507a5767 to your computer and use it in GitHub Desktop.
fun Canvas.runSafely(
lambda: Canvas.() -> Unit
) {
val c = save()
lambda.invoke(this)
restoreToCount(c)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment