Created
February 24, 2024 13:37
-
-
Save AndreVero/3c7860a04eef5300162659a8e1201cae to your computer and use it in GitHub Desktop.
Translate and scale function in Jetpack Compose
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
// Move our path to the new position | |
translate( | |
left = currentOffset.x - (pathBounds.right * iconScale) / 2, | |
top = currentOffset.y - 15.dp.toPx() - pathBounds.bottom | |
) { | |
// Increase path in 3 times | |
scale(scale = iconScale, pivot = pathBounds.topLeft) { | |
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