Skip to content

Commit

Permalink
Merge pull request #18 from mxdvl/high-dpi
Browse files Browse the repository at this point in the history
Support high DPI screens
  • Loading branch information
aemkei authored Nov 3, 2020
2 parents 26ae0b1 + dae2920 commit f2bfdc4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,15 @@ const editor = document.getElementById('editor');
const comment = document.getElementById('comment');
const output = document.getElementById('output');
const context = output.getContext('2d');
const dpr = window.devicePixelRatio || 1;

let callback = function () {};
let startTime = new Date();
let code = '';

output.width = output.height = width;
output.width = output.height = width * dpr;
context.scale(dpr,dpr);
output.style.width = output.style.height = `${width}px`;

const cells = [];

Expand Down Expand Up @@ -89,7 +92,8 @@ function render() {
return;
}

output.width = output.height = width;
output.width = output.height = width * dpr;
context.scale(dpr,dpr)
let index = 0;
for (let y = 0; y < count; y++) {
for (let x = 0; x < count; x++) {
Expand Down

0 comments on commit f2bfdc4

Please sign in to comment.