Skip to content

Commit

Permalink
Don't consume key events
Browse files Browse the repository at this point in the history
  • Loading branch information
manuelVo committed Jan 27, 2022
1 parent 5ea7ba5 commit f9739f9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,18 @@ function activate(event) {
// If the current ruler is a rangefinder don't refresh it
// This can happen because the browser may fire another event that doesn't have event.repeat set after a click on the canvas
if (ruler.isRangefinder)
return;
return false;
const token = getControlledToken()
if (!token)
return;
return false;
ruler.clear();
ruler.isRangefinder = true;
ruler.rangefinderToken = token;
const tokenCenter = {x: token.x + token.w / 2, y: token.y + token.h / 2};
ruler._addWaypoint(tokenCenter);
measure(event);
game.user.broadcastActivity({ruler});
return true;
return false;
}

function deactivate() {
Expand All @@ -64,7 +64,7 @@ function deactivate() {
if (ruler._state !== Ruler.STATES.MOVING)
ruler._endMeasurement()
}
return true;
return false;
}

function onClickRight(wrapped, event) {
Expand Down

0 comments on commit f9739f9

Please sign in to comment.