Skip to content

Commit

Permalink
Swap deprecated getCenter in token placement
Browse files Browse the repository at this point in the history
  • Loading branch information
arbron committed Aug 6, 2024
1 parent 05bc94e commit dbfc70b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions module/canvas/token-placement.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit dbfc70b

Please sign in to comment.