|
@@ -184,13 +184,14 @@ export function moveSmoothAnimation(progress: number, activeIndex: number, isMov
|
|
|
// 百分比转为当前的index 距离个数
|
|
|
const progressCalcIndex = Math.round(progress * _numberOfSegments)
|
|
|
// // 当前的index
|
|
|
- let nowIndex = nextPointsIndex - _numberOfSegments + progressCalcIndex
|
|
|
+ const nowIndex = nextPointsIndex - _numberOfSegments + progressCalcIndex
|
|
|
const nowPointsPos = smoothAnimationState.pointsPos[nowIndex]
|
|
|
- smoothAnimationState.canvasCtx?.clearRect(0, 0, smoothAnimationState.canvasDomWith, smoothAnimationState.canvasDomHeight)
|
|
|
- if (!nowPointsPos?.x) {
|
|
|
+ // 当x的值为null和undefinedde的时候 错误 不走下面的方法
|
|
|
+ if (!(nowPointsPos?.x != null)) {
|
|
|
console.error(nowPointsPos?.x, "nowPointsPos", nowIndex, activeIndex)
|
|
|
return
|
|
|
}
|
|
|
+ smoothAnimationState.canvasCtx?.clearRect(0, 0, smoothAnimationState.canvasDomWith, smoothAnimationState.canvasDomHeight)
|
|
|
// 移动
|
|
|
smoothAnimationMove(
|
|
|
{
|