views:

18

answers:

1

I've got a long sequence of canvas .scale(), .translate(), .save(), and .restore() commands in my code.

Is there any way to retrieve some representation of the current transformation, short of logging everything myself, such that I can find out where a screen coordinate maps to a transformed coordinate.

Is this possible?

+2  A: 

Right now Canvas does not save the current transformation matrix (in a way you can retrieve). You have to keep track of it yourself. :(

Lots of libraries do this, offhand the only one I'm certain that does it is cake js

Here's a bit of talk about it when the cake.js author filed a bug for mozilla core (Firefox):

https://bugzilla.mozilla.org/show_bug.cgi?id=408804

Simon Sarris
Drat [ ](http://google.com)
Eric