Socket
Socket
Sign inDemoInstall

@pixi/sprite

Package Overview
Dependencies
Maintainers
1
Versions
122
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pixi/sprite - npm Package Compare versions

Comparing version 5.2.1 to 5.2.2

6

dist/sprite.js
/*!
* @pixi/sprite - v5.2.1
* Compiled Tue, 28 Jan 2020 23:33:11 UTC
* @pixi/sprite - v5.2.2
* Compiled Tue, 21 Apr 2020 03:53:51 UTC
*

@@ -169,4 +169,2 @@ * @pixi/sprite is licensed under the MIT License.

this.indices = indices;
this.size = 4;
this.start = 0;

@@ -173,0 +171,0 @@ /**

/*!
* @pixi/sprite - v5.2.1
* Compiled Tue, 28 Jan 2020 23:33:11 UTC
* @pixi/sprite - v5.2.2
* Compiled Tue, 21 Apr 2020 03:53:51 UTC
*

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

*/
this.PIXI=this.PIXI||{};var _pixi_sprite=function(t,e,i,r,s,h,n){"use strict";var o=new e.Point,u=new Uint16Array([0,1,2,0,2,3]),a=function(t){function h(i){t.call(this),this._anchor=new e.ObservablePoint(this._onAnchorUpdate,this,i?i.defaultAnchor.x:0,i?i.defaultAnchor.y:0),this._texture=null,this._width=0,this._height=0,this._tint=null,this._tintRGB=null,this.tint=16777215,this.blendMode=s.BLEND_MODES.NORMAL,this.shader=null,this._cachedTint=16777215,this.uvs=null,this.texture=i||r.Texture.EMPTY,this.vertexData=new Float32Array(8),this.vertexTrimmedData=null,this._transformID=-1,this._textureID=-1,this._transformTrimmedID=-1,this._textureTrimmedID=-1,this.indices=u,this.size=4,this.start=0,this.pluginName="batch",this.isSprite=!0,this._roundPixels=n.settings.ROUND_PIXELS}t&&(h.__proto__=t),h.prototype=Object.create(t&&t.prototype),h.prototype.constructor=h;var a={roundPixels:{configurable:!0},width:{configurable:!0},height:{configurable:!0},anchor:{configurable:!0},tint:{configurable:!0},texture:{configurable:!0}};return h.prototype._onTextureUpdate=function(){this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this._width&&(this.scale.x=i.sign(this.scale.x)*this._width/this._texture.orig.width),this._height&&(this.scale.y=i.sign(this.scale.y)*this._height/this._texture.orig.height)},h.prototype._onAnchorUpdate=function(){this._transformID=-1,this._transformTrimmedID=-1},h.prototype.calculateVertices=function(){var t=this._texture;if(this._transformID!==this.transform._worldID||this._textureID!==t._updateID){this._textureID!==t._updateID&&(this.uvs=this._texture._uvs.uvsFloat32),this._transformID=this.transform._worldID,this._textureID=t._updateID;var e=this.transform.worldTransform,i=e.a,r=e.b,s=e.c,h=e.d,o=e.tx,u=e.ty,a=this.vertexData,_=t.trim,c=t.orig,d=this._anchor,l=0,x=0,f=0,g=0;if(_?(l=(x=_.x-d._x*c.width)+_.width,f=(g=_.y-d._y*c.height)+_.height):(l=(x=-d._x*c.width)+c.width,f=(g=-d._y*c.height)+c.height),a[0]=i*x+s*g+o,a[1]=h*g+r*x+u,a[2]=i*l+s*g+o,a[3]=h*g+r*l+u,a[4]=i*l+s*f+o,a[5]=h*f+r*l+u,a[6]=i*x+s*f+o,a[7]=h*f+r*x+u,this._roundPixels)for(var p=n.settings.RESOLUTION,m=0;m<a.length;++m)a[m]=Math.round((a[m]*p|0)/p)}},h.prototype.calculateTrimmedVertices=function(){if(this.vertexTrimmedData){if(this._transformTrimmedID===this.transform._worldID&&this._textureTrimmedID===this._texture._updateID)return}else this.vertexTrimmedData=new Float32Array(8);this._transformTrimmedID=this.transform._worldID,this._textureTrimmedID=this._texture._updateID;var t=this._texture,e=this.vertexTrimmedData,i=t.orig,r=this._anchor,s=this.transform.worldTransform,h=s.a,n=s.b,o=s.c,u=s.d,a=s.tx,_=s.ty,c=-r._x*i.width,d=c+i.width,l=-r._y*i.height,x=l+i.height;e[0]=h*c+o*l+a,e[1]=u*l+n*c+_,e[2]=h*d+o*l+a,e[3]=u*l+n*d+_,e[4]=h*d+o*x+a,e[5]=u*x+n*d+_,e[6]=h*c+o*x+a,e[7]=u*x+n*c+_},h.prototype._render=function(t){this.calculateVertices(),t.batch.setObjectRenderer(t.plugins[this.pluginName]),t.plugins[this.pluginName].render(this)},h.prototype._calculateBounds=function(){var t=this._texture.trim,e=this._texture.orig;!t||t.width===e.width&&t.height===e.height?(this.calculateVertices(),this._bounds.addQuad(this.vertexData)):(this.calculateTrimmedVertices(),this._bounds.addQuad(this.vertexTrimmedData))},h.prototype.getLocalBounds=function(i){return 0===this.children.length?(this._bounds.minX=this._texture.orig.width*-this._anchor._x,this._bounds.minY=this._texture.orig.height*-this._anchor._y,this._bounds.maxX=this._texture.orig.width*(1-this._anchor._x),this._bounds.maxY=this._texture.orig.height*(1-this._anchor._y),i||(this._localBoundsRect||(this._localBoundsRect=new e.Rectangle),i=this._localBoundsRect),this._bounds.getRectangle(i)):t.prototype.getLocalBounds.call(this,i)},h.prototype.containsPoint=function(t){this.worldTransform.applyInverse(t,o);var e=this._texture.orig.width,i=this._texture.orig.height,r=-e*this.anchor.x,s=0;return o.x>=r&&o.x<r+e&&(s=-i*this.anchor.y,o.y>=s&&o.y<s+i)},h.prototype.destroy=function(e){if(t.prototype.destroy.call(this,e),this._texture.off("update",this._onTextureUpdate,this),this._anchor=null,"boolean"==typeof e?e:e&&e.texture){var i="boolean"==typeof e?e:e&&e.baseTexture;this._texture.destroy(!!i)}this._texture=null,this.shader=null},h.from=function(t,e){return new h(t instanceof r.Texture?t:r.Texture.from(t,e))},a.roundPixels.set=function(t){this._roundPixels!==t&&(this._transformID=-1),this._roundPixels=t},a.roundPixels.get=function(){return this._roundPixels},a.width.get=function(){return Math.abs(this.scale.x)*this._texture.orig.width},a.width.set=function(t){var e=i.sign(this.scale.x)||1;this.scale.x=e*t/this._texture.orig.width,this._width=t},a.height.get=function(){return Math.abs(this.scale.y)*this._texture.orig.height},a.height.set=function(t){var e=i.sign(this.scale.y)||1;this.scale.y=e*t/this._texture.orig.height,this._height=t},a.anchor.get=function(){return this._anchor},a.anchor.set=function(t){this._anchor.copyFrom(t)},a.tint.get=function(){return this._tint},a.tint.set=function(t){this._tint=t,this._tintRGB=(t>>16)+(65280&t)+((255&t)<<16)},a.texture.get=function(){return this._texture},a.texture.set=function(t){this._texture!==t&&(this._texture&&this._texture.off("update",this._onTextureUpdate,this),this._texture=t||r.Texture.EMPTY,this._cachedTint=16777215,this._textureID=-1,this._textureTrimmedID=-1,t&&(t.baseTexture.valid?this._onTextureUpdate():t.once("update",this._onTextureUpdate,this)))},Object.defineProperties(h.prototype,a),h}(h.Container);return t.Sprite=a,t}({},PIXI,PIXI.utils,PIXI,PIXI,PIXI,PIXI);Object.assign(this.PIXI,_pixi_sprite);
this.PIXI=this.PIXI||{};var _pixi_sprite=function(t,e,i,r,s,h,n){"use strict";var o=new e.Point,u=new Uint16Array([0,1,2,0,2,3]),a=function(t){function h(i){t.call(this),this._anchor=new e.ObservablePoint(this._onAnchorUpdate,this,i?i.defaultAnchor.x:0,i?i.defaultAnchor.y:0),this._texture=null,this._width=0,this._height=0,this._tint=null,this._tintRGB=null,this.tint=16777215,this.blendMode=s.BLEND_MODES.NORMAL,this.shader=null,this._cachedTint=16777215,this.uvs=null,this.texture=i||r.Texture.EMPTY,this.vertexData=new Float32Array(8),this.vertexTrimmedData=null,this._transformID=-1,this._textureID=-1,this._transformTrimmedID=-1,this._textureTrimmedID=-1,this.indices=u,this.pluginName="batch",this.isSprite=!0,this._roundPixels=n.settings.ROUND_PIXELS}t&&(h.__proto__=t),h.prototype=Object.create(t&&t.prototype),h.prototype.constructor=h;var a={roundPixels:{configurable:!0},width:{configurable:!0},height:{configurable:!0},anchor:{configurable:!0},tint:{configurable:!0},texture:{configurable:!0}};return h.prototype._onTextureUpdate=function(){this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this._width&&(this.scale.x=i.sign(this.scale.x)*this._width/this._texture.orig.width),this._height&&(this.scale.y=i.sign(this.scale.y)*this._height/this._texture.orig.height)},h.prototype._onAnchorUpdate=function(){this._transformID=-1,this._transformTrimmedID=-1},h.prototype.calculateVertices=function(){var t=this._texture;if(this._transformID!==this.transform._worldID||this._textureID!==t._updateID){this._textureID!==t._updateID&&(this.uvs=this._texture._uvs.uvsFloat32),this._transformID=this.transform._worldID,this._textureID=t._updateID;var e=this.transform.worldTransform,i=e.a,r=e.b,s=e.c,h=e.d,o=e.tx,u=e.ty,a=this.vertexData,_=t.trim,c=t.orig,d=this._anchor,l=0,x=0,f=0,g=0;if(_?(l=(x=_.x-d._x*c.width)+_.width,f=(g=_.y-d._y*c.height)+_.height):(l=(x=-d._x*c.width)+c.width,f=(g=-d._y*c.height)+c.height),a[0]=i*x+s*g+o,a[1]=h*g+r*x+u,a[2]=i*l+s*g+o,a[3]=h*g+r*l+u,a[4]=i*l+s*f+o,a[5]=h*f+r*l+u,a[6]=i*x+s*f+o,a[7]=h*f+r*x+u,this._roundPixels)for(var p=n.settings.RESOLUTION,m=0;m<a.length;++m)a[m]=Math.round((a[m]*p|0)/p)}},h.prototype.calculateTrimmedVertices=function(){if(this.vertexTrimmedData){if(this._transformTrimmedID===this.transform._worldID&&this._textureTrimmedID===this._texture._updateID)return}else this.vertexTrimmedData=new Float32Array(8);this._transformTrimmedID=this.transform._worldID,this._textureTrimmedID=this._texture._updateID;var t=this._texture,e=this.vertexTrimmedData,i=t.orig,r=this._anchor,s=this.transform.worldTransform,h=s.a,n=s.b,o=s.c,u=s.d,a=s.tx,_=s.ty,c=-r._x*i.width,d=c+i.width,l=-r._y*i.height,x=l+i.height;e[0]=h*c+o*l+a,e[1]=u*l+n*c+_,e[2]=h*d+o*l+a,e[3]=u*l+n*d+_,e[4]=h*d+o*x+a,e[5]=u*x+n*d+_,e[6]=h*c+o*x+a,e[7]=u*x+n*c+_},h.prototype._render=function(t){this.calculateVertices(),t.batch.setObjectRenderer(t.plugins[this.pluginName]),t.plugins[this.pluginName].render(this)},h.prototype._calculateBounds=function(){var t=this._texture.trim,e=this._texture.orig;!t||t.width===e.width&&t.height===e.height?(this.calculateVertices(),this._bounds.addQuad(this.vertexData)):(this.calculateTrimmedVertices(),this._bounds.addQuad(this.vertexTrimmedData))},h.prototype.getLocalBounds=function(i){return 0===this.children.length?(this._bounds.minX=this._texture.orig.width*-this._anchor._x,this._bounds.minY=this._texture.orig.height*-this._anchor._y,this._bounds.maxX=this._texture.orig.width*(1-this._anchor._x),this._bounds.maxY=this._texture.orig.height*(1-this._anchor._y),i||(this._localBoundsRect||(this._localBoundsRect=new e.Rectangle),i=this._localBoundsRect),this._bounds.getRectangle(i)):t.prototype.getLocalBounds.call(this,i)},h.prototype.containsPoint=function(t){this.worldTransform.applyInverse(t,o);var e=this._texture.orig.width,i=this._texture.orig.height,r=-e*this.anchor.x,s=0;return o.x>=r&&o.x<r+e&&(s=-i*this.anchor.y,o.y>=s&&o.y<s+i)},h.prototype.destroy=function(e){if(t.prototype.destroy.call(this,e),this._texture.off("update",this._onTextureUpdate,this),this._anchor=null,"boolean"==typeof e?e:e&&e.texture){var i="boolean"==typeof e?e:e&&e.baseTexture;this._texture.destroy(!!i)}this._texture=null,this.shader=null},h.from=function(t,e){return new h(t instanceof r.Texture?t:r.Texture.from(t,e))},a.roundPixels.set=function(t){this._roundPixels!==t&&(this._transformID=-1),this._roundPixels=t},a.roundPixels.get=function(){return this._roundPixels},a.width.get=function(){return Math.abs(this.scale.x)*this._texture.orig.width},a.width.set=function(t){var e=i.sign(this.scale.x)||1;this.scale.x=e*t/this._texture.orig.width,this._width=t},a.height.get=function(){return Math.abs(this.scale.y)*this._texture.orig.height},a.height.set=function(t){var e=i.sign(this.scale.y)||1;this.scale.y=e*t/this._texture.orig.height,this._height=t},a.anchor.get=function(){return this._anchor},a.anchor.set=function(t){this._anchor.copyFrom(t)},a.tint.get=function(){return this._tint},a.tint.set=function(t){this._tint=t,this._tintRGB=(t>>16)+(65280&t)+((255&t)<<16)},a.texture.get=function(){return this._texture},a.texture.set=function(t){this._texture!==t&&(this._texture&&this._texture.off("update",this._onTextureUpdate,this),this._texture=t||r.Texture.EMPTY,this._cachedTint=16777215,this._textureID=-1,this._textureTrimmedID=-1,t&&(t.baseTexture.valid?this._onTextureUpdate():t.once("update",this._onTextureUpdate,this)))},Object.defineProperties(h.prototype,a),h}(h.Container);return t.Sprite=a,t}({},PIXI,PIXI.utils,PIXI,PIXI,PIXI,PIXI);Object.assign(this.PIXI,_pixi_sprite);
//# sourceMappingURL=sprite.min.js.map
/*!
* @pixi/sprite - v5.2.1
* Compiled Tue, 28 Jan 2020 23:33:11 UTC
* @pixi/sprite - v5.2.2
* Compiled Tue, 21 Apr 2020 03:53:51 UTC
*

@@ -172,4 +172,2 @@ * @pixi/sprite is licensed under the MIT License.

this.indices = indices;
this.size = 4;
this.start = 0;

@@ -176,0 +174,0 @@ /**

/*!
* @pixi/sprite - v5.2.1
* Compiled Tue, 28 Jan 2020 23:33:11 UTC
* @pixi/sprite - v5.2.2
* Compiled Tue, 21 Apr 2020 03:53:51 UTC
*

@@ -176,4 +176,2 @@ * @pixi/sprite is licensed under the MIT License.

this.indices = indices;
this.size = 4;
this.start = 0;

@@ -180,0 +178,0 @@ /**

{
"name": "@pixi/sprite",
"version": "5.2.1",
"version": "5.2.2",
"main": "lib/sprite.js",

@@ -27,10 +27,10 @@ "module": "lib/sprite.es.js",

"dependencies": {
"@pixi/constants": "5.2.1",
"@pixi/core": "5.2.1",
"@pixi/display": "5.2.1",
"@pixi/math": "5.2.1",
"@pixi/settings": "5.2.1",
"@pixi/utils": "5.2.1"
"@pixi/constants": "5.2.2",
"@pixi/core": "5.2.2",
"@pixi/display": "5.2.2",
"@pixi/math": "5.2.2",
"@pixi/settings": "5.2.2",
"@pixi/utils": "5.2.2"
},
"gitHead": "b56b4fca1c169f0e6d2a0472251ba1f7399bb4a3"
"gitHead": "c163c466c20f2286b6e41ab90d68a03aad2051d4"
}

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