perf: move area ripple animation to overlay canvas - #809
Conversation
eb9db40 to
91b918c
Compare
Avoid full main-layer repaints at animation frame rate when candle.area.point.animation is enabled. Fixes klinecharts#808.
91b918c to
320062c
Compare
|
Two regressions vs. 1. // main
stopAnimation (): void {
this._animationFrameTime = 0
this._animation.cancel()
}
// this PR
stopAnimation (): void {
this._animation.stop()
}The reset to 2. The // main
const progress = Math.min(this._animationFrameTime / pointStyles.animationDuration, 1)
rippleRadius = pointStyles.radius + progress * (pointStyles.rippleRadius - pointStyles.radius)
// this PR (drawRipple)
rippleRadius = pointStyles.radius + this._animationFrameTime / pointStyles.animationDuration * (pointStyles.rippleRadius - pointStyles.radius)Without the clamp, once |
Summary
UpdateLevel.Overlay).candle.area.point.animationis enabled.Test plan
pnpm run debug→ switch candle type to Area withpoint.animationenabledpnpm run code-lint/pnpm run type-check/pnpm run build