Skip to content

Commit

Permalink
Fix error when using visibility radius setting.
Browse files Browse the repository at this point in the history
  • Loading branch information
Wibble199 committed Feb 22, 2025
1 parent 2cb573a commit 8086208
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion module.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "terrain-height-tools",
"title": "Terrain Height Tools",
"description": "Tools for painting grid cells with terrain heights and calculating line of sight with respect to these heights.",
"version": "0.5.0",
"version": "0.5.1",
"compatibility": {
"minimum": "12",
"verified": "12",
Expand Down
8 changes: 4 additions & 4 deletions module/layers/terrain-height-graphics.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -190,18 +190,18 @@ export class TerrainHeightGraphics extends PIXI.Container {
// Create a radial gradient texture
radius *= canvas.grid.size;

const canvas = document.createElement("canvas");
canvas.width = canvas.height = radius * 2;
const canvasElement = document.createElement("canvas");
canvasElement.width = canvasElement.height = radius * 2;

const context = canvas.getContext("2d");
const context = canvasElement.getContext("2d");
const gradient = context.createRadialGradient(radius, radius, 0, radius, radius, radius);
gradient.addColorStop(0.8, "rgba(255, 255, 255, 1)");
gradient.addColorStop(1, "rgba(255, 255, 255, 0)");

context.fillStyle = gradient;
context.fillRect(0, 0, radius * 2, radius * 2);

const texture = PIXI.Texture.from(canvas);
const texture = PIXI.Texture.from(canvasElement);

// Create sprite
this.cursorRadiusMask = new PIXI.Sprite(texture);
Expand Down

0 comments on commit 8086208

Please sign in to comment.