-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
V5.0.0-beta.27 自定义组件设置连接桩图形为矩形, 覆写 drawAnchorShapes 时有 error #5202
Comments
hi @America-first-melon, welcome! |
Hi @America-first-melon, Please star this repo if you find it useful! Thanks ⭐! |
你好,issue 中提到的 “这里的代码,” 应该是过时的代码,麻烦重新参考下最新的代码哈 G6/packages/g6/src/stdlib/item/node/base.ts Lines 484 to 531 in 48308e0
|
如果参考最新代码仍有问题,请重新打开此 issue |
更简洁了,最后依旧生成 this.upsertShape 即可。 请问一下,大佬们预计什么时候发布 rc 版本? |
Describe the bug
默认情况下,所有的连接桩好像为 圆形,设置大小和颜色时必须传入 圆形的参数。
所以需要“自定义组件” 去实现一个矩形的连接桩, 参考文档,使用 drawAnchorShapes 进行覆写(默认为 circle 需要设置为 rect ), 复制 这里的代码,, 其中 this.boundsCache = undefined, this.getAnchorPosition 也错误。
是使用方式不对吗?还是 只需要 执行 this.upsertShape 这一行就够了。
Your Example Website or App
null
Screenshots or Videos
No response
Platform
Additional context
No response
The text was updated successfully, but these errors were encountered: