From 7e975d0efe8e455b5e21305703d8fb22379199de Mon Sep 17 00:00:00 2001 From: pandamicro Date: Tue, 11 Apr 2017 14:59:14 +0800 Subject: [PATCH] Fix cancelAnimationFrame override issue --- cocos2d/core/CCGame.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cocos2d/core/CCGame.js b/cocos2d/core/CCGame.js index 449ddb5556..4c43e9ea53 100644 --- a/cocos2d/core/CCGame.js +++ b/cocos2d/core/CCGame.js @@ -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 ||