snap.svg.zpd
snap.svg.zpd copied to clipboard
Snap.svg and zpd conflict during Snap.svg drag
I want only some elements to be draggeable. So I use Snap.svg's element.drag(). But this conflicts with the drag and pan functions from zpd.
Here is a quick workaround which prevent zpd from seeing the mousedown event when the element is managed by Snap.svg dragging code:
// Prevent zpd during a Snap.svg drag:
eve.on("snap.drag.start", function(x, y, e) {
e.stopPropagation();
});
Note: eve is Snap.svg's integrated event library.
Thanks @jlgrall But how?
I do appreciate the code above. Now, I have a concern and question on how to fix it. I can now drag the elments, however, they don't keep up with the mouse location. Is that normal? Is there a fix for that?
Thanks, Kim H.
Ok, I have learned a little more. The issue has to do with zooming out. The more you are zoomed out the worse the selected element move behind the mouse as you are moving it and it does not work well at all. so there is someplace that the mouse movement needs to take in to consideration the zoom level or something like that.
Thanks, Kim H.
Yup @khovorka This should be fixed!
Huei90, Do you mean the dragging of elements when zoomed out is fixed? If so is there a different download that is available as it does not work with what I currently have. Kim H.
"should be"
I haven't fixed it yet
Huei90,
Ok, thanks for the clarification. Do you have a time frame as I could use this as soon as possible.
Kim H.
@khovorka Unfortunately, I have no set time on this to fix. But I will fix ASAP.
Maybe you can trace code and help on fixing by PR?
Thanks :beers: