Update the ruler before dropping the token to get a more precise target location if the token has been moved very quickly (fixes #51)

This commit is contained in:
Manuel Vögele
2021-04-11 14:18:46 +02:00
parent fb9a2ee60c
commit d2f2307e4d
2 changed files with 6 additions and 0 deletions
+5
View File
@@ -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))
+1
View File
@@ -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)