Skip to content

fix: render error when double click legend #6767

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

Open
wants to merge 1 commit into
base: v5
Choose a base branch
from

Conversation

BQXBQX
Copy link
Contributor

@BQXBQX BQXBQX commented Apr 13, 2025

Checklist
  • npm test passes
  • commit message follows commit guidelines
Description of change
  • fixed: 【v5】legend 筛选 快速点击两下,会出现筛选错误 #6093
  • 问题出现在两点:
    1. 在快速双击 legend 时,动画运行了 updateFunction,进入了 Morphing 动画,但是由于此时 path 没有发生变化,导致 animation 被跳过了。修复后在 Morphing 最后加入兜底动画。(因为除了 path 变化,透明度或者其他属性也有可能变化)
    2. 之前 exitFunction 只要被触发后,element 一定会被移除。修复后根据 __removed__ 判断是否需要被移除,比如说在 exitFunction 动画执行时,如果发生了 update 事件,就会把 __removed__ 设置为 false,移除事件就不会发生了。

@@ -218,7 +234,7 @@ function oneToOne(
}

// No need to apply animation since fromPath equals toPath.
return null;
return pathShape.animate(keyframes, timeEffect);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里修改后,原来没有动画的场景也会应用动画,这部分会有影响吗,交互频繁的时候性能会下降吗

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

那就做一下判断?如果 from 关键帧和 to 关键帧 不同再进行动画?🤔 我试试

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

Successfully merging this pull request may close these issues.

【v5】legend 筛选 快速点击两下,会出现筛选错误
2 participants