Some browsers use cancelAnimationFrame with prefix like this: msCancelRequestAnimationFrame (IE11 for example). This will fix it

This commit is contained in:
Stoneman1 2016-11-23 11:50:39 +02:00
parent 8bf3c83381
commit ed625c33d4

View file

@ -42,7 +42,7 @@ Phaser.RequestAnimationFrame = function(game, forceSetTimeOut) {
for (var x = 0; x < vendors.length && !window.requestAnimationFrame; x++)
{
window.requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame'];
window.cancelAnimationFrame = window[vendors[x] + 'CancelAnimationFrame'];
window.cancelAnimationFrame = window[vendors[x] + 'CancelAnimationFrame'] || window[vendors[x] + 'CancelRequestAnimationFrame'];
}
/**