Skip to content

Commit

Permalink
Do not track animation progress on external data objects
Browse files Browse the repository at this point in the history
  • Loading branch information
vasturiano committed Dec 16, 2024
1 parent 2393429 commit 184f3e0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/layers/arcs.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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) {
Expand Down
8 changes: 4 additions & 4 deletions src/layers/paths.js
Original file line number Diff line number Diff line change
Expand Up @@ -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])));
Expand All @@ -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) {
Expand Down
1 change: 0 additions & 1 deletion src/utils/digest.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ class ThreeDigest extends DataBindMapper {
emptyObject(obj);

delete d[this.#objBindAttr];
delete d.__currentTargetD;
};

this.#removeDelay ? setTimeout(removeFn, this.#removeDelay) : removeFn();
Expand Down

0 comments on commit 184f3e0

Please sign in to comment.