diff options
| author | julian laplace <julescarbon@gmail.com> | 2023-05-10 15:13:47 +0200 |
|---|---|---|
| committer | julian laplace <julescarbon@gmail.com> | 2023-05-10 15:13:47 +0200 |
| commit | 7af6dfc46f9a94e3966cdfa4e0d353e989eb9070 (patch) | |
| tree | 10ba8c83dd83dde4ffa74ec4fd7ce0868f145b70 /src/relabi/canvas.js | |
| parent | ec93f3236c39e03b993d0e15093ac354a20cb9ea (diff) | |
add stars and velocity
Diffstat (limited to 'src/relabi/canvas.js')
| -rw-r--r-- | src/relabi/canvas.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/relabi/canvas.js b/src/relabi/canvas.js index 62e5442..68f18c5 100644 --- a/src/relabi/canvas.js +++ b/src/relabi/canvas.js @@ -34,6 +34,8 @@ export default class RelabiCanvas { // Start drawing this.requestAnimationFrame(0); + + window.addEventListener("resize", () => this.resize()); } /** @@ -53,6 +55,9 @@ export default class RelabiCanvas { requestAnimationFrame((frame) => { this.requestAnimationFrame(frame); }); + if (this.relabi.paused) { + return; + } this.paint(frame); this.lastFrame = frame; } @@ -211,7 +216,7 @@ export default class RelabiCanvas { continue; } ctx.beginPath(); - ctx.arc(x, y, NOTE_RADIUS, 0, 2 * Math.PI); + ctx.arc(x - NOTE_RADIUS / 2, y, NOTE_RADIUS, 0, 2 * Math.PI); ctx.fillStyle = direction ? `rgba(255,96,128,${opacity})` : `rgba(128,255,96,${opacity})`; |
