guozhaolong / wfd-vue

flowable workflow designer for Vue base on @antv/g6
https://guozhaolong.github.io/wfd-vue/
1.01k stars 263 forks source link

拖动画布,添加节点到画布左侧失败 #67

Open wiserliu opened 3 years ago

wiserliu commented 3 years ago

拖动画布,添加节点到画布左侧失败 image

wiserliu commented 3 years ago

这是项目给出的示例

gzhanghui commented 2 years ago

在dragPanelItemAddNode.js 中有这么一段代码

onMouseUp (e) {
  if (this.graph.get('addNodeDragging')) {
    const p = this.graph.getPointByClient(e.clientX, e.clientY);
    ......
  }
},

这样写可以避免这种情况

const p = this.graph.getPointByClient(e.clientX, e.clientY);
const { x, y } = this.graph.getCanvasByPoint(p.x, p.y);