Apply ruler offset when determining destination after deleting a waypoint
This commit is contained in:
@@ -2,6 +2,9 @@
|
|||||||
### New features
|
### New features
|
||||||
- Right click and spacebar can now be swapped, allowing to place waypoints with right click and removing them with spacebar
|
- Right click and spacebar can now be swapped, allowing to place waypoints with right click and removing them with spacebar
|
||||||
|
|
||||||
|
### Bugfixes
|
||||||
|
- Fixed a bug where the ruler would sometimes jump to a different target location when deleting a waypoint
|
||||||
|
|
||||||
## v1.1.1
|
## v1.1.1
|
||||||
### Bugfixes
|
### Bugfixes
|
||||||
- Fixed a bug where tokens wouldn't be moved to the corect end position on gridless maps
|
- Fixed a bug where tokens wouldn't be moved to the corect end position on gridless maps
|
||||||
|
|||||||
+3
-1
@@ -154,7 +154,9 @@ function onRulerMoveToken(event) {
|
|||||||
|
|
||||||
function deleteWaypoint() {
|
function deleteWaypoint() {
|
||||||
if (canvas.controls.ruler.waypoints.length > 1) {
|
if (canvas.controls.ruler.waypoints.length > 1) {
|
||||||
canvas.controls.ruler._removeWaypoint(canvas.app.renderer.plugins.interaction.mouse.getLocalPosition(canvas.tokens))
|
const mousePosition = canvas.app.renderer.plugins.interaction.mouse.getLocalPosition(canvas.tokens)
|
||||||
|
const rulerOffset = canvas.controls.ruler.rulerOffset
|
||||||
|
canvas.controls.ruler._removeWaypoint({x: mousePosition.x + rulerOffset.x, y: mousePosition.y + rulerOffset.y})
|
||||||
game.user.broadcastActivity({ruler: canvas.controls.ruler})
|
game.user.broadcastActivity({ruler: canvas.controls.ruler})
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
Reference in New Issue
Block a user