Fix cancelAnimationFrame override issue

This commit is contained in:
pandamicro
2017-04-11 14:59:14 +08:00
parent 9d257d6226
commit 7e975d0efe
+4 -4
View File
@@ -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 ||