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

[g] 延迟 Path 计算长度时机 #1141

Closed
xiaoiver opened this issue Aug 31, 2022 · 0 comments
Closed

[g] 延迟 Path 计算长度时机 #1141

xiaoiver opened this issue Aug 31, 2022 · 0 comments
Assignees
Labels

Comments

@xiaoiver
Copy link
Contributor

xiaoiver commented Aug 31, 2022

并不是所有情况都需要计算包围盒或者长度,不必要的计算将导致明显的性能损失。例如 Path 初始化时不应该计算长度,只有用户显式调用 getTotalLength / getPoint 时再进行。

另外 Arc / Cubic 都需要分段,分段数可以适当减少。

antvis/util#92

目前需要计算 Path 的时机有:

  • 用户调用 getPointAtLength / getPoint / getTotalLength
  • g-plugin-canvas-picker
@xiaoiver xiaoiver self-assigned this Aug 31, 2022
@xiaoiver xiaoiver added the bug label Aug 31, 2022
xiaoiver added a commit that referenced this issue Sep 5, 2022
@xiaoiver xiaoiver closed this as completed Sep 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant