Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wiserliu opened this issue Mar 12, 2021 · 2 comments
Open

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

wiserliu opened this issue Mar 12, 2021 · 2 comments

Comments

@wiserliu
Copy link

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

@wiserliu
Copy link
Author

这是项目给出的示例

@zhanghui-space
Copy link

在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);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants