Skip to content

Commit

Permalink
Custom source debug page support for Safari and Firefox (#11680)
Browse files Browse the repository at this point in the history
  • Loading branch information
SnailBones authored Apr 6, 2022
1 parent d5a5145 commit 4cc3a8d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions debug/custom-source.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,9 @@
tileSize,
async loadTile({z, x, y}) {
const tileSize = 256;
const offscreenCanvas = new OffscreenCanvas(tileSize, tileSize);
const context = offscreenCanvas.getContext('2d');
const canvas = document.createElement('canvas');
canvas.width = canvas.height = tileSize;
const context = canvas.getContext('2d');
context.fillStyle = 'red';
context.fillRect(0, 0, tileSize, tileSize);

Expand All @@ -56,8 +57,9 @@
},
prepareTile({z, x, y}) {
const tileSize = 256;
const offscreenCanvas = new OffscreenCanvas(tileSize, tileSize);
const context = offscreenCanvas.getContext('2d');
const canvas = document.createElement('canvas');
canvas.width = canvas.height = tileSize;
const context = canvas.getContext('2d');
context.fillStyle = currentColor;
context.fillRect(0, 0, tileSize, tileSize);

Expand Down

0 comments on commit 4cc3a8d

Please sign in to comment.