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

Timer: only update delta and elapsed time when document is visible #27651

Merged
merged 2 commits into from
Jan 30, 2024

Conversation

mrxz
Copy link
Contributor

@mrxz mrxz commented Jan 30, 2024

Fixed #27626

Description

As suggested in the linked issue, a check on document.hidden in Timer.update to ensure that any rAF happening while the page is hidden does not result in elapsed time. The _delta is explicitly set to 0, otherwise getDelta would continue to return the last computed delta.

This contribution is funded by Fern Solutions

@Mugen87 Mugen87 added this to the r161 milestone Jan 30, 2024
Update code style.
@Mugen87 Mugen87 merged commit f55b34f into mrdoob:dev Jan 30, 2024
9 of 10 checks passed
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.

Large time delta values using Timer when page is not visible (in Firefox)
2 participants