Last active
February 24, 2024 13:15
-
-
Save AndreVero/0e084ab4eb7a84afefb9e2c70b437fc0 to your computer and use it in GitHub Desktop.
Translate extension
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Get the path bounds to translate | |
// path exactly to the center of the circle | |
val pathBounds = item.path.getBounds() | |
// Move our path to the new position | |
translate( | |
left = currentOffset.x - pathBounds.right / 2, | |
top = currentOffset.y - 15.dp.toPx() - pathBounds.bottom | |
) { | |
drawPath( | |
path = item.path, | |
color = Color.Black | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment