Read current rotate and translate values? Or HT unRotate() and unTranslate() without popMatrix()?

edited October 2013 in How To...

I have some code that gets called from many different places, some of which have the canvas rotate()'d and/or translate()'d (some do not). In this code I need to place a footer on the canvas regardless of any rotations or translations. The rest of the code does use pushMatrix() and popMatrix() as expected, it's just this particular block that's sometimes called mid-stream. Is there a way to retrieve, and temporarily undo, any transformations?

Any help greatly appreciated...

Answers

  • edited October 2013

    resetMatrix() resets canvas matrix independently of pushMatrix() & popMatrix(). %%-

    You might want to use pushMatrix() before resetMatrix() if you need to get back to previous matrix state though.
    Then use popMatrix() after done w/ resetMatrix() drawings.

Sign In or Register to comment.