Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > SVG coordinates

Reply
Thread Tools

SVG coordinates

 
 
google@durandal.nl
Guest
Posts: n/a
 
      12-02-2004
Hello,

Using ECMA script within an SVG document i'm looking for
a way to display an overlay window (rectangle) that follows
the mouse cursor an shows some information.

It boils down to getting the coordinates of the mouse
cursor in the SVG document. While evt.clientX/Y will give
you the pixel coordinates relative to the topleft of the SVG
document, it does not, however, has the same scale or position
of that document's coordinates.

In short; evt.clientX/Y (and evt.screenX/Y) give pixel coordinates,
not document coordinates, and to have a rectangle follow the mouse i
need to draw it in document coordinates.
Any help?

(Using Adobe SVG viewer 3.0 and latest IE)

 
Reply With Quote
 
 
 
 
Jim Ley
Guest
Posts: n/a
 
      12-02-2004
On 2 Dec 2004 03:03:38 -0800, http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:

>In short; evt.clientX/Y (and evt.screenX/Y) give pixel coordinates,
>not document coordinates, and to have a rectangle follow the mouse i
>need to draw it in document coordinates.


You use viewBox.js from Kevin Lindsey

http://www.kevlindev.com/gui/utilities/viewbox/

(or the equivalent maths simplified to your viewBox)

Jim.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SVG] probleme dessin d'images SVG avec Batik Mardagg Java 0 05-12-2006 02:13 PM
[SVG] problem with SVG image drawing with Batik Library Mardagg Java 0 05-12-2006 02:12 PM
[SVG] using image-tag to integrate SVG in SVG Arne Nordmann XML 0 06-28-2004 01:16 PM
Converting canvas coordinates to window coordinates in tkinter......... Suresh Kumar Python 0 07-04-2003 10:14 AM
Converting canvas coordinates to window coordinates....... Suresh Kumar Python 0 07-03-2003 04:53 AM



Advertisments