canvas now argument

This commit is contained in:
Alexander Popov 2023-04-06 18:08:19 +03:00
parent 1e51b6a63b
commit f056459b81
Signed by: iiiypuk
GPG Key ID: E47FE0AB36CD5ED6
2 changed files with 3 additions and 3 deletions

View File

@ -3,8 +3,8 @@ import { Settings } from './settings.js';
import { Pointer } from './pointer.js';
export class App {
constructor(w, h) {
this.canvas = document.querySelector('canvas');
constructor(canvas, w, h) {
this.canvas = canvas;
this.context = this.canvas.getContext('2d');
this.scene = new Scene(this.canvas, this.context, w, h);

View File

@ -1,5 +1,5 @@
import { App } from './app.js';
window.addEventListener('DOMContentLoaded', () => {
new App(400, 400);
new App(document.querySelector('canvas'), 400, 400);
});