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

fix(g-svg): autoDraw should be true and immutable to avoid redundant rendering when animating #192

Merged
merged 1 commit into from
Oct 1, 2019

Conversation

dengfuping
Copy link
Member

@dengfuping dengfuping commented Oct 1, 2019

🤔 This is a ...

  • New feature
  • Bug fix
  • TypeScript definition update
  • Refactoring
  • Performance improvement
  • Code style optimization
  • Test Case
  • Branch merge
  • Other (about what?)

🔗 Related issue link

💡 Background and solution

  • 执行和停止动画时,渲染更新是根据 autoDraw 来决定是否自动调用 canvas.draw():
// timeline.ts
const autoDraw = this.canvas.get('autoDraw');
// 非自动更新模式下,需要手动更新
if (!autoDraw) {
  this.canvas.draw();
}

📝 Changelog

Language Changelog
🇺🇸 English 🐞 Fix redundant rendering for g-svg when animating. #191
🇨🇳 Chinese 🐞 修复 g-svg 执行动画时同一元素重复渲染的问题。#191

☑️ Self Check before Merge

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • TypeScript definition is updated/provided or not needed
  • Changelog is provided or not needed

Copy link

@tests-checker tests-checker bot left a comment

Choose a reason for hiding this comment

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

Could you please add tests to make sure this change works as expected?

@dengfuping dengfuping changed the title fix(g-svg): autoDraw should be true and immutable fix(g-svg): autoDraw should be true and immutable to avoid redundant rendering Oct 1, 2019
@dengfuping dengfuping changed the title fix(g-svg): autoDraw should be true and immutable to avoid redundant rendering fix(g-svg): autoDraw should be true and immutable to avoid redundant rendering when animating and repeat is true Oct 1, 2019
@dengfuping dengfuping changed the title fix(g-svg): autoDraw should be true and immutable to avoid redundant rendering when animating and repeat is true fix(g-svg): autoDraw should be true and immutable to avoid redundant rendering when animating Oct 1, 2019
@todo
Copy link

todo bot commented Oct 1, 2019

应该在控制台给出 Warning 提示,引导用户避免这种用法。需要在 @antv/util 中提供通用的 warning 方法,便于在其他 antv 项目中使用

https://github.com/antvis/g/blob/4d7b1aa90c86d5ccb5a843d7e52e080037471609/packages/g-svg/src/canvas.ts#L22-L27


This comment was generated by todo based on a TODO comment in 4d7b1aa in #192. cc @antvis.

@dengfuping dengfuping merged commit 66fb687 into 4.x Oct 1, 2019
@pr-triage pr-triage bot removed the PR: unreviewed label Oct 1, 2019
@pr-triage pr-triage bot added the PR: merged label Oct 1, 2019
@dengfuping dengfuping deleted the fix-issue-191 branch October 1, 2019 16:54
openwayne pushed a commit to openwayne/g that referenced this pull request Jan 18, 2021
fix(g-svg): autoDraw should be true and immutable to avoid redundant rendering when animating
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant