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

使用 SVG 自定义图标时,节点不能正常缩放 #2033

Closed
wtjperi2003 opened this issue Apr 21, 2022 · 9 comments
Closed

使用 SVG 自定义图标时,节点不能正常缩放 #2033

wtjperi2003 opened this issue Apr 21, 2022 · 9 comments
Labels
type: discussion 讨论 Usage questions, guidance, and other discussions

Comments

@wtjperi2003
Copy link

问题描述

使用官方示例:https://x6.antv.vision/zh/examples/node/custom-node#custom-icon-with-svg ,定义出来的svg图标,在画布开启resizing,也就是允许节点缩放的配置后。该图标节点不能缩放

重现链接

https://x6.antv.vision/zh/examples/node/custom-node#custom-icon-with-svg

重现步骤

1.https://x6.antv.vision/zh/examples/node/custom-node#custom-icon-with-svg
2.代码里,graph配置项添加resizing:true
微信截图_20220421152625

3.自动刷新后,左侧图标选中,鼠标点右下角进行缩放操作

预期行为

能看到图标随着选框进行缩放

平台

  • 操作系统: [macOS, Windows, Linux, React Native ...]
  • 网页浏览器: [Google Chrome, Safari, Firefox]
  • X6 版本: [1.28.2 ... ]

屏幕截图或视频(可选)

No response

补充说明(可选)

No response

@x6-bot
Copy link
Contributor

x6-bot bot commented Apr 21, 2022

👋 @wtjperi2003

Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it.

To help make it easier for us to investigate your issue, please follow the contributing guidelines.

We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.

@georgezhu08
Copy link

根据我的经验,只有使用相对参数才能自动缩放。也就是说,需要使用refX,refY,refWidth,refHeight,refD等才能做到你希望的自动缩放。

@NewByVector NewByVector added the type: discussion 讨论 Usage questions, guidance, and other discussions label May 6, 2022
@Hubmayun123
Copy link

@wtjperi2003 请问这个问题你解决了吗,可以分享一下吗

@NewByVector
Copy link
Contributor

@georgezhu08 说的很对,如果图形支持缩放,需要使用 refXXX 属性。

@wtjperi2003
Copy link
Author

根据我的经验,只有使用相对参数才能自动缩放。也就是说,需要使用refX,refY,refWidth,refHeight,refD等才能做到你希望的自动缩放。

要看图标的类型,如果是单笔的图标,就能正常缩放

@chengup-git
Copy link

根据我的经验,只有使用相对参数才能自动缩放。也就是说,需要使用refX,refY,refWidth,refHeight,refD等才能做到你希望的自动缩放。

要看图标的类型,如果是单笔的图标,就能正常缩放

path类型的有方法设置成自动缩放吗?

@wh356667852
Copy link

根据我的经验,只有使用相对参数才能自动缩放。也就是说,需要使用refX,refY,refWidth,refHeight,refD等才能做到你希望的自动缩放。

要看图标的类型,如果是单笔的图标,就能正常缩放

我也遇到了这个问题,请问你解决了吗?

@wtjperi2003
Copy link
Author

根据我的经验,只有使用相对参数才能自动缩放。也就是说,需要使用refX,refY,refWidth,refHeight,refD等才能做到你希望的自动缩放。

要看图标的类型,如果是单笔的图标,就能正常缩放

我也遇到了这个问题,请问你解决了吗?

最终是使用html类型节点,里面钳svg图标,图标高宽设成100%。这样就能适应所有了

@x6-bot
Copy link
Contributor

x6-bot bot commented Sep 6, 2024

This thread has been automatically locked because it has not had recent activity.

Please open a new issue for related bugs and link to relevant comments in this thread.

@x6-bot x6-bot bot locked as resolved and limited conversation to collaborators Sep 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: discussion 讨论 Usage questions, guidance, and other discussions
Projects
None yet
Development

No branches or pull requests

6 participants