https://kotlinlang.org logo
#compose
Title
# compose
d

Dominaezzz

12/01/2020, 12:52 AM
translate { scale { rotate { drawImage(...) } } }
in what order are these transformations applied to the drawn image?
Nvm, just dunno how to use scale properly lol.
n

Nader Jawad

12/01/2020, 4:03 AM
The transformations are applied in the order in which they are used. In this case translate, scale and rotate in that order. If there are multiple transformations that are used for a single (or multiple) draw calls consider using the
withTransform
API that provides a scoped transformation block that will batch the transformations with a single save/restore call internally so its a bit more optimized and saves on indentation/curly braces
d

Dominaezzz

12/01/2020, 10:11 AM
Oh, for me the transformations are applied in the reverse order. (Which is what I was expecting)
Thanks for the
withTransform
hint.
11 Views