Skip to content

Commit 24c654b

Browse files
committed
chore: Drag controller state assignments
1 parent c3878e5 commit 24c654b

File tree

1 file changed

+2
-2
lines changed
  • src/components/common/controllers

1 file changed

+2
-2
lines changed

src/components/common/controllers/drag.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -409,13 +409,13 @@ class DragController implements ReactiveController {
409409
const posX = this._hasSnapping ? clientX - layerX : clientX - layerX + x;
410410
const posY = this._hasSnapping ? clientY - layerY : clientY - layerY + y;
411411

412-
Object.assign(this._state.position, { x: posX, y: posY });
412+
this._state.position = { x: posX, y: posY };
413413
}
414414

415415
private _updatePointerState({ clientX, clientY }: PointerEvent): void {
416416
const state = this._state.pointerState;
417417

418-
state.previous = state.current;
418+
state.previous = { ...state.current };
419419
state.current = { x: clientX, y: clientY };
420420

421421
const dx = state.current.x - state.previous.x;

0 commit comments

Comments
 (0)