Basic UI layout

This commit is contained in:
space-nuko
2023-04-04 17:51:26 -05:00
parent 3353a2610f
commit a4a37755fa
7 changed files with 150 additions and 15 deletions

View File

@@ -36,10 +36,6 @@ export default class ComfyApp {
this.lGraph.start();
// Ensure the canvas fills the window
this.resizeCanvas();
window.addEventListener("resize", this.resizeCanvas.bind(this));
// await this.#invokeExtensionsAsync("init");
await this.registerNodes();
@@ -73,12 +69,16 @@ export default class ComfyApp {
// await this.#invokeExtensionsAsync("setup");
// Ensure the canvas fills the window
this.resizeCanvas();
window.addEventListener("resize", this.resizeCanvas.bind(this));
return Promise.resolve();
}
private resizeCanvas() {
this.canvasEl.width = window.innerWidth;
this.canvasEl.height = window.innerHeight;
resizeCanvas() {
this.canvasEl.width = this.canvasEl.parentElement.clientWidth;
this.canvasEl.height = this.canvasEl.parentElement.clientHeight;
this.lCanvas.draw(true, true);
}