Skip to content

Commit

Permalink
Fix unexpected behavior when zooming
Browse files Browse the repository at this point in the history
Waiting for the sweep animation to finish fixes this issue.

Fixes #6
  • Loading branch information
imericxu committed Jul 11, 2024
1 parent d0959f5 commit a4aa5b7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lib/MazeDrawer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,8 @@ export default class MazeDrawer {
this.fillWithWall();
}

public zoomTo(zoomLevel: number): void {
public async zoomTo(zoomLevel: number): Promise<void> {
await this.waitForSweepAnimations();
this.zoomLevel = zoomLevel;
this.updateCanvasSize();
const redraw = () => {
Expand Down

0 comments on commit a4aa5b7

Please sign in to comment.