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

🐛自定义 icon 渲染会导致 canvas 无法正常导出图片 #2513

Closed
2 of 5 tasks
Micircle opened this issue Jan 16, 2024 · 4 comments · Fixed by #2524
Closed
2 of 5 tasks

🐛自定义 icon 渲染会导致 canvas 无法正常导出图片 #2513

Micircle opened this issue Jan 16, 2024 · 4 comments · Fixed by #2524

Comments

@Micircle
Copy link

🏷 Version

Package Version
@antv/s2 1.51.2
@antv/s2-react
@antv/s2-vue

Sheet Type

  • PivotSheet
  • TableSheet
  • GridAnalysisSheet
  • StrategySheet
  • EditableSheet

🖋 Description

设置自定义 icon 后,如:

{
    customSVGIcons: [
        { name: 'xxx', svg: 'https://xxx.svg' }
    ]
}

调用 canvas.toDataURL() 会报错
报错原因为:

这里的 img 没有设置 img.crossOrigin = 'Anonymous'; canvas toDataURL 会报错,希望可以修复一下,谢谢~。

⌨️ Code Snapshots

🔗 Reproduce Link

🤔 Steps to Reproduce

😊 Expected Behavior

😅 Current Behavior

💻 System information

Environment Info
System
Browser
Copy link
Contributor

你要找的是不是 (You may look for issues):

  1. 92% 自定义 icon 渲染会导致 canvas 无法正常导出图片 #2512

@lijinke666
Copy link
Member

直接来个 PR?

lijinke666 added a commit that referenced this issue Jan 23, 2024
* fix: 自定义 icon 支持跨域 close #2513

* docs: 更新序号文档
lijinke666 added a commit that referenced this issue Jan 24, 2024
* fix: 自定义 icon 支持跨域 close #2513

* docs: 更新序号文档
@lijinke666
Copy link
Member

🎉 This issue has been resolved in version @antv/s2-v1.54.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

@lijinke666
Copy link
Member

🎉 This issue has been resolved in version @antv/s2-v2.0.0-next.11 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants