Skip to content

Commit 9e73001

Browse files
committed
fix(mover): Pass drag delta to dragger.onDrag in pixels
Fixes #446
1 parent 979ef10 commit 9e73001

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

src/actions/mover.ts

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -202,10 +202,7 @@ export class Mover {
202202
finishMove(workspace: WorkspaceSvg) {
203203
const info = this.preDragEndCleanup(workspace);
204204

205-
info.dragger.onDragEnd(
206-
info.fakePointerEvent('pointerup'),
207-
new utils.Coordinate(0, 0),
208-
);
205+
info.dragger.onDragEnd(info.fakePointerEvent('pointerup'));
209206

210207
this.postDragEndCleanup(workspace, info);
211208
return true;
@@ -236,10 +233,7 @@ export class Mover {
236233
// @ts-expect-error Access to private property connectionCandidate.
237234
dragStrategy.connectionCandidate = null;
238235

239-
info.dragger.onDragEnd(
240-
info.fakePointerEvent('pointerup'),
241-
info.startLocation,
242-
);
236+
info.dragger.onDragEnd(info.fakePointerEvent('pointerup'));
243237

244238
if (dragStrategy.isNewBlock && target) {
245239
workspace.getCursor()?.setCurNode(target);
@@ -301,7 +295,7 @@ export class Mover {
301295

302296
info.dragger.onDrag(
303297
info.fakePointerEvent('pointermove', direction),
304-
info.totalDelta,
298+
info.totalDelta.clone().scale(workspace.scale),
305299
);
306300

307301
info.updateTotalDelta();
@@ -326,7 +320,10 @@ export class Mover {
326320
info.totalDelta.x += x * UNCONSTRAINED_MOVE_DISTANCE * workspace.scale;
327321
info.totalDelta.y += y * UNCONSTRAINED_MOVE_DISTANCE * workspace.scale;
328322

329-
info.dragger.onDrag(info.fakePointerEvent('pointermove'), info.totalDelta);
323+
info.dragger.onDrag(
324+
info.fakePointerEvent('pointermove'),
325+
info.totalDelta.clone().scale(workspace.scale),
326+
);
330327
this.scrollCurrentBlockIntoView(workspace);
331328
return true;
332329
}

0 commit comments

Comments
 (0)