From d2f2307e4ddfa6b574e38ae9ca0f13a77bc36853 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20V=C3=B6gele?= Date: Sun, 11 Apr 2021 14:18:46 +0200 Subject: [PATCH] Update the ruler before dropping the token to get a more precise target location if the token has been moved very quickly (fixes #51) --- CHANGELOG.md | 5 +++++ src/main.js | 1 + 2 files changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d6818a..e5acd4a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## In development +### Bugfixes +- Fixed a bug where a token would move to the incorrect location if it is was dragged and released very quickly ([#51](https://github.com/manuelVo/foundryvtt-drag-ruler/issues/51)) - thanks to Silver Raven for helping me track down this bug! + + ## 1.4.5 ### Bugfixes - Tiny tokens (0.5x0.5 or smaller) now snap to the coners of a square like they do in vanilla foundry ([#49](https://github.com/manuelVo/foundryvtt-drag-ruler/issues/49)) diff --git a/src/main.js b/src/main.js index a0a1d6e..b874c50 100644 --- a/src/main.js +++ b/src/main.js @@ -176,6 +176,7 @@ function onTokenDragLeftDrop(event) { const ruler = canvas.controls.ruler if (!ruler.isDragRuler) return false + onMouseMove.call(ruler, event); const selectedTokens = canvas.tokens.controlled ruler._state = Ruler.STATES.MOVING moveTokens.call(ruler, ruler.draggedToken, selectedTokens)