From 9ca21bdcb894bc1aaf198980d71080b4fb48d2c1 Mon Sep 17 00:00:00 2001 From: Schluffe Date: Fri, 18 Sep 2026 19:05:24 +0200 Subject: [PATCH] Fix engine errors --- engine/Scene.ts | 3 ++- engine/Viewport.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/engine/Scene.ts b/engine/Scene.ts index cb0d41f..cce35dd 100644 --- a/engine/Scene.ts +++ b/engine/Scene.ts @@ -167,6 +167,7 @@ export async function setScene(name: string): Promise { postProcess(); } + const previousSceneData = currentScene.data; currentScene.data = data; self.dispatchEvent(new Event("resize")); @@ -174,7 +175,7 @@ export async function setScene(name: string): Promise { currentScene.process = process; for (const callback of sceneChangeSet.values()) { - callback(data, currentScene.data); + callback(currentScene.data, previousSceneData); } } diff --git a/engine/Viewport.ts b/engine/Viewport.ts index 7af503b..a158f0f 100644 --- a/engine/Viewport.ts +++ b/engine/Viewport.ts @@ -90,7 +90,7 @@ export function resizeCanvas(width: number, height: number): void { boundaries.minX = translation.x; boundaries.minY = translation.y; boundaries.maxX = translation.x + canvas.width; - boundaries.maxY = translation.x + canvas.height; + boundaries.maxY = translation.y + canvas.height; } export function resetCtx() {