Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent matterjs stalls when returning to inactive tabs #6978

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ubershmekel
Copy link
Contributor

Please do not update the README or Change Log, we will do this when we merge your PR.

This PR (delete as applicable)

  • Fixes a bug

Describe the changes below:

Fixes #6977

A more complete PR would include adding this to the type Phaser.Types.Physics.Matter.MatterRunnerConfig

This change limits the amount of time matterjs will be simulating after a tab is inactive for a long time. The number 100ms seems a reasonable maximum amount of time to wait for the game loop to resume.

Another issue with this PR is I don't understand why does src/physics/matter-js/World.js not use Runner.create as defined in src/physics/matter-js/lib/core/Runner.js but I'd rather someone that knows what's going on give an opinion on that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tab stalls when using matterjs and moving away from the tab for a while, probably Engine.update related
1 participant