Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

SVG position in parent document

9 views
Skip to first unread message

Tony Cox

unread,
Sep 10, 2009, 5:26:04 PM9/10/09
to
I'm trying to get drag 'n' drop working in an SVG embedded in an XML
document (a Mozilla XUL document). To get the mouse pointer offset
working properly I need to know the offset of the origin of the SVG
document in the parent page. Could somebody advise me how to do that
please or point me to an example?

thanks

Tony

HelderMagalhaes

unread,
Sep 11, 2009, 10:02:41 AM9/11/09
to
Hi Tony,


> Could somebody advise me how to do that
> please or point me to an example?

This might help:
http://www.codedread.com/code.php#dragsvg


> thanks

Hope this helps,
Helder

Tony Cox

unread,
Sep 11, 2009, 10:52:20 AM9/11/09
to

aha, yes, the magic incantation is

getScreenCTM()

many thanks!

Tony


p.x = evt.clientX;
p.y = evt.clientY;
screenCTMInv = getScreenCTM().inverse();
p = p.matrixTransform(screenCTMInv);

0 new messages