Slippery Nodes

I’ve noticed a difference in the behavior between dragging a node from my palette onto the diagram vs dragging around a node already on the diagram . When I drag from the palette, the node will follow my cursor around as long as I have the left mouse button down - no matter how fast I move the mouse. I believe this is the desired behavior. However, when I drag nodes already on my design surface, they are dropped easily by the mouse as soon as the mouse gets too far ahead of the node. What would the difference be between these operations, and how can I improve the on-diagram drag experience?

Are you saying that sometimes (always?) when dragging a node within a diagram it will be dropped somewhere even though you keep the left mouse button down during the whole dragging operation?

The same code is executing within the (target) diagram for both external drag-and-drops and for internal drag-and-drops, once the external one has constructed the temporary node(s) representing the dragged data.

I had never noticed any difference in performance between the two cases, as long as I was dragging the same kind of node and same number in both cases. Of course if the internal drag-and-drop case also has links connected to the dragged node(s), there’s non-trivial overhead involved in continually re-routing and re-rendering the links.

Yes, if I attempt to drag an existing node on the diagram, it is dropped if I move the mouse too quickly during the dragging operation although I have the left mouse button held down.

I can’t seem to drop a node from the palette now matter how quickly I move the mouse around the diagram. Isn’t the temporary node ‘on’ a temporary layer during the drag from the palette to the diagram?

The number of links definitely affect this, however it will still occur if the node is not connected. Could data binding affect this as well?

I added a border with a transparent Background and some Padding between the NodePanel and the existing node contents to provide a larger area to grab onto and still be “in” the node during a drag. This reduces, but does not eliminate the drop.

Am I expecting too much from the dragging tool if links and data-binding are involved?

That’s very unusual – I’ve never heard of that kind of behavior before. (I’m talking about the drop happening without letting go of the left mouse button.) Are you sure there aren’t any errors or warnings going on during the whole drag-and-drop operation? That’s my best guess to explain the behavior. Besides the trace listener output, try setting breakpoints on exceptions.

Yes, the temporary nodes are on the Tool layer.

Practically every operation involves the model, its data, and data-binding.