dnd: Start implicit DnD from the original drag position

Locking the DnD actor to the pointer coordinates at the time of
starting a drag (e.g. after the DnD threshold) is going to look like
it lags behind.

Start the DnD operation at the button/touch press coordinates, so
the actor looks like it snaps to that position instead of being dragged
from there.
This commit is contained in:
Carlos Garnacho 2022-10-05 12:19:14 +02:00
parent 660f445b97
commit dbb853b1bb

View file

@ -501,7 +501,7 @@ var _Draggable = class _Draggable extends Signals.EventEmitter {
// Pointer devices (e.g. mouse) start the drag immediately
if (isPointerOrTouchpad || ellapsedTime > this._dragTimeoutThreshold) {
this.startDrag(stageX, stageY, event.get_time(), this._touchSequence, event.get_device());
this.startDrag(this._dragStartX, this._dragStartY, event.get_time(), this._touchSequence, event.get_device());
this._updateDragPosition(event);
} else {
this._dragThresholdIgnored = true;