xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Henric Rosvall" <henric.rosv...@swipnet.se>
Subject MouseEvnts in scrolled Canvas
Date Tue, 11 Apr 2006 15:15:35 GMT
Hi!
 
I have a class that inherits from JSVGCanvas, encapsulated in a
JSVGScrollPane. When I click somewhere in the canvas, I get a DOMMouseEvent
that reports the clientX and Y-coordinates, and this works great - if the
JSVGScrollPane isn't scolled. If I scroll down, it will still report the
same coordinate as when it's not scrolled at all, which causes a problem
when trying to select an object.
 
So, how do I convert the ClientX and ClientY-coordinates into
canvas-coordinates? (so a click at position 200, 300 with a JSVGScrollPane
scrolled down 500 px becomes 200, 1000)
 
Regards
Henric Rosvall

Mime
View raw message