mirror of
https://github.com/konvajs/konva.git
synced 2025-09-19 10:47:59 +08:00
setup prettier and make all code better
This commit is contained in:
@@ -1,27 +1,27 @@
|
||||
window.requestAnimFrame = (function(callback){
|
||||
return window.requestAnimationFrame ||
|
||||
window.webkitRequestAnimationFrame ||
|
||||
window.mozRequestAnimationFrame ||
|
||||
window.oRequestAnimationFrame ||
|
||||
window.msRequestAnimationFrame ||
|
||||
function(callback){
|
||||
window.setTimeout(callback, 1000 / 30);
|
||||
};
|
||||
})();
|
||||
window.requestAnimFrame = (function(callback) {
|
||||
return window.requestAnimationFrame ||
|
||||
window.webkitRequestAnimationFrame ||
|
||||
window.mozRequestAnimationFrame ||
|
||||
window.oRequestAnimationFrame ||
|
||||
window.msRequestAnimationFrame ||
|
||||
function(callback) {
|
||||
window.setTimeout(callback, 1000 / 30);
|
||||
};
|
||||
})();
|
||||
|
||||
stats = new Stats();
|
||||
stats.setMode(0);
|
||||
stats.domElement.style.position = 'fixed';
|
||||
stats.domElement.style.left = '0px';
|
||||
stats.domElement.style.top = '0px';
|
||||
document.body.appendChild(stats.domElement);
|
||||
stats = new Stats();
|
||||
stats.setMode(0);
|
||||
stats.domElement.style.position = 'fixed';
|
||||
stats.domElement.style.left = '0px';
|
||||
stats.domElement.style.top = '0px';
|
||||
document.body.appendChild(stats.domElement);
|
||||
|
||||
function setStats() {
|
||||
stats.begin();
|
||||
requestAnimFrame(function(){
|
||||
stats.end();
|
||||
setStats();
|
||||
});
|
||||
}
|
||||
function setStats() {
|
||||
stats.begin();
|
||||
requestAnimFrame(function() {
|
||||
stats.end();
|
||||
setStats();
|
||||
});
|
||||
}
|
||||
|
||||
setStats();
|
||||
setStats();
|
||||
|
Reference in New Issue
Block a user