Skip to content

Instantly share code, notes, and snippets.

@bitvale
Created January 7, 2019 13:36
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 bitvale/fb7d2b0dac8c710a30dbd4ddb510bb17 to your computer and use it in GitHub Desktop.
Save bitvale/fb7d2b0dac8c710a30dbd4ddb510bb17 to your computer and use it in GitHub Desktop.
For Medium article "The power of Android Porter/Duff Mode"
val topY = textPaint.ascent() * -1 - textBounds.height()
lightPath.moveTo(lightPivotX - letterWidth / 2f, topY)
lightPath.moveTo(lightPivotX + letterWidth / 2f, topY)
lightPath.lineTo(lightPivotX + width / 2f, width.toFloat())
lightPath.lineTo(lightPivotX - width / 2f, width.toFloat())
lightPath.lineTo(lightPivotX - letterWidth / 2f, topY)
lightPath.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment