Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@pixi/ticker

Package Overview
Dependencies
Maintainers
3
Versions
118
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pixi/ticker - npm Package Compare versions

Comparing version 5.1.0 to 5.1.1

27

dist/ticker.js
/*!
* @pixi/ticker - v5.1.0
* Compiled Fri, 19 Jul 2019 21:54:36 UTC
* @pixi/ticker - v5.1.1
* Compiled Fri, 02 Aug 2019 23:20:23 UTC
*

@@ -349,2 +349,11 @@ * @pixi/ticker is licensed under the MIT License.

/**
* The last time keyframe was executed.
* Maintains a relatively fixed interval with the previous value.
* @member {number}
* @default -1
* @private
*/
this._lastFrame = -1;
/**
* Internal tick method bound to ticker instance.

@@ -392,2 +401,3 @@ * This is because in early 2015, Function.bind

this.lastTime = performance.now();
this._lastFrame = this.lastTime;
this._requestId = requestAnimationFrame(this._tick);

@@ -640,14 +650,15 @@ }

// if not enough time has passed, exit the function.
// We give a padding (5% of minElapsedMS) to elapsedMS for this check, because the
// nature of request animation frame means that not all browsers will return precise values.
// However, because rAF works based on v-sync, it's won't change the effective FPS.
// If not enough time has passed, exit the function.
// Get ready for next frame by setting _lastFrame, but based on _minElapsedMS
// adjustment to ensure a relatively stable interval.
if (this._minElapsedMS)
{
var elapsedMSPadding = this._minElapsedMS * 0.05;
var delta = currentTime - this._lastFrame | 0;
if (elapsedMS + elapsedMSPadding < this._minElapsedMS)
if (delta < this._minElapsedMS)
{
return;
}
this._lastFrame = currentTime - (delta % this._minElapsedMS);
}

@@ -654,0 +665,0 @@

/*!
* @pixi/ticker - v5.1.0
* Compiled Fri, 19 Jul 2019 21:54:36 UTC
* @pixi/ticker - v5.1.1
* Compiled Fri, 02 Aug 2019 23:20:23 UTC
*

@@ -8,3 +8,3 @@ * @pixi/ticker is licensed under the MIT License.

*/
this.PIXI=this.PIXI||{};var _pixi_ticker=function(t,e){"use strict";e.settings.TARGET_FPMS=.06;var i={INTERACTION:50,HIGH:25,NORMAL:0,LOW:-25,UTILITY:-50},s=function(t,e,i,s){void 0===e&&(e=null),void 0===i&&(i=0),void 0===s&&(s=!1),this.fn=t,this.context=e,this.priority=i,this.once=s,this.next=null,this.previous=null,this._destroyed=!1};s.prototype.match=function(t,e){return e=e||null,this.fn===t&&this.context===e},s.prototype.emit=function(t){this.fn&&(this.context?this.fn.call(this.context,t):this.fn(t));var e=this.next;return this.once&&this.destroy(!0),this._destroyed&&(this.next=null),e},s.prototype.connect=function(t){this.previous=t,t.next&&(t.next.previous=this),this.next=t.next,t.next=this},s.prototype.destroy=function(t){void 0===t&&(t=!1),this._destroyed=!0,this.fn=null,this.context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);var e=this.next;return this.next=t?null:e,this.previous=null,e};var n=function(){var t=this;this._head=new s(null,null,1/0),this._requestId=null,this._maxElapsedMS=100,this._minElapsedMS=0,this.autoStart=!1,this.deltaTime=1,this.deltaMS=1/e.settings.TARGET_FPMS,this.elapsedMS=1/e.settings.TARGET_FPMS,this.lastTime=-1,this.speed=1,this.started=!1,this._protected=!1,this._tick=function(e){t._requestId=null,t.started&&(t.update(e),t.started&&null===t._requestId&&t._head.next&&(t._requestId=requestAnimationFrame(t._tick)))}},r={FPS:{configurable:!0},minFPS:{configurable:!0},maxFPS:{configurable:!0}},h={shared:{configurable:!0},system:{configurable:!0}};n.prototype._requestIfNeeded=function(){null===this._requestId&&this._head.next&&(this.lastTime=performance.now(),this._requestId=requestAnimationFrame(this._tick))},n.prototype._cancelIfNeeded=function(){null!==this._requestId&&(cancelAnimationFrame(this._requestId),this._requestId=null)},n.prototype._startIfPossible=function(){this.started?this._requestIfNeeded():this.autoStart&&this.start()},n.prototype.add=function(t,e,n){return void 0===n&&(n=i.NORMAL),this._addListener(new s(t,e,n))},n.prototype.addOnce=function(t,e,n){return void 0===n&&(n=i.NORMAL),this._addListener(new s(t,e,n,!0))},n.prototype._addListener=function(t){var e=this._head.next,i=this._head;if(e){for(;e;){if(t.priority>e.priority){t.connect(i);break}i=e,e=e.next}t.previous||t.connect(i)}else t.connect(i);return this._startIfPossible(),this},n.prototype.remove=function(t,e){for(var i=this._head.next;i;)i=i.match(t,e)?i.destroy():i.next;return this._head.next||this._cancelIfNeeded(),this},n.prototype.start=function(){this.started||(this.started=!0,this._requestIfNeeded())},n.prototype.stop=function(){this.started&&(this.started=!1,this._cancelIfNeeded())},n.prototype.destroy=function(){if(!this._protected){this.stop();for(var t=this._head.next;t;)t=t.destroy(!0);this._head.destroy(),this._head=null}},n.prototype.update=function(t){var i;if(void 0===t&&(t=performance.now()),t>this.lastTime){if((i=this.elapsedMS=t-this.lastTime)>this._maxElapsedMS&&(i=this._maxElapsedMS),i*=this.speed,this._minElapsedMS)if(i+.05*this._minElapsedMS<this._minElapsedMS)return;this.deltaMS=i,this.deltaTime=this.deltaMS*e.settings.TARGET_FPMS;for(var s=this._head,n=s.next;n;)n=n.emit(this.deltaTime);s.next||this._cancelIfNeeded()}else this.deltaTime=this.deltaMS=this.elapsedMS=0;this.lastTime=t},r.FPS.get=function(){return 1e3/this.elapsedMS},r.minFPS.get=function(){return 1e3/this._maxElapsedMS},r.minFPS.set=function(t){var i=Math.min(this.maxFPS,t),s=Math.min(Math.max(0,i)/1e3,e.settings.TARGET_FPMS);this._maxElapsedMS=1/s},r.maxFPS.get=function(){return this._minElapsedMS?Math.round(1e3/this._minElapsedMS):0},r.maxFPS.set=function(t){if(0===t)this._minElapsedMS=0;else{var e=Math.max(this.minFPS,t);this._minElapsedMS=1/(e/1e3)}},h.shared.get=function(){if(!n._shared){var t=n._shared=new n;t.autoStart=!0,t._protected=!0}return n._shared},h.system.get=function(){if(!n._system){var t=n._system=new n;t.autoStart=!0,t._protected=!0}return n._system},Object.defineProperties(n.prototype,r),Object.defineProperties(n,h);var o=function(){};return o.init=function(t){var e=this;t=Object.assign({autoStart:!0,sharedTicker:!1},t),Object.defineProperty(this,"ticker",{set:function(t){this._ticker&&this._ticker.remove(this.render,this),this._ticker=t,t&&t.add(this.render,this,i.LOW)},get:function(){return this._ticker}}),this.stop=function(){e._ticker.stop()},this.start=function(){e._ticker.start()},this._ticker=null,this.ticker=t.sharedTicker?n.shared:new n,t.autoStart&&this.start()},o.destroy=function(){if(this._ticker){var t=this._ticker;this.ticker=null,t.destroy()}},t.Ticker=n,t.TickerPlugin=o,t.UPDATE_PRIORITY=i,t}({},PIXI);Object.assign(this.PIXI,_pixi_ticker);
this.PIXI=this.PIXI||{};var _pixi_ticker=function(t,e){"use strict";e.settings.TARGET_FPMS=.06;var i={INTERACTION:50,HIGH:25,NORMAL:0,LOW:-25,UTILITY:-50},s=function(t,e,i,s){void 0===e&&(e=null),void 0===i&&(i=0),void 0===s&&(s=!1),this.fn=t,this.context=e,this.priority=i,this.once=s,this.next=null,this.previous=null,this._destroyed=!1};s.prototype.match=function(t,e){return e=e||null,this.fn===t&&this.context===e},s.prototype.emit=function(t){this.fn&&(this.context?this.fn.call(this.context,t):this.fn(t));var e=this.next;return this.once&&this.destroy(!0),this._destroyed&&(this.next=null),e},s.prototype.connect=function(t){this.previous=t,t.next&&(t.next.previous=this),this.next=t.next,t.next=this},s.prototype.destroy=function(t){void 0===t&&(t=!1),this._destroyed=!0,this.fn=null,this.context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);var e=this.next;return this.next=t?null:e,this.previous=null,e};var n=function(){var t=this;this._head=new s(null,null,1/0),this._requestId=null,this._maxElapsedMS=100,this._minElapsedMS=0,this.autoStart=!1,this.deltaTime=1,this.deltaMS=1/e.settings.TARGET_FPMS,this.elapsedMS=1/e.settings.TARGET_FPMS,this.lastTime=-1,this.speed=1,this.started=!1,this._protected=!1,this._lastFrame=-1,this._tick=function(e){t._requestId=null,t.started&&(t.update(e),t.started&&null===t._requestId&&t._head.next&&(t._requestId=requestAnimationFrame(t._tick)))}},r={FPS:{configurable:!0},minFPS:{configurable:!0},maxFPS:{configurable:!0}},h={shared:{configurable:!0},system:{configurable:!0}};n.prototype._requestIfNeeded=function(){null===this._requestId&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))},n.prototype._cancelIfNeeded=function(){null!==this._requestId&&(cancelAnimationFrame(this._requestId),this._requestId=null)},n.prototype._startIfPossible=function(){this.started?this._requestIfNeeded():this.autoStart&&this.start()},n.prototype.add=function(t,e,n){return void 0===n&&(n=i.NORMAL),this._addListener(new s(t,e,n))},n.prototype.addOnce=function(t,e,n){return void 0===n&&(n=i.NORMAL),this._addListener(new s(t,e,n,!0))},n.prototype._addListener=function(t){var e=this._head.next,i=this._head;if(e){for(;e;){if(t.priority>e.priority){t.connect(i);break}i=e,e=e.next}t.previous||t.connect(i)}else t.connect(i);return this._startIfPossible(),this},n.prototype.remove=function(t,e){for(var i=this._head.next;i;)i=i.match(t,e)?i.destroy():i.next;return this._head.next||this._cancelIfNeeded(),this},n.prototype.start=function(){this.started||(this.started=!0,this._requestIfNeeded())},n.prototype.stop=function(){this.started&&(this.started=!1,this._cancelIfNeeded())},n.prototype.destroy=function(){if(!this._protected){this.stop();for(var t=this._head.next;t;)t=t.destroy(!0);this._head.destroy(),this._head=null}},n.prototype.update=function(t){var i;if(void 0===t&&(t=performance.now()),t>this.lastTime){if((i=this.elapsedMS=t-this.lastTime)>this._maxElapsedMS&&(i=this._maxElapsedMS),i*=this.speed,this._minElapsedMS){var s=t-this._lastFrame|0;if(s<this._minElapsedMS)return;this._lastFrame=t-s%this._minElapsedMS}this.deltaMS=i,this.deltaTime=this.deltaMS*e.settings.TARGET_FPMS;for(var n=this._head,r=n.next;r;)r=r.emit(this.deltaTime);n.next||this._cancelIfNeeded()}else this.deltaTime=this.deltaMS=this.elapsedMS=0;this.lastTime=t},r.FPS.get=function(){return 1e3/this.elapsedMS},r.minFPS.get=function(){return 1e3/this._maxElapsedMS},r.minFPS.set=function(t){var i=Math.min(this.maxFPS,t),s=Math.min(Math.max(0,i)/1e3,e.settings.TARGET_FPMS);this._maxElapsedMS=1/s},r.maxFPS.get=function(){return this._minElapsedMS?Math.round(1e3/this._minElapsedMS):0},r.maxFPS.set=function(t){if(0===t)this._minElapsedMS=0;else{var e=Math.max(this.minFPS,t);this._minElapsedMS=1/(e/1e3)}},h.shared.get=function(){if(!n._shared){var t=n._shared=new n;t.autoStart=!0,t._protected=!0}return n._shared},h.system.get=function(){if(!n._system){var t=n._system=new n;t.autoStart=!0,t._protected=!0}return n._system},Object.defineProperties(n.prototype,r),Object.defineProperties(n,h);var a=function(){};return a.init=function(t){var e=this;t=Object.assign({autoStart:!0,sharedTicker:!1},t),Object.defineProperty(this,"ticker",{set:function(t){this._ticker&&this._ticker.remove(this.render,this),this._ticker=t,t&&t.add(this.render,this,i.LOW)},get:function(){return this._ticker}}),this.stop=function(){e._ticker.stop()},this.start=function(){e._ticker.start()},this._ticker=null,this.ticker=t.sharedTicker?n.shared:new n,t.autoStart&&this.start()},a.destroy=function(){if(this._ticker){var t=this._ticker;this.ticker=null,t.destroy()}},t.Ticker=n,t.TickerPlugin=a,t.UPDATE_PRIORITY=i,t}({},PIXI);Object.assign(this.PIXI,_pixi_ticker);
//# sourceMappingURL=ticker.min.js.map
/*!
* @pixi/ticker - v5.1.0
* Compiled Fri, 19 Jul 2019 21:54:36 UTC
* @pixi/ticker - v5.1.1
* Compiled Fri, 02 Aug 2019 23:20:23 UTC
*

@@ -347,2 +347,11 @@ * @pixi/ticker is licensed under the MIT License.

/**
* The last time keyframe was executed.
* Maintains a relatively fixed interval with the previous value.
* @member {number}
* @default -1
* @private
*/
this._lastFrame = -1;
/**
* Internal tick method bound to ticker instance.

@@ -390,2 +399,3 @@ * This is because in early 2015, Function.bind

this.lastTime = performance.now();
this._lastFrame = this.lastTime;
this._requestId = requestAnimationFrame(this._tick);

@@ -638,14 +648,15 @@ }

// if not enough time has passed, exit the function.
// We give a padding (5% of minElapsedMS) to elapsedMS for this check, because the
// nature of request animation frame means that not all browsers will return precise values.
// However, because rAF works based on v-sync, it's won't change the effective FPS.
// If not enough time has passed, exit the function.
// Get ready for next frame by setting _lastFrame, but based on _minElapsedMS
// adjustment to ensure a relatively stable interval.
if (this._minElapsedMS)
{
var elapsedMSPadding = this._minElapsedMS * 0.05;
var delta = currentTime - this._lastFrame | 0;
if (elapsedMS + elapsedMSPadding < this._minElapsedMS)
if (delta < this._minElapsedMS)
{
return;
}
this._lastFrame = currentTime - (delta % this._minElapsedMS);
}

@@ -652,0 +663,0 @@

/*!
* @pixi/ticker - v5.1.0
* Compiled Fri, 19 Jul 2019 21:54:36 UTC
* @pixi/ticker - v5.1.1
* Compiled Fri, 02 Aug 2019 23:20:23 UTC
*

@@ -351,2 +351,11 @@ * @pixi/ticker is licensed under the MIT License.

/**
* The last time keyframe was executed.
* Maintains a relatively fixed interval with the previous value.
* @member {number}
* @default -1
* @private
*/
this._lastFrame = -1;
/**
* Internal tick method bound to ticker instance.

@@ -394,2 +403,3 @@ * This is because in early 2015, Function.bind

this.lastTime = performance.now();
this._lastFrame = this.lastTime;
this._requestId = requestAnimationFrame(this._tick);

@@ -642,14 +652,15 @@ }

// if not enough time has passed, exit the function.
// We give a padding (5% of minElapsedMS) to elapsedMS for this check, because the
// nature of request animation frame means that not all browsers will return precise values.
// However, because rAF works based on v-sync, it's won't change the effective FPS.
// If not enough time has passed, exit the function.
// Get ready for next frame by setting _lastFrame, but based on _minElapsedMS
// adjustment to ensure a relatively stable interval.
if (this._minElapsedMS)
{
var elapsedMSPadding = this._minElapsedMS * 0.05;
var delta = currentTime - this._lastFrame | 0;
if (elapsedMS + elapsedMSPadding < this._minElapsedMS)
if (delta < this._minElapsedMS)
{
return;
}
this._lastFrame = currentTime - (delta % this._minElapsedMS);
}

@@ -656,0 +667,0 @@

{
"name": "@pixi/ticker",
"version": "5.1.0",
"version": "5.1.1",
"main": "lib/ticker.js",

@@ -27,5 +27,5 @@ "module": "lib/ticker.es.js",

"dependencies": {
"@pixi/settings": "^5.1.0"
"@pixi/settings": "^5.1.1"
},
"gitHead": "05c5e0e0beba56e886c74f201bf7efe576612570"
"gitHead": "40e1e4a12518ee067c6871dcdd930602346197de"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc