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: set transform-origin in each keyframe #5679

Merged
merged 1 commit into from
Oct 24, 2023
Merged

Conversation

xiaoiver
Copy link
Contributor

@xiaoiver xiaoiver commented Oct 24, 2023

目前 animations 保存在 context 中,希望通过如下方式让图表停在任意动画时刻,便于截图或者制作图表动画时间轴:

context.animations?.forEach((animation) => {
  animation.pause();
  animation.currentTime = currentTime;
});

因此 transformOrigin 需要在 keyframe 中设置,这样才能通过 play 方法重复播放。否则如果通过 setOrigin 这样的 API 在动画前后设置 transformOrigin,再次播放时就没法执行这段逻辑了。

@coveralls
Copy link

Pull Request Test Coverage Report for Build 6624461771

  • 4 of 8 (50.0%) changed or added relevant lines in 8 files are covered.
  • 9 unchanged lines in 4 files lost coverage.
  • Overall coverage increased (+0.07%) to 88.244%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/animation/scaleOutX.ts 0 1 0.0%
src/animation/scaleOutY.ts 0 1 0.0%
src/animation/zoomIn.ts 0 1 0.0%
src/animation/zoomOut.ts 0 1 0.0%
Files with Coverage Reduction New Missed Lines %
src/animation/scaleOutX.ts 2 11.76%
src/animation/scaleOutY.ts 2 11.76%
src/animation/zoomOut.ts 2 7.69%
src/animation/zoomIn.ts 3 7.69%
Totals Coverage Status
Change from base Build 6585570733: 0.07%
Covered Lines: 10032
Relevant Lines: 11003

💛 - Coveralls

@pearmini pearmini merged commit c49cf09 into v5 Oct 24, 2023
3 checks passed
@pearmini pearmini deleted the fix-transform-origin branch October 24, 2023 10:01
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.

None yet

3 participants