-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[Bug Report]: 2.0版本打开内置缩放,导致经过边合并 #1926
Comments
@boyongjiong ,导致以上问题的代码主要是这个: LogicFlow/packages/core/src/view/Control.tsx Lines 59 to 61 in f74b47c
感觉这个逻辑确实多余了,除了导致以上问题外,还会导致 hover 状态下调整节点大小只能缩小不能放大:向内拉不会导致锚点消失,可以正常拖拽,向外拉时因为是按照网格间距触发缩放,网格间距大时鼠标会移出节点,hover 状态消失,然后触发组件卸载,触发 这个处理起来争议可能比较大,就不提 PR 了(我处理基本上就是直接删了这三行😂,实测可以解决以上提到的两个问题,但不确定会不会引入新的问题😥)。 |
好的,谢谢,那我就先不使用allowResize来规避这个问题,等后面有结论了再看 |
问题应该是下面代码触发的 componentWillUnmount() {
this.dragHandler.cancelDrag()
}
cancelDrag = () => {
const DOC: any = window?.document
DOC.removeEventListener('mousemove', this.handleMouseMove, false)
DOC.removeEventListener('mouseup', this.handleMouseUp, false)
this.onDragEnd({ event: undefined })
this.isDragging = false
}
updateEdgePointByAnchors = () => {
const { id, anchors } = this.nodeModel
const edges = this.getNodeEdges(id)
// 更新边
edges.sourceEdges.forEach((item) => {
const anchorItem = anchors.find(
(anchor) => anchor.id === item.sourceAnchorId,
)
if (anchorItem) {
item.updateStartPoint({
x: anchorItem.x,
y: anchorItem.y,
})
}
})
edges.targetEdges.forEach((item) => {
const anchorItem = anchors.find(
(anchor) => anchor.id === item.targetAnchorId,
)
if (anchorItem) {
item.updateEndPoint({
x: anchorItem.x,
y: anchorItem.y,
})
}
})
} 目前有两个路径会触发 componentWillUnmount() {
this.dragHandler.cancelDrag()
} 但是我没有深度研究具体原因是什么?初步看起来,应该是初始化 而在
而导致了 |
发生了什么?
2.0版本打开内置缩放allowResize: true时。导致经过边和节点连接处出现合并边的情况
-.Google.Chrome.2024-10-21.18-21-16.mp4
示例:https://codesandbox.io/p/devbox/xsl72v
这种情况只出现在lf.render时有数据的情况下并且allowResize设置为true
logicflow/core版本
2.0.6
logicflow/extension版本
2.0.10
logicflow/engine版本
No response
浏览器&环境
Chrome
The text was updated successfully, but these errors were encountered: