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() {