views:

7

answers:

0

All,

Am working on an SVG application that requires an object to be moved from one location to another.

I have implemented drag and drop, however, upon mousedown, I want the cursor to 'grab' the object from the centre of that object. I also want to predefine that centre point.

As an example, if there is a circle, when the user clicks anywhere on that circle, the mouse attaches to the centre of that circle. Similarly there will be various objects built with 'paths' in SVG, for which I will predefine the centre point.

Any suggestions for how to go about implementing this in javascript please?

Cheers,