fix(extension): trigger updateEdgePointByAnchors() after moveTo(#1384) #1552
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
related: transform相关问题汇总
fix: #1384
fix: #1417
前言
这次
pr
不是重构缩放、旋转等transform操作相关逻辑,只是一个简单的bug修复
,因为这个bug
的产生是因为我之前pr#1205疏忽大意导致的问题问题发生的原因
在上次pr#1205中,我在
onDragEnd()
中增加了一行代码this.updateEdgePointByAnchors()
,代表的意思是:更新目前node节点所有连接的edge的所有连接点,如下面所示但是我加错位置了,我直接忽视了根据
gridSize
去修正node
节点的相关x
和y
的代码,直接无视了this.nodeModel.moveTo(x, y)
这么明显的代码上面方法翻译过来就是
在触发
this.nodeModel.moveTo(x, y)
,应该再次触发一次this.updateEdgePointByAnchors()
才对(如下面代码所示)简化后,就是
this.updateEdgePointByAnchors()
应该放在this.nodeModel.moveTo(x, y)
之后,而不是之前解决方法
改为