snap.svg.zpd icon indicating copy to clipboard operation
snap.svg.zpd copied to clipboard

Snap.svg and zpd conflict during Snap.svg drag

Open jlgrall opened this issue 10 years ago • 8 comments

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.

jlgrall avatar Nov 29 '14 16:11 jlgrall

Thanks @jlgrall But how?

hueitan avatar Dec 01 '14 01:12 hueitan

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.

ghost avatar Jan 16 '15 23:01 ghost

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.

ghost avatar Jan 16 '15 23:01 ghost

Yup @khovorka This should be fixed!

hueitan avatar Jan 17 '15 02:01 hueitan

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.

ghost avatar Jan 17 '15 05:01 ghost

"should be"

I haven't fixed it yet

hueitan avatar Jan 17 '15 05:01 hueitan

Huei90,

Ok, thanks for the clarification. Do you have a time frame as I could use this as soon as possible.

Kim H.

ghost avatar Jan 18 '15 02:01 ghost

@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:

hueitan avatar Jan 19 '15 03:01 hueitan