mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-16 13:59:27 +02:00
Don't dispatch drag start and move together
Drag start is responsible for switching into drag mode, classing stuff as `active` and kicking off a bunch of other things. If the drag move happens immediately after this, and includes the target from the initial active drag, it can cause weird snapping from the dragnode to its own parent way. (Happened if the user did a very fast drag from the node along the parent way just next to it)
This commit is contained in:
+10
-10
@@ -110,19 +110,19 @@ export function behaviorDrag() {
|
||||
if (dx === 0 && dy === 0)
|
||||
return;
|
||||
|
||||
if (!started) {
|
||||
started = true;
|
||||
_event({ type: 'start' });
|
||||
}
|
||||
|
||||
startOrigin = p;
|
||||
d3_eventCancel();
|
||||
|
||||
_event({
|
||||
type: 'move',
|
||||
point: [p[0] + offset[0], p[1] + offset[1]],
|
||||
delta: [dx, dy]
|
||||
});
|
||||
if (!started) {
|
||||
started = true;
|
||||
_event({ type: 'start' });
|
||||
} else {
|
||||
_event({
|
||||
type: 'move',
|
||||
point: [p[0] + offset[0], p[1] + offset[1]],
|
||||
delta: [dx, dy]
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user