Fix:修复画布左上角距浏览器窗口左上角不为0时拖拽节点画布自动移动的问题
This commit is contained in:
parent
21564445d6
commit
bd3d470e40
@ -92,7 +92,7 @@ class Drag extends Base {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.mindMap.renderer.clearAllActive()
|
this.mindMap.renderer.clearAllActive()
|
||||||
this.onMove(x, y)
|
this.onMove(x, y, e)
|
||||||
})
|
})
|
||||||
this.onMouseup = this.onMouseup.bind(this)
|
this.onMouseup = this.onMouseup.bind(this)
|
||||||
this.mindMap.on('node_mouseup', this.onMouseup)
|
this.mindMap.on('node_mouseup', this.onMouseup)
|
||||||
@ -182,12 +182,10 @@ class Drag extends Base {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 拖动中
|
// 拖动中
|
||||||
onMove(x, y) {
|
onMove(x, y, e) {
|
||||||
if (!this.isMousedown) {
|
if (!this.isMousedown) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
let originX = x
|
|
||||||
let originY = y
|
|
||||||
this.createCloneNode()
|
this.createCloneNode()
|
||||||
let { scaleX, scaleY, translateX, translateY } = this.drawTransform
|
let { scaleX, scaleY, translateX, translateY } = this.drawTransform
|
||||||
this.cloneNodeLeft = x - this.offsetX
|
this.cloneNodeLeft = x - this.offsetX
|
||||||
@ -211,7 +209,7 @@ class Drag extends Base {
|
|||||||
if (this.mindMap.opt.autoMoveWhenMouseInEdgeOnDrag && this.mindMap.select) {
|
if (this.mindMap.opt.autoMoveWhenMouseInEdgeOnDrag && this.mindMap.select) {
|
||||||
this.drawTransform = this.mindMap.draw.transform()
|
this.drawTransform = this.mindMap.draw.transform()
|
||||||
this.mindMap.select.clearAutoMoveTimer()
|
this.mindMap.select.clearAutoMoveTimer()
|
||||||
this.mindMap.select.onMove(originX, originY)
|
this.mindMap.select.onMove(e.clientX, e.clientY)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user