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/16d6dc6559e6ed2d268d81fb2ddfca62 to your computer and use it in GitHub Desktop.
Save CMyae/16d6dc6559e6ed2d268d81fb2ddfca62 to your computer and use it in GitHub Desktop.
Draw first bezier curve
private fun drawBezierCurve(canvas: Canvas?) {
try {
if (points.isEmpty() && conPoint1.isEmpty() && conPoint2.isEmpty()) return
path.reset()
path.moveTo(points.first().x, points.first().y)
for (i in 1 until points.size) {
path.cubicTo(
conPoint1[i - 1].x, conPoint1[i - 1].y, conPoint2[i - 1].x, conPoint2[i - 1].y,
points[i].x, points[i].y
)
}
borderPath.set(path)
canvas?.drawPath(borderPath, borderPathPaint)
} catch (e: Exception) {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment