-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
When the browser tab sleeps, the delay of repeated tweens is not keep #557
Comments
MasatoMakino
changed the title
When the browser tab sleeps, the delay of repeated tweens is not keepcollapse
When the browser tab sleeps, the delay of repeated tweens is not keep
Jul 6, 2020
Hello! Yeah, this is a known issue. The Tween code merely gets the current time, it does not account for time that the window is unfocused and The current workaround is to manually update tweens, passing in our own time values to It would be great to fix this. If interested in making a PR, happy to review. |
trusktr
added a commit
to MasatoMakino/tween.js
that referenced
this issue
Jan 15, 2024
* main: (107 commits) v22.0.0 examples: add an example showing we can import into Node.js projects in ESM format fix import for Node.js CommonJS projects v21.1.1 eslint started having an error with the latest environment, so delete it for now chore: ignore output .js files in typescript example examples: add two example projects, one plain JS modules, the other TS compiled to plain JS modules examples: simplify the createGraph function, and make it crispier on devices with devicePixelRatio higher than 1 refactor: remove requestAnimationFrame polyfill, it has been out for a long time in all browsers update formatting update prettier v21.1.0 Update package.json, remove duplicate entry so we can merge fix: Use type definition in ESM change maintainers list and remove dead link Add missing types file to package.json exports docs: update tutorial link fix(package.json): fix export map types Fix CJS entry point v21.0.0 ...
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
When the browser tab goes into the background, the delay of repeated tween is not keep.
Expected Behavior
Tabs are restored from the background, the delay of tween is unchanged.
Actual Behavior
Tabs are restored from the background, the delay of tween changes.
Steps to Reproduce
tween._repeatDelayTime
)Possible Fix
When the browser tabs are in the background,
requestAnimationFrame
will go to sleep. requestAnimationFrame will return, and the pass large delta time.However,
tween.js
loop does not take large delta time.source code
In this process, time is rounded to
elapsed
. And the delta time disappears.For example, we get an overflow for this process. You can use this value to modify
this._repeat
andthis._startTime
.source code
Environment
macOS 10.15.2
Chrome 83.0.4103.116 (Official Build)
tween.js 18.6.0
Thank you.
The text was updated successfully, but these errors were encountered: