Shift-drag is just panning the canvas and not moving the actual elements in
relation to the canvas.
If you want to move elements you need to:
* detect which element was clicked on
* keep track of the first point you click at
* get mouseMove events as it is dragged so that you can calculate the delta
between the first click point and the current mouse position
* modify the elements position either by changing the location attributes or
by adding and modifying a transform=translate(x,y) attribute using that
delta
Hope that helps,
Phil
On 12/5/06, vyang <[EMAIL PROTECTED]> wrote:
I'm moving the rectangles within JSVGCanvas by holding the shift key and
dragging the rectangles in JSVGCanvas. I want to update this movement
within JSVGCanvas to the document. What methods/class do I need to be
able
to do this?
Hi V,
vyang <[EMAIL PROTECTED]> wrote on 12/05/2006 09:31:30 AM:
> However, all I'm getting is the orginal coordinates.
> Here is my test coding:
I don't see anything that is changing the location
of the rectangles below. How are you moving the
rects? If you are updating the transform then
you probably need to use something like 'getScreenCTM()'
to map the X/Y back to screen coords.
--
View this message in context:
http://www.nabble.com/JSVGCanvas-Update-tf2740725.html#a7700910
Sent from the Batik - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
Visit http://www.darkisle.com for photos of castles, cairns and other
historic sites in the British Isles.