Skip to content

Instantly share code, notes, and snippets.

@CMyae
Last active September 18, 2019 09:38
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 CMyae/d6c10f6e6787a069250c8f523abaf8fb to your computer and use it in GitHub Desktop.
Save CMyae/d6c10f6e6787a069250c8f523abaf8fb to your computer and use it in GitHub Desktop.
Code snippet for calculating connection points
private fun calculateConnectionPointsForBezierCurve() {
try {
for (i in 1 until points.size) {
conPoint1.add(PointF((points[i].x + points[i - 1].x) / 2, points[i - 1].y))
conPoint2.add(PointF((points[i].x + points[i - 1].x) / 2, points[i].y))
}
} catch (e: Exception) {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment