Skip to content

Commit 8b9ac36

Browse files
committed
Trying to increase resolution for mobile
1 parent b6c2eaf commit 8b9ac36

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

main.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,15 @@ const rotate =()=>{
4646
window.onload = () => {
4747
canvas =document.getElementById('canvas1');
4848
ctx = canvas.getContext('2d');
49+
devicePixelRatio = window.devicePixelRatio || 1;
50+
51+
canvas.width = window.innerWidth * devicePixelRatio;
52+
canvas.height = window.innerHeight * devicePixelRatio;
53+
54+
canvas.style.width = window.innerWidth + "px";
55+
canvas.style.height = window.innerHeight + "px";
56+
57+
ctx.scale(devicePixelRatio, devicePixelRatio);
4958

5059

5160
resetParamValues();

0 commit comments

Comments
 (0)