If I do this:
g.translate(x, y);
g.rotate(a);
Then draw some images, the only way I know to undo/reset the transformations is to do the same thing in reverse with negative values.
g.rotate(-a);
g.translate(-x, -y);
Every once in a while images, that appear after I undo the transformations, that are not meant to be rotated, will flicker at an angle and with an offset. This leads me to believe that just doing a negative reverse isn’t working properly. Most of the time it’s fine, but it randomly happens a frame here and there.
So is there a (more) proper way to reset 2d transformations?