Dominaezzz

    Dominaezzz

    1 year ago
    translate { scale { rotate { drawImage(...) } } }
    in what order are these transformations applied to the drawn image?
    Nvm, just dunno how to use scale properly lol.
    Nader Jawad

    Nader Jawad

    1 year ago
    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
    Dominaezzz

    Dominaezzz

    1 year ago
    Oh, for me the transformations are applied in the reverse order. (Which is what I was expecting)
    Thanks for the
    withTransform
    hint.