Skip to content

Instantly share code, notes, and snippets.

@GiuseppeGiacoppo
Created March 30, 2022 22:22
Show Gist options
  • Save GiuseppeGiacoppo/7b944f66c37d7bfa09b07484adbd274a to your computer and use it in GitHub Desktop.
Save GiuseppeGiacoppo/7b944f66c37d7bfa09b07484adbd274a to your computer and use it in GitHub Desktop.
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