From ccd5f9cc8f76beb25667e20e7fa1d26520961cff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Barth=C3=A9lemy?= <31370477+BarthPaleologue@users.noreply.github.com> Date: Sun, 26 Nov 2023 19:49:10 +0100 Subject: [PATCH] Fixed resize crash under WebGPU --- src/ts/flatfield.ts | 2 +- src/ts/index.ts | 2 +- src/ts/minimal.ts | 2 +- src/ts/planet.ts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ts/flatfield.ts b/src/ts/flatfield.ts index 8d6ee32..c74a53b 100644 --- a/src/ts/flatfield.ts +++ b/src/ts/flatfield.ts @@ -137,7 +137,7 @@ scene.executeWhenReady(() => { }); window.addEventListener("resize", () => { - engine.resize(); canvas.width = window.innerWidth; canvas.height = window.innerHeight; + engine.resize(true); }); diff --git a/src/ts/index.ts b/src/ts/index.ts index aae95d9..c48bbad 100644 --- a/src/ts/index.ts +++ b/src/ts/index.ts @@ -218,7 +218,7 @@ scene.executeWhenReady(() => { }); window.addEventListener("resize", () => { - engine.resize(); canvas.width = window.innerWidth; canvas.height = window.innerHeight; + engine.resize(true); }); diff --git a/src/ts/minimal.ts b/src/ts/minimal.ts index 135fb33..2e36dba 100644 --- a/src/ts/minimal.ts +++ b/src/ts/minimal.ts @@ -48,7 +48,7 @@ ThinInstancePatch.CreateSquare(new Vector3(0, 0, 0), patchSize, patchResolution, }); window.addEventListener("resize", () => { - engine.resize(); canvas.width = window.innerWidth; canvas.height = window.innerHeight; + engine.resize(true); }); diff --git a/src/ts/planet.ts b/src/ts/planet.ts index 2be283a..46927db 100644 --- a/src/ts/planet.ts +++ b/src/ts/planet.ts @@ -73,7 +73,7 @@ scene.executeWhenReady(() => { }); window.addEventListener("resize", () => { - engine.resize(); canvas.width = window.innerWidth; canvas.height = window.innerHeight; + engine.resize(true); });