From a413d44795aefdc4b658f2f4a26ec9483af871ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20V=C3=B6gele?= Date: Tue, 18 May 2021 13:03:04 +0200 Subject: [PATCH] Don't re-measure when the shift key is being pressed while a token is following the currently active ruler --- CHANGELOG.md | 1 + src/main.js | 2 ++ 2 files changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c49ede..a69d383 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ ### Bugfixes - Fixed a bug that sometimes measured diagonals incorrectly with the 5/10/5 grid rule +- Fixed a bug that would cause the ruler to re-measure when the shift key is being pressed or released while a token is moving ### Compatibility - Drag Ruler's Generic Speed Provider is now aware of good default values for the Starfinder game system diff --git a/src/main.js b/src/main.js index cdb42a7..c2d7005 100644 --- a/src/main.js +++ b/src/main.js @@ -115,6 +115,8 @@ function onKeyShift(up) { const ruler = canvas.controls.ruler if (!ruler.isDragRuler) return false + if (ruler._state !== Ruler.STATES.MEASURING) + return false; const mousePosition = canvas.app.renderer.plugins.interaction.mouse.getLocalPosition(canvas.tokens) const rulerOffset = ruler.rulerOffset