Hello, is there any modifier to apply rotation? My...
# compose
b
Hello, is there any modifier to apply rotation? My use case:
Copy code
Stack {
   Image(Modifier.alignment(Alignment.Center)) // want to center & rotate 45 degrees
}
y
Modifier.layer(rotationX = ..., rotationY = ..., transformOrigin = TransformOrigin.Center)
🙌 1
👆🏼 1
the
layer
modifier handles stuff like alpha, scale, rotation, translation, ...
b
thank you @Yann Badoual, that's exactly what I needed
for the Compose team: it took me a while to figure out that I needed to use
rotationZ
... Maybe it's just my lack of initial understanding of rotating axes, but perhaps the kdocs for
drawLayer
rotation params can elaborate a bit more, maybe include samples? Or maybe even provide a more straightforward extension with samples? (i.e. similar to
drawOpacity
for alpha)