Replaced requestAnimationFrame with setInterval
This commit is contained in:
parent
97fb30d741
commit
47992755e2
@ -89,20 +89,19 @@ export class ResizeEvent extends BaseEvent {
|
||||
* @constructor
|
||||
*/
|
||||
|
||||
let ThrowableObjects = []
|
||||
let ThrowableObjects = new Set()
|
||||
let ThrowableRequests = null
|
||||
|
||||
function stepThrowAnimation() {
|
||||
let clones = [...ThrowableObjects]
|
||||
ThrowableObjects = []
|
||||
ThrowableObjects.clear()
|
||||
for(let obj of clones) {
|
||||
obj.animateThrow()
|
||||
}
|
||||
requestAnimationFrame(stepThrowAnimation)
|
||||
}
|
||||
|
||||
function startThrowableLoop() {
|
||||
requestAnimationFrame(stepThrowAnimation)
|
||||
setInterval(stepThrowAnimation, 33)
|
||||
return true
|
||||
}
|
||||
|
||||
@ -200,7 +199,7 @@ class Throwable {
|
||||
}
|
||||
|
||||
recurseAnimateThrow() {
|
||||
ThrowableObjects.push(this)
|
||||
ThrowableObjects.add(this)
|
||||
if (ThrowableRequests == null) {
|
||||
ThrowableRequests = startThrowableLoop()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user