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图片的节点如何拖动边框改变图片大小? #3889

Closed
wh356667852 opened this issue Sep 5, 2023 · 4 comments
Closed

Svg图片的节点如何拖动边框改变图片大小? #3889

wh356667852 opened this issue Sep 5, 2023 · 4 comments

Comments

@wh356667852
Copy link

问题描述

参考官方示例的“使用 SVG 自定义图标https://x6.antv.antgroup.com/zh/examples/node/custom-node/#custom-icon-with-svg,使用的本地SVG图片作为节点,也配置了resizing:true,但是还是不能改变图片的大小,求解。

重现链接

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

重现步骤

1、配置resizing : true 属性
2、拖动节点边框,图片尺寸不变化
image

预期行为

希望图片的尺寸与拖动的节点尺寸一致

平台

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

屏幕截图或视频(可选)

No response

补充说明(可选)

No response

@x6-bot
Copy link
Contributor

x6-bot bot commented Sep 5, 2023

👋 @wh356667852

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.

@ZouYuLong
Copy link

刚好做了这个,一个方法是设置transom:scale属性,但是对于path绘制的线条图案比如接线图,他的线条粗细会被一同放大,然后就需要第二方法,遍历svg下所有节点,对path的d属性内部所有绘制进行想乘积运算重绘,同样rect,circle这些节点的w,h,x,y,rx,ry也需要做同样转换
image

@wh356667852
Copy link
Author

刚好做了这个,一个方法是设置transom:scale属性,但是对于path绘制的线条图案比如接线图,他的线条粗细会被一同放大,然后就需要第二方法,遍历svg下所有节点,对path的d属性内部所有绘制进行想乘积运算重绘,同样rect,circle这些节点的w,h,x,y,rx,ry也需要做同样转换 image

明白了,谢谢大佬

@x6-bot
Copy link
Contributor

x6-bot bot commented Sep 20, 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 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants