mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-07 13:22:07 -05:00
Simple optimisations.
This commit is contained in:
parent
3a8bdeb19b
commit
db1e7e8880
1 changed files with 3 additions and 6 deletions
|
@ -108,14 +108,12 @@ Event.requestAnimationFrame = new function() {
|
|||
focus: function() {
|
||||
focused = true;
|
||||
// Switch to falst checkCallback calls while window is focused.
|
||||
if (timer)
|
||||
setTimer(fastRate);
|
||||
timer && setTimer(fastRate);
|
||||
},
|
||||
blur: function() {
|
||||
focused = false;
|
||||
// Switch to slow checkCallback calls while window is blured.
|
||||
if (timer)
|
||||
setTimer(slowRate);
|
||||
timer && setTimer(slowRate);
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -123,7 +121,6 @@ Event.requestAnimationFrame = new function() {
|
|||
if (request)
|
||||
return request(callback, element);
|
||||
callbacks.push([callback, element]);
|
||||
if (!timer)
|
||||
setTimer(fastRate);
|
||||
!timer && setTimer(fastRate);
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue