mirror of
https://github.com/boxgaming/qbjs.git
synced 2024-05-12 08:00:12 +00:00
Corrected _Arccsc calculation. Updated _Limit delay implementation to be more consistent across browsers
This commit is contained in:
parent
25d146c8e4
commit
708d5b02c4
8
qb.js
8
qb.js
|
@ -252,7 +252,7 @@ var QB = new function() {
|
|||
};
|
||||
|
||||
this.func__Arccsc = function(x) {
|
||||
return Math.sin(1 / x);
|
||||
return Math.asin(1 / x);
|
||||
};
|
||||
|
||||
this.func__Arcsec = function(x) {
|
||||
|
@ -551,7 +551,11 @@ var QB = new function() {
|
|||
|
||||
this.sub__Limit = async function(fps) {
|
||||
_flushAllScreenCache();
|
||||
await GX.sleep((1000 - (new Date() - _lastLimitTime))/fps);
|
||||
var frameMillis = 1000 / fps / 1.15;
|
||||
await GX.sleep(0);
|
||||
while (Date.now() - _lastLimitTime < frameMillis) {
|
||||
await GX.sleep(0);
|
||||
}
|
||||
_lastLimitTime = new Date();
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue