diff --git a/src/lib/MazeDrawer.ts b/src/lib/MazeDrawer.ts index 2be721f..68b64df 100644 --- a/src/lib/MazeDrawer.ts +++ b/src/lib/MazeDrawer.ts @@ -156,7 +156,8 @@ export default class MazeDrawer { this.fillWithWall(); } - public zoomTo(zoomLevel: number): void { + public async zoomTo(zoomLevel: number): Promise { + await this.waitForSweepAnimations(); this.zoomLevel = zoomLevel; this.updateCanvasSize(); const redraw = () => {