Commit 7ae4a05f authored by rockyl's avatar rockyl

修复节点偏移的问题

parent 81f17997
......@@ -183,8 +183,8 @@
},
onResize() {
const {x, y} = this.$el.getBoundingClientRect();
this.drawState.boardOffset.x = x;
this.drawState.boardOffset.y = y;
this.drawState.boardOffset.x = x + this.boardOffset.x;
this.drawState.boardOffset.y = y + this.boardOffset.y;
},
measure() {
this.onResize();
......@@ -243,8 +243,8 @@
},
onMouseMove(e) {
const scale = this.scale;
let x = e.x - this.drawState.boardOffset.x - this.boardOffset.x;
let y = e.y - this.drawState.boardOffset.y - this.boardOffset.y;
let x = e.x - this.drawState.boardOffset.x;
let y = e.y - this.drawState.boardOffset.y;
this.lineDrawing.path = this.drawingLineStart + `${x / scale},${y / scale} ${x / scale},${y / scale}`;
},
onMouseUp(e) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment