From 184f3e016df3eeeb63f26b1c844de665553fe188 Mon Sep 17 00:00:00 2001 From: vasco Date: Mon, 16 Dec 2024 00:30:08 +0000 Subject: [PATCH] Do not track animation progress on external data objects --- src/layers/arcs.js | 4 ++-- src/layers/paths.js | 8 ++++---- src/utils/digest.js | 1 - 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/layers/arcs.js b/src/layers/arcs.js index df30f87..1200dda 100755 --- a/src/layers/arcs.js +++ b/src/layers/arcs.js @@ -181,7 +181,7 @@ export default Kapsule({ obj.geometry.setAttribute('relDistance', vertexRelDistanceArray); const applyUpdate = td => { - const { stroke, ...curveD } = arc.__currentTargetD = td; + const { stroke, ...curveD } = group.__currentTargetD = td; const curve = calcCurve(curveD); @@ -205,7 +205,7 @@ export default Kapsule({ endLng: +endLngAccessor(arc) }; - const currentTargetD = arc.__currentTargetD || Object.assign({}, targetD, { altAutoScale: -1e-3 }); + const currentTargetD = group.__currentTargetD || Object.assign({}, targetD, { altAutoScale: -1e-3 }); if (Object.keys(targetD).some(k => currentTargetD[k] !== targetD[k])) { if (!state.arcsTransitionDuration || state.arcsTransitionDuration < 0) { diff --git a/src/layers/paths.js b/src/layers/paths.js index a4ab1c0..d84f849 100644 --- a/src/layers/paths.js +++ b/src/layers/paths.js @@ -237,12 +237,12 @@ export default Kapsule({ } // animate from start to finish by default - const pointsInterpolator = interpolateVectors((path.__currentTargetD && path.__currentTargetD.points) || [points[0]], points); + const pointsInterpolator = interpolateVectors((group.__currentTargetD && group.__currentTargetD.points) || [points[0]], points); const applyUpdate = td => { - const { stroke, interpolK } = path.__currentTargetD = td; + const { stroke, interpolK } = group.__currentTargetD = td; - const kPoints = path.__currentTargetD.points = pointsInterpolator(interpolK); + const kPoints = group.__currentTargetD.points = pointsInterpolator(interpolK); if (useFatLine) { obj.geometry.setPositions([].concat(...kPoints.map(({ x, y, z }) => [x, y, z]))); @@ -258,7 +258,7 @@ export default Kapsule({ const targetD = { stroke, interpolK: 1 }; - const currentTargetD = Object.assign({}, path.__currentTargetD || targetD, { interpolK: 0 }); + const currentTargetD = Object.assign({}, group.__currentTargetD || targetD, { interpolK: 0 }); if (Object.keys(targetD).some(k => currentTargetD[k] !== targetD[k])) { if (!state.pathTransitionDuration || state.pathTransitionDuration < 0) { diff --git a/src/utils/digest.js b/src/utils/digest.js index 879e7c5..af4eeab 100644 --- a/src/utils/digest.js +++ b/src/utils/digest.js @@ -40,7 +40,6 @@ class ThreeDigest extends DataBindMapper { emptyObject(obj); delete d[this.#objBindAttr]; - delete d.__currentTargetD; }; this.#removeDelay ? setTimeout(removeFn, this.#removeDelay) : removeFn();