Hi Doug! Thanks you for your example, it was very helpfull!! Great idea to set the listener on the root and the Backdrop trick! Thanks you again! But I wasn't able to do exactly the same thing because the shapes that I want to move are composed, so here what I have done :
<svg ... onmousemove="drag(evt)" onmouseup="drop(evt)"...> <g id="shape1" onmousedown="grab(evt)"> <g> <use ....> </g> <rec... /> <text .../> </g> ... </svg> As you can see, the onmousedown still remains on the g node to be able to retrieve the id of the whole shape when I click on only the rec or the use , etc... That's the only way I found to do that, without being dependent of the internal structure of my shape (the g node). After, I do the same thing as you : pointer-event="none" on onmousedown event , etc... What do you think about this? Thx Bruno --- In [email protected], "Doug Schepers" <[EMAIL PROTECTED]> wrote: > > Hi, Bruno- > > You may want to look at my little drag-and-drop example for inspiration. It > works according to the principle I suggested before: > > http://svg-whiz.com/svg/DragAndDrop.svg > > Regards- > Doug > > [EMAIL PROTECTED] > www.vectoreal.com ...for scalable solutions. > > Bruno wrote: > | > | Thanks for your answer. > | > | Your problem is common, though your diagnosis is probably > | not quite right. > | If you are putting the mousemove event on the target element > | itself, then > | you are losing the mousemove event when you exit the target > | element's area. > | ***Yes you're right, the g is sometimes not redrawn before my > | mouse pointer exits it. > | But as you have understood my g element is composed of two > | parts : a graphical one (use element) and a textual one (text > | element). When my mouse pointer is on the textual one it's > | working (I can't drag my g element as fast as I want) but on > | the graphical one , not... why? > | **** > | > | > | > | > | > | Instead, put it on the document root, and have a background > | rectangle that > | covers the whole viewport. That way, the mousemove events will still > | register even if you move too fast for the target element to > | follow, and the > | element will catch up when you slow down. > | *** > | I'm not sure : If I remove the mousemove from the target > | element, how can I know after on which g element was my > | mousepointer when the mousemove event was triggered... ? > | ***** > | > | Bruno > ------------------------ Yahoo! Groups Sponsor --------------------~--> Great things are happening at Yahoo! Groups. See the new email design. http://us.click.yahoo.com/TISQkA/hOaOAA/yQLSAA/1U_rlB/TM --------------------------------------------------------------------~-> ----- To unsubscribe send a message to: [EMAIL PROTECTED] -or- visit http://groups.yahoo.com/group/svg-developers and click "edit my membership" ---- Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/svg-developers/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/

