Fix engine errors
This commit is contained in:
+2
-1
@@ -167,6 +167,7 @@ export async function setScene(name: string): Promise<void> {
|
|||||||
postProcess();
|
postProcess();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const previousSceneData = currentScene.data;
|
||||||
currentScene.data = data;
|
currentScene.data = data;
|
||||||
self.dispatchEvent(new Event("resize"));
|
self.dispatchEvent(new Event("resize"));
|
||||||
|
|
||||||
@@ -174,7 +175,7 @@ export async function setScene(name: string): Promise<void> {
|
|||||||
currentScene.process = process;
|
currentScene.process = process;
|
||||||
|
|
||||||
for (const callback of sceneChangeSet.values()) {
|
for (const callback of sceneChangeSet.values()) {
|
||||||
callback(data, currentScene.data);
|
callback(currentScene.data, previousSceneData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -90,7 +90,7 @@ export function resizeCanvas(width: number, height: number): void {
|
|||||||
boundaries.minX = translation.x;
|
boundaries.minX = translation.x;
|
||||||
boundaries.minY = translation.y;
|
boundaries.minY = translation.y;
|
||||||
boundaries.maxX = translation.x + canvas.width;
|
boundaries.maxX = translation.x + canvas.width;
|
||||||
boundaries.maxY = translation.x + canvas.height;
|
boundaries.maxY = translation.y + canvas.height;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function resetCtx() {
|
export function resetCtx() {
|
||||||
|
|||||||
Reference in New Issue
Block a user