diff --git a/src/components/board/Board.vue b/src/components/board/Board.vue index 8ee94e0..b904f8e 100644 --- a/src/components/board/Board.vue +++ b/src/components/board/Board.vue @@ -149,8 +149,10 @@ export default defineComponent({ e.stopPropagation(); const zoom = (this.getZoomLevel as () => number)(); - this.dragged.x += (e.clientX - this.lastMousePosition.x) / zoom; - this.dragged.y += (e.clientY - this.lastMousePosition.y) / zoom; + this.dragged = { + x: this.dragged.x + (e.clientX - this.lastMousePosition.x) / zoom, + y: this.dragged.y + (e.clientY - this.lastMousePosition.y) / zoom + } this.lastMousePosition = { x: e.clientX, y: e.clientY diff --git a/src/components/board/BoardNode.vue b/src/components/board/BoardNode.vue index 6d8298b..93cd9c4 100644 --- a/src/components/board/BoardNode.vue +++ b/src/components/board/BoardNode.vue @@ -5,7 +5,7 @@ :transform="`translate(${position.x},${position.y})`" @mouseenter="mouseEnter" @mouseleave="mouseLeave" - @mousedown="e => $emit('startDragging', e, node.id)" + @mousedown="mouseDown" >