Open GoogleCodeExporter opened 8 years ago
Attaching test case that comes from Batik originally and is now used by Webkit
for
getTransformToElement.
Original comment by bradneub...@gmail.com
on 1 Dec 2009 at 6:26
Attachments:
The way I understand it, the method serves to obtain the transformation matrix
that
converts the coordinate system of one object into the system of the other. In
other
words it can be used to answer the question what are the coordinates of one
object in
the coordinate system of the other.
It can be implemented using getScreenCTM (although there might be a more
efficient
way to do it):
elem1.getTransformToElement(elem2)
is equivalent to:
function myGetTransformToElement(elem1, elem2)
{
return elem2.getScreenCTM().inverse().multiply(elem1.getScreenCTM());
}
In the attached file there is a quick demonstration of the function (tested in
Firefox).
Original comment by hannes.h...@gmail.com
on 12 Dec 2009 at 12:01
Attachments:
Original issue reported on code.google.com by
bradneub...@gmail.com
on 1 Dec 2009 at 6:16