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