mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-02 00:22:43 +08:00
Merge pull request #1579 from pandamicro/v1.4
Fix cancelAnimationFrame override issue
This commit is contained in:
@@ -223,7 +223,7 @@ var game = {
|
||||
var self = this, config = self.config, CONFIG_KEY = self.CONFIG_KEY;
|
||||
config[CONFIG_KEY.frameRate] = frameRate;
|
||||
if (self._intervalId)
|
||||
window.cancelAnimationFrame(self._intervalId);
|
||||
window.cancelAnimFrame(self._intervalId);
|
||||
self._intervalId = 0;
|
||||
self._paused = true;
|
||||
self._setAnimFrame();
|
||||
@@ -255,7 +255,7 @@ var game = {
|
||||
}
|
||||
// Pause main loop
|
||||
if (this._intervalId)
|
||||
window.cancelAnimationFrame(this._intervalId);
|
||||
window.cancelAnimFrame(this._intervalId);
|
||||
this._intervalId = 0;
|
||||
},
|
||||
|
||||
@@ -507,7 +507,7 @@ var game = {
|
||||
this._frameTime = 1000 / frameRate;
|
||||
if (frameRate !== 60 && frameRate !== 30) {
|
||||
window.requestAnimFrame = this._stTime;
|
||||
window.cancelAnimationFrame = this._ctTime;
|
||||
window.cancelAnimFrame = this._ctTime;
|
||||
}
|
||||
else {
|
||||
window.requestAnimFrame = window.requestAnimationFrame ||
|
||||
@@ -516,7 +516,7 @@ var game = {
|
||||
window.oRequestAnimationFrame ||
|
||||
window.msRequestAnimationFrame ||
|
||||
this._stTime;
|
||||
window.cancelAnimationFrame = window.cancelAnimationFrame ||
|
||||
window.cancelAnimFrame = window.cancelAnimationFrame ||
|
||||
window.cancelRequestAnimationFrame ||
|
||||
window.msCancelRequestAnimationFrame ||
|
||||
window.mozCancelRequestAnimationFrame ||
|
||||
|
||||
Reference in New Issue
Block a user