Skip to content

Commit

Permalink
fix: resolve issue with resume() being invoked multiple times
Browse files Browse the repository at this point in the history
  • Loading branch information
lslzl3000 committed Nov 21, 2024
1 parent eff6082 commit 9b2d7d1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Engine3D.ts
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,8 @@ export class Engine3D {
* Resume the engine render
*/
public static resume() {
this._requestAnimationFrameID = requestAnimationFrame((t) => this.render(t));
if(this._requestAnimationFrameID == 0)
this._requestAnimationFrameID = requestAnimationFrame((t) => this.render(t));
}

/**
Expand Down

0 comments on commit 9b2d7d1

Please sign in to comment.