I am attaching a test file to demonstrate this post.
I am attempting to implement getScreenCTM in ECMAScript (due to lack of Adobe support :-().
I am looking at the batik source in an attempt to understand how to do this. What I am trying to specifically understand is the relationship between the context.getGlobalTransform/context.getScreenTransform methods.
What I understand is this:
context.getScreenTransform: returns the matrix representing the mapping of 'pixel' space to user space. So if I have a document of width/height 200 and a window width/height (innerWidth/Height) of 400 then I will get a matrix (2 0 0 2 0 0) correct?
context.getGlobalTransform: returns the matrix representing the mapping of this element to the document root. So again if I have a rect (x/y=10w/h=100) in my 200*200 document I will get a matrix (2 0 0 2 10 10) correct?
If you look at my example you will see that I have an svg element within an svg element. So what I don't understand is how this affects the function of these methods, given that the elem.getScreenCTM works perfectly in both cases ;-) in Batik.
context.getScreenTransform: if I am picking up events from within an svg element that is not the root, does the output of this method give differing results i.e. do I need to calculate the original matrix for the root then multiply/concatenate to a new matrix for the current svg element.
context.getGlobalTransform: if my element is within an svg element that is not the root, how does this affect the matrix from this element to the root. Again does it need to be multiplied by any other factor.
Please forgive my ignorance on these matters but I have only a rudimentary grasp of 2d geometry.
Thanks in advance
Jamie
<<inline: Test.svg>>
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]