Project

General

Profile

Drag Drop have icon without offset during dragging

Added by Florian Ransmayr over 10 years ago

Hello everyone I have a question regarding drag and drop. I am developing an application where I can place items (lets say small images) on top of a background image. I need to be able to move them around by drag&drop later.

Generally that is working very well so far. My only problem is that the items move a little bit when I start the drag operation. I attached a small video that demonstrates the bahavior. Maybe I am just missing any attribute... I hope someone could help me on this issue.

Thanks a lot.


Replies (3)

RE: Drag Drop have icon without offset during dragging - Added by Florian Ransmayr over 10 years ago

I kind of figured out how to solve the "problem" for me... I created my own JavaScript drag&drop "library" und load it with WApplication::require("mylib").

The drag&drop feature of Wt doesn't take care of the initial drag Offset. I guess that's not neccessary for most of the applications anyway.

position 0,0 of the element
+-------------------------+
|\                        |
| \  (dragOffset)         |
|  \                      |
|   +  (clickposition     |
|       inside element)   |
+-------------------------+

Best Regards

Florian

RE: Drag Drop have icon without offset during dragging - Added by Koen Deforche over 10 years ago

Hey Florian,

Indeed we are not taking into account this offset, and that would indeed be a nice option. It deserves a feature request?

Regards,

koen

RE: Drag Drop have icon without offset during dragging - Added by Florian Ransmayr over 10 years ago

Hello koen,

I created the feature request fort this.

http://redmine.emweb.be/issues/2221

Thanks

Florian

    (1-3/3)