-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
图片节点中的图在缩放过程中始终等比例缩放 #3801
Comments
Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. |
可以考虑使用 rect 节点,然后图片只是背景。 |
尝试过但是并不可以 |
我也遇到了同样的问题,但是感觉上面通过定时器的方式不太好,还有其他更好的方式吗? |
暂时没有 除非手动去改本地引用的包 我现在写法是监听节点增加 同时为了避免获取不到新增的节点 我才手动加了延时计时器 |
感谢 @zfy171 提供的思路,直接这样就可以了: graph.addNode({
shape: 'image',
x: 320,
y: 120,
width: 94,
height: 28,
imageUrl:
'https://gw.alipayobjects.com/os/s/prod/antv/assets/image/logo-with-text-73b8a.svg',
attrs: {
image: {
preserveAspectRatio:'none'
}
}
}) |
这个方案可行,我已经测试成功了,成功解决了我的问题。 |
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. |
问题描述
图片节点中的图在缩放过程中始终等比例缩放
重现链接
https://x6.antv.antgroup.com/zh/examples/node/native-node/#image
重现步骤
随便缩放一下
预期行为
我期望它的效果是这样的
平台
屏幕截图或视频(可选)
No response
补充说明(可选)
No response
The text was updated successfully, but these errors were encountered: