Skip to content

Instantly share code, notes, and snippets.

@zurche
Created August 11, 2023 14:04
Show Gist options
  • Save zurche/1ae72a1ceedb10e9b92f35b1218c1adb to your computer and use it in GitHub Desktop.
Save zurche/1ae72a1ceedb10e9b92f35b1218c1adb to your computer and use it in GitHub Desktop.
@Composable
@Preview(showBackground = true)
fun BezierTest() {
Canvas(modifier = Modifier.size(300.dp), onDraw = {
val path = Path().apply {
val width = size.width // Capturing all the available width
val height = size.height // Capturing all the available height
// Top left corner
// Move the start point to 2% of height for x and 25% of the height for y
moveTo(x = height.times(.02f), y = height.times(.25f))
}
drawPath(path = path, color = CryptoOrange)
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment