mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-09 06:12:34 -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() {
|
focus: function() {
|
||||||
focused = true;
|
focused = true;
|
||||||
// Switch to falst checkCallback calls while window is focused.
|
// Switch to falst checkCallback calls while window is focused.
|
||||||
if (timer)
|
timer && setTimer(fastRate);
|
||||||
setTimer(fastRate);
|
|
||||||
},
|
},
|
||||||
blur: function() {
|
blur: function() {
|
||||||
focused = false;
|
focused = false;
|
||||||
// Switch to slow checkCallback calls while window is blured.
|
// Switch to slow checkCallback calls while window is blured.
|
||||||
if (timer)
|
timer && setTimer(slowRate);
|
||||||
setTimer(slowRate);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -123,7 +121,6 @@ Event.requestAnimationFrame = new function() {
|
||||||
if (request)
|
if (request)
|
||||||
return request(callback, element);
|
return request(callback, element);
|
||||||
callbacks.push([callback, element]);
|
callbacks.push([callback, element]);
|
||||||
if (!timer)
|
!timer && setTimer(fastRate);
|
||||||
setTimer(fastRate);
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue