mirror of
https://github.com/chartjs/Chart.js.git
synced 2025-12-08 20:36:08 +00:00
Reduce requestAnimationFrame polyfill (#7033)
* Reduce requestAnimationFrame polyfill * Remove another unnecessary polyfill
This commit is contained in:
parent
dac52d189e
commit
4462a2c950
@ -101,21 +101,14 @@ export default {
|
||||
|
||||
return niceFraction * Math.pow(10, exponent);
|
||||
},
|
||||
// Request animation polyfill - https://www.paulirish.com/2011/requestanimationframe-for-smart-animating/
|
||||
// Request animation polyfill
|
||||
requestAnimFrame: (function() {
|
||||
if (typeof window === 'undefined') {
|
||||
return function(callback) {
|
||||
callback();
|
||||
};
|
||||
}
|
||||
return window.requestAnimationFrame ||
|
||||
window.webkitRequestAnimationFrame ||
|
||||
window.mozRequestAnimationFrame ||
|
||||
window.oRequestAnimationFrame ||
|
||||
window.msRequestAnimationFrame ||
|
||||
function(callback) {
|
||||
return window.setTimeout(callback, 1000 / 60);
|
||||
};
|
||||
return window.requestAnimationFrame;
|
||||
}()),
|
||||
// -- Canvas methods
|
||||
fontString: function(pixelSize, fontStyle, fontFamily) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user