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

[Bug]: Custom nodes blur when the canvas is zoomed in #6666

Closed
2 of 10 tasks
irelib opened this issue Dec 25, 2024 · 3 comments
Closed
2 of 10 tasks

[Bug]: Custom nodes blur when the canvas is zoomed in #6666

irelib opened this issue Dec 25, 2024 · 3 comments
Labels
status: waiting for maintainer These issues have not yet been reviewed by a maintainer

Comments

@irelib
Copy link

irelib commented Dec 25, 2024

Describe the bug / 问题描述

画布放大后,自定义节点会模糊
F247CAB6-D6C8-4f44-B585-C91DDD708991

Reproduction link / 复现链接

No response

Steps to Reproduce the Bug or Issue / 重现步骤

No response

G6 Version / G6 版本

Please select / 请选择

OS / 操作系统

  • macOS
  • Windows
  • Linux
  • Others / 其他

Browser / 浏览器

  • Chrome
  • Edge
  • Firefox
  • Safari (Limited support / 有限支持)
  • IE (Nonsupport / 不支持)
  • Others / 其他
@irelib irelib added the status: waiting for maintainer These issues have not yet been reviewed by a maintainer label Dec 25, 2024
Copy link

您提到在放大画布后,自定义节点会变得模糊。这个问题可能与节点的渲染方式有关。在 G6 中,节点通常是通过 HTML、SVG 或 Canvas 来渲染的。放大时,Canvas 渲染的内容可能会因为分辨率不足而显得模糊。

以下是一些可能的解决方案:

  1. 使用矢量图形:如果您当前使用的是 Canvas 渲染,尝试使用 SVG 渲染,因为 SVG 是基于矢量的,放大后不会失真。

  2. 调整分辨率:如果必须使用 Canvas,可以尝试在初始化画布时设置更高的分辨率。

  3. 自定义节点的缩放:确保自定义节点在放大时能够正确缩放。可以通过监听画布的缩放事件,动态调整节点的样式。

如果这些建议没有解决您的问题,您可以提供更多的代码细节或复现链接,以便我能更好地帮助您。

🪧 Tips For further assistance, please describe your question in the comments and @petercat-assistant to start a conversation with me.

@github-actions github-actions bot changed the title [Bug]: 画布放大后,自定义节点会模糊 [Bug]: Custom nodes blur when the canvas is zoomed in Dec 25, 2024
@chris-deng
Copy link

I have the same problem, custom node rendered by html

@Aarebecca
Copy link
Contributor

这是因为 HTML(包括 React)节点在缩放过程中是通过 transform 实现的,这并非 Bug,而是实现逻辑导致的。你可以尝试将节点尺寸设置为一个较大的值。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting for maintainer These issues have not yet been reviewed by a maintainer
Projects
None yet
Development

No branches or pull requests

3 participants