Skip to content

Commit ee5b9aa

Browse files
committed
fix again
1 parent 8b9ac36 commit ee5b9aa

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

main.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ let offset = 0;
66
let paramValues = new Object();
77
let rotateNow;
88
let autoNow;
9+
let devicePixelRatio;
910

1011

1112

@@ -69,8 +70,13 @@ window.onload = () => {
6970

7071

7172
const reset = () => {
72-
canvas.width = window.innerWidth;
73-
canvas.height = window.innerHeight;
73+
canvas.width = window.innerWidth * devicePixelRatio;
74+
canvas.height = window.innerHeight * devicePixelRatio;
75+
76+
canvas.style.width = window.innerWidth + "px";
77+
canvas.style.height = window.innerHeight + "px";
78+
79+
ctx.scale(devicePixelRatio, devicePixelRatio);
7480
ctx.lineCap="square";
7581
ctx.lineDashOffset=30;
7682
ctx.shadowBlur = 0;

0 commit comments

Comments
 (0)