Update active rulers when the movement history changes

This commit is contained in:
Manuel Vögele
2021-05-05 16:01:13 +02:00
parent 7bed5abd0a
commit e8ab77a62e
6 changed files with 40 additions and 2 deletions
+2 -1
View File
@@ -2,6 +2,7 @@ import {highlightMeasurementTerrainRuler, measureDistances} from "./compatibilit
import {getGridPositionFromPixels} from "./foundry_fixes.js";
import {getColorForDistance} from "./main.js"
import {trackRays} from "./movement_tracking.js"
import {recalculate} from "./socket.js";
import {applyTokenSizeOffset, getSnapPointForToken, getTokenShape, highlightTokenShape, zip} from "./util.js";
// This is a modified version of Ruler.moveToken from foundry 0.7.9
@@ -87,7 +88,7 @@ async function animateTokens(tokens, draggedToken, draggedRays, wasPaused) {
for (const {token} of tokenAnimationData) {
token._noAnimate = false;
}
trackRays(tokenAnimationData.map(({token}) => token), tokenAnimationData.map(({rays}) => rays));
trackRays(tokens, tokenAnimationData.map(({rays}) => rays)).then(() => recalculate(tokens));
}
function calculateTokenOffset(tokenA, tokenB) {