From dbfc70bc89f2322a077a298aa559c3a0e22c0ef9 Mon Sep 17 00:00:00 2001 From: Jeff Hitchcock Date: Tue, 6 Aug 2024 10:17:07 -0700 Subject: [PATCH] Swap deprecated getCenter in token placement --- module/canvas/token-placement.mjs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/module/canvas/token-placement.mjs b/module/canvas/token-placement.mjs index 876abbbb39..8540f38520 100644 --- a/module/canvas/token-placement.mjs +++ b/module/canvas/token-placement.mjs @@ -232,10 +232,10 @@ export default class TokenPlacement { const preview = this.#previews[idx]; const adjustment = this.#getSnapAdjustment(preview); const point = event.data.getLocalPosition(canvas.tokens); - const center = canvas.grid.getCenter(point.x - adjustment.x, point.y - adjustment.y); + const center = canvas.grid.getCenterPoint({ x: point.x - adjustment.x, y: point.y - adjustment.y }); preview.updateSource({ - x: center[0] + adjustment.x - Math.round((this.config.tokens[idx].width * canvas.dimensions.size) / 2), - y: center[1] + adjustment.y - Math.round((this.config.tokens[idx].height * canvas.dimensions.size) / 2) + x: center.x + adjustment.x - Math.round((this.config.tokens[idx].width * canvas.dimensions.size) / 2), + y: center.y + adjustment.y - Math.round((this.config.tokens[idx].height * canvas.dimensions.size) / 2) }); this.#placements[idx].x = preview.x; this.#placements[idx].y = preview.y;