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

设置了grid的size属性,addNode,会造成节点有偏移 #1807

Open
HunterHeroHan opened this issue Aug 22, 2024 · 2 comments
Open

设置了grid的size属性,addNode,会造成节点有偏移 #1807

HunterHeroHan opened this issue Aug 22, 2024 · 2 comments

Comments

@HunterHeroHan
Copy link

如果设置了grid的size属性后,使用addNode方法,会造成节点有偏移。
以官方示例https://site.logic-flow.cn/zh/examples/react/registry#customReact

在new LogicFlow(),(34行)添加代码 grid: { size: 12 },
lf.addNode调用后,
之后输出 lf.getGraphData(),可发现node位移
image
image

Originally posted by @HunterHeroHan in #1806 (comment)

@boyongjiong
Copy link
Collaborator

这个目前看是符合预期的,因为设置 gridSize 之后,我们会把节点的中心吸附在grid 的中心点上

@HunterHeroHan
Copy link
Author

这个目前看是符合预期的,因为设置 gridSize 之后,我们会把节点的中心吸附在grid 的中心点上

那如何才能避免连续addNode时候节点重叠?单纯的算偏移嘛,还是有方法可以把吸附关掉?

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