First move the token, then store it's path. This ensures that getMovedDistance always returns a valid result.
This commit is contained in:
@@ -64,7 +64,6 @@ async function animateTokens(tokens, draggedToken, draggedRays, wasPaused) {
|
|||||||
return {token, rays: offsetRays, dx, dy};
|
return {token, rays: offsetRays, dx, dy};
|
||||||
});
|
});
|
||||||
|
|
||||||
trackRays(tokenAnimationData.map(({token}) => token), tokenAnimationData.map(({rays}) => rays));
|
|
||||||
for (const {token, rays} of tokenAnimationData) {
|
for (const {token, rays} of tokenAnimationData) {
|
||||||
token._noAnimate = true;
|
token._noAnimate = true;
|
||||||
}
|
}
|
||||||
@@ -88,6 +87,7 @@ async function animateTokens(tokens, draggedToken, draggedRays, wasPaused) {
|
|||||||
for (const {token} of tokenAnimationData) {
|
for (const {token} of tokenAnimationData) {
|
||||||
token._noAnimate = false;
|
token._noAnimate = false;
|
||||||
}
|
}
|
||||||
|
trackRays(tokenAnimationData.map(({token}) => token), tokenAnimationData.map(({rays}) => rays));
|
||||||
}
|
}
|
||||||
|
|
||||||
function calculateTokenOffset(tokenA, tokenB) {
|
function calculateTokenOffset(tokenA, tokenB) {
|
||||||
|
|||||||
Reference in New Issue
Block a user