antvis/G6

请问jsx自定义image节点时,clipCfg怎么设置呢 #4511

gongpingwa00 posted onGitHub

问题描述

用jsx自定义节点,我希望图片在一个圆圈内,不要溢出,想到了图片的裁剪功能,但是配置clipCfg不生效,也没有找到相关的解决答案

重现链接

本地代码

重现步骤

组件初始化,执行registerNode方法 <rect style={{ width: 32, height: 32, stroke:'#ffffff', fill:#ffffff, radius: 16, marginLeft:5, marginTop:4, }} > <image cross-origin='anonymous' style={{ img:${cfg.icon},width: 30,height: 30,marginLeft:5,marginTop:1,clipCfg:{r:10,show:false,type:'circle'}}} /> </rect>

预期行为

用jsx自定义节点,我希望图片在一个圆圈内,不要溢出 image

平台

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

屏幕截图或视频(可选)

No response

补充说明(可选)

No response


posted by Yanyan-Wang almost 2 years ago

This issue has been closed because it has been outdate for a long time. Please open a new issue if you still need help.

这个 issue 已经被关闭,因为 它已经过期很久了。 如果你仍然需要帮助,请创建一个新的 issue。

posted by github-actions[bot] 10 months ago

Fund this Issue

$0.00
Funded

Pull requests