Skip to content

Instantly share code, notes, and snippets.

@aqua30
Created June 14, 2022 09:06
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 aqua30/163e329499b39574ec7884acba766a91 to your computer and use it in GitHub Desktop.
Save aqua30/163e329499b39574ec7884acba766a91 to your computer and use it in GitHub Desktop.
/** drawing the path */
val stroke = Path().apply {
reset()
moveTo(coordinates.first().x, coordinates.first().y)
for (i in 0 until coordinates.size - 1) {
cubicTo(
controlPoints1[i].x,controlPoints1[i].y,
controlPoints2[i].x,controlPoints2[i].y,
coordinates[i + 1].x,coordinates[i + 1].y
)
}
}
drawPath(
stroke,
color = Color.Black,
style = Stroke(
width = 5f,
cap = StrokeCap.Round
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment