Reformat with prettier
This commit is contained in:
+2
-6
@@ -380,9 +380,7 @@ export function extendRuler() {
|
|||||||
options.snap = options.snap ?? true;
|
options.snap = options.snap ?? true;
|
||||||
if (this.waypoints.filter(w => !w.isPrevious).length > 1) {
|
if (this.waypoints.filter(w => !w.isPrevious).length > 1) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
const mousePosition = getPointer().getLocalPosition(
|
const mousePosition = getPointer().getLocalPosition(canvas.tokens);
|
||||||
canvas.tokens,
|
|
||||||
);
|
|
||||||
const rulerOffset = this.rulerOffset;
|
const rulerOffset = this.rulerOffset;
|
||||||
|
|
||||||
// Options are not passed to _removeWaypoint in vanilla Foundry.
|
// Options are not passed to _removeWaypoint in vanilla Foundry.
|
||||||
@@ -484,9 +482,7 @@ export function extendRuler() {
|
|||||||
if (isToken && game.settings.get(settingsKey, "enableMovementHistory"))
|
if (isToken && game.settings.get(settingsKey, "enableMovementHistory"))
|
||||||
ruler.dragRulerAddWaypointHistory(getMovementHistory(entity));
|
ruler.dragRulerAddWaypointHistory(getMovementHistory(entity));
|
||||||
ruler.dragRulerAddWaypoint(entityCenter, {snap: false});
|
ruler.dragRulerAddWaypoint(entityCenter, {snap: false});
|
||||||
const mousePosition = getPointer().getLocalPosition(
|
const mousePosition = getPointer().getLocalPosition(canvas.tokens);
|
||||||
canvas.tokens,
|
|
||||||
);
|
|
||||||
const destination = {
|
const destination = {
|
||||||
x: mousePosition.x + ruler.rulerOffset.x,
|
x: mousePosition.x + ruler.rulerOffset.x,
|
||||||
y: mousePosition.y + ruler.rulerOffset.y,
|
y: mousePosition.y + ruler.rulerOffset.y,
|
||||||
|
|||||||
+2
-4
@@ -286,13 +286,11 @@ export function isClose(a, b, delta) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function getPointer() {
|
export function getPointer() {
|
||||||
return canvas.app.renderer.plugins.interaction?.mouse ?? canvas.app.renderer.events.pointer
|
return canvas.app.renderer.plugins.interaction?.mouse ?? canvas.app.renderer.events.pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getMeasurePosition() {
|
export function getMeasurePosition() {
|
||||||
const mousePosition = getPointer().getLocalPosition(
|
const mousePosition = getPointer().getLocalPosition(canvas.tokens);
|
||||||
canvas.tokens,
|
|
||||||
);
|
|
||||||
const rulerOffset = canvas.controls.ruler.rulerOffset;
|
const rulerOffset = canvas.controls.ruler.rulerOffset;
|
||||||
const measurePosition = {x: mousePosition.x + rulerOffset.x, y: mousePosition.y + rulerOffset.y};
|
const measurePosition = {x: mousePosition.x + rulerOffset.x, y: mousePosition.y + rulerOffset.y};
|
||||||
return measurePosition;
|
return measurePosition;
|
||||||
|
|||||||
Reference in New Issue
Block a user