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

[Bug report] 自定义锚点后,使用adjustEdgeStartAndEnd拖拽后返回的锚点ID信息错误 #1365

Closed
zjutlf opened this issue Oct 13, 2023 · 6 comments · Fixed by #1392
Labels
bug Something isn't working

Comments

@zjutlf
Copy link

zjutlf commented Oct 13, 2023

问题描述

请用简洁的语言描述你遇到的 bug,至少包括以下部分,如提供截图请尽量完整:

  1. 问题触发的条件,如何复现

通过自定义的htmlModel,并向Model中自定义Anchor,当拖动生成自定义的htmlModel后,并连接两个模型,完成后拖动生成的edge中的traget锚点使其指向另一个锚点,观察console中输出的edge:exchange-node,和edge:add两个方法生成的data数据,可以看到按照官方代码中AdjustPoint.js中的逻辑,应该只会修改targetAnchorID,但是实际上修改了sourceAnchorID和targetAnchorID两个数据,具体表现如图所示
bug展示

  1. 期望的表现
    通过adjust属性拖动edge边修改targetAnchor时,edge:exchange-node,和edge:add仅修改targetAnchorID,不修改sourceAnchorID

  2. 实际的表现
    通过adjust属性拖动edge边修改targetAnchor时,edge:exchange-node,和edge:add修改了targetAnchorID和sourceAnchorID

最简复现

一般来说通过文字和截图的描述我们很难定位到问题,为了帮助我们快速定位问题并修复,请选择以下方式编写并上传最简复现 demo:

iotFlowPlatform.zip

相关信息 context

LogicFlow Version: 1.2.15/1.2.1
Node Version: 18.5.1
Platform: windows 10/chrome 浏览器

@zjutlf zjutlf changed the title [Bug report] [Bug report] 自定义锚点后,使用adjustEdgeStartAndEnd拖拽后返回的锚点ID信息错误 Oct 13, 2023
@wumail wumail added the bug Something isn't working label Oct 17, 2023
@wumail
Copy link
Collaborator

wumail commented Oct 17, 2023

从表现看来看,初步判断是触发了最近锚点的计算逻辑

@zjutlf
Copy link
Author

zjutlf commented Oct 17, 2023

从表现看来看,初步判断是触发了最近锚点的计算逻辑

这个有什么办法去避免触发这个最近锚点的计算逻辑么,正常应该是触发锚点移动的target类型

@wumail
Copy link
Collaborator

wumail commented Oct 17, 2023

从表现看来看,初步判断是触发了最近锚点的计算逻辑

这个有什么办法去避免触发这个最近锚点的计算逻辑么,正常应该是触发锚点移动的target类型

想要不触发最近锚点的计算需要在新建边的时候传入锚点ID,你可以重写getData方法,把sourceAnchorId和targetAnchorId都返回

@zjutlf
Copy link
Author

zjutlf commented Oct 30, 2023

从表现看来看,初步判断是触发了最近锚点的计算逻辑

这个有什么办法去避免触发这个最近锚点的计算逻辑么,正常应该是触发锚点移动的target类型

想要不触发最近锚点的计算需要在新建边的时候传入锚点ID,你可以重写getData方法,把sourceAnchorId和targetAnchorId都返回

我这边采用的是logicflow里面针对锚点数据保存的方案,https://site.logic-flow.cn/docs/#/zh/guide/basic/edge?id=%e4%bf%9d%e5%ad%98%e9%94%9a%e7%82%b9%e4%bf%a1%e6%81%af ,这里应该就是您所说的将sourceAnchorId和targetAnchorId都返回的代码,但是在实际上面提交的demo中的customEdge.js文件里其实已经带了锚点相关的信息,但是依旧还是触发对应的最近锚点的计算逻辑,所以您说的这个解决方案可能还是无法解决我这边锚点id异常的问题

@zjutlf
Copy link
Author

zjutlf commented Nov 30, 2023

更新到1.2.18版本的core代码后,依旧有ID返回错误的问题

@wumail
Copy link
Collaborator

wumail commented Nov 30, 2023

更新到1.2.18版本的core代码后,依旧有ID返回错误的问题

我使用你提供的demo,在1.2.18版本未发现问题
image
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants