Created
March 30, 2022 22:22
-
-
Save GiuseppeGiacoppo/7b944f66c37d7bfa09b07484adbd274a to your computer and use it in GitHub Desktop.
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
class TicketEdgeTreatment( | |
private val size: Float | |
): EdgeTreatment() { | |
override fun getEdgePath( | |
length: Float, | |
center: Float, | |
interpolation: Float, | |
shapePath: ShapePath | |
) { | |
val circleRadius = size * interpolation | |
shapePath.lineTo(center - circleRadius, 0f) | |
shapePath.addArc( | |
center - circleRadius, -circleRadius, | |
center + circleRadius, circleRadius, | |
180f, | |
-180f | |
) | |
shapePath.lineTo(length, 0f) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment