@pixi/sprite
Advanced tools
Comparing version 5.1.2 to 5.1.3
/*! | ||
* @pixi/sprite - v5.1.2 | ||
* Compiled Sat, 24 Aug 2019 01:06:18 UTC | ||
* @pixi/sprite - v5.1.3 | ||
* Compiled Mon, 09 Sep 2019 04:51:53 UTC | ||
* | ||
@@ -132,2 +132,9 @@ * @pixi/sprite is licensed under the MIT License. | ||
/** | ||
* this is used to store the uvs data of the sprite, assigned at the same time | ||
* as the vertexData in calculateVertices() | ||
* | ||
* @private | ||
* @member {Float32Array} | ||
*/ | ||
this.uvs = null; | ||
@@ -207,3 +214,2 @@ | ||
this.uvs = this._texture._uvs.uvsFloat32; | ||
// so if _width is 0 then width was not set.. | ||
@@ -244,2 +250,8 @@ if (this._width) | ||
// update texture UV here, because base texture can be changed without calling `_onTextureUpdate` | ||
if (this._textureID !== texture._updateID) | ||
{ | ||
this.uvs = this._texture._uvs.uvsFloat32; | ||
} | ||
this._transformID = this.transform._worldID; | ||
@@ -246,0 +258,0 @@ this._textureID = texture._updateID; |
/*! | ||
* @pixi/sprite - v5.1.2 | ||
* Compiled Sat, 24 Aug 2019 01:06:18 UTC | ||
* @pixi/sprite - v5.1.3 | ||
* Compiled Mon, 09 Sep 2019 04:51:53 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,a=new Uint16Array([0,1,2,0,2,3]),u=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=a,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 u={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.uvs=this._texture._uvs.uvsFloat32,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._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,n=e.tx,o=e.ty,a=this.vertexData,u=t.trim,_=t.orig,c=this._anchor,d=0,l=0,x=0,f=0;if(u?(d=(l=u.x-c._x*_.width)+u.width,x=(f=u.y-c._y*_.height)+u.height):(d=(l=-c._x*_.width)+_.width,x=(f=-c._y*_.height)+_.height),a[0]=i*l+s*f+n,a[1]=h*f+r*l+o,a[2]=i*d+s*f+n,a[3]=h*f+r*d+o,a[4]=i*d+s*x+n,a[5]=h*x+r*d+o,a[6]=i*l+s*x+n,a[7]=h*x+r*l+o,this._roundPixels)for(var g=0;g<8;g++)a[g]=Math.round(a[g])}},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,a=s.d,u=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+u,e[1]=a*l+n*c+_,e[2]=h*d+o*l+u,e[3]=a*l+n*d+_,e[4]=h*d+o*x+u,e[5]=a*x+n*d+_,e[6]=h*c+o*x+u,e[7]=a*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))},u.roundPixels.set=function(t){this._roundPixels!==t&&(this._transformID=-1),this._roundPixels=t},u.roundPixels.get=function(){return this._roundPixels},u.width.get=function(){return Math.abs(this.scale.x)*this._texture.orig.width},u.width.set=function(t){var e=i.sign(this.scale.x)||1;this.scale.x=e*t/this._texture.orig.width,this._width=t},u.height.get=function(){return Math.abs(this.scale.y)*this._texture.orig.height},u.height.set=function(t){var e=i.sign(this.scale.y)||1;this.scale.y=e*t/this._texture.orig.height,this._height=t},u.anchor.get=function(){return this._anchor},u.anchor.set=function(t){this._anchor.copyFrom(t)},u.tint.get=function(){return this._tint},u.tint.set=function(t){this._tint=t,this._tintRGB=(t>>16)+(65280&t)+((255&t)<<16)},u.texture.get=function(){return this._texture},u.texture.set=function(t){this._texture!==t&&(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,u),h}(h.Container);return t.Sprite=u,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,a=new Uint16Array([0,1,2,0,2,3]),u=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=a,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 u={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,n=e.tx,o=e.ty,a=this.vertexData,u=t.trim,_=t.orig,c=this._anchor,d=0,l=0,x=0,f=0;if(u?(d=(l=u.x-c._x*_.width)+u.width,x=(f=u.y-c._y*_.height)+u.height):(d=(l=-c._x*_.width)+_.width,x=(f=-c._y*_.height)+_.height),a[0]=i*l+s*f+n,a[1]=h*f+r*l+o,a[2]=i*d+s*f+n,a[3]=h*f+r*d+o,a[4]=i*d+s*x+n,a[5]=h*x+r*d+o,a[6]=i*l+s*x+n,a[7]=h*x+r*l+o,this._roundPixels)for(var g=0;g<8;g++)a[g]=Math.round(a[g])}},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,a=s.d,u=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+u,e[1]=a*l+n*c+_,e[2]=h*d+o*l+u,e[3]=a*l+n*d+_,e[4]=h*d+o*x+u,e[5]=a*x+n*d+_,e[6]=h*c+o*x+u,e[7]=a*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))},u.roundPixels.set=function(t){this._roundPixels!==t&&(this._transformID=-1),this._roundPixels=t},u.roundPixels.get=function(){return this._roundPixels},u.width.get=function(){return Math.abs(this.scale.x)*this._texture.orig.width},u.width.set=function(t){var e=i.sign(this.scale.x)||1;this.scale.x=e*t/this._texture.orig.width,this._width=t},u.height.get=function(){return Math.abs(this.scale.y)*this._texture.orig.height},u.height.set=function(t){var e=i.sign(this.scale.y)||1;this.scale.y=e*t/this._texture.orig.height,this._height=t},u.anchor.get=function(){return this._anchor},u.anchor.set=function(t){this._anchor.copyFrom(t)},u.tint.get=function(){return this._tint},u.tint.set=function(t){this._tint=t,this._tintRGB=(t>>16)+(65280&t)+((255&t)<<16)},u.texture.get=function(){return this._texture},u.texture.set=function(t){this._texture!==t&&(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,u),h}(h.Container);return t.Sprite=u,t}({},PIXI,PIXI.utils,PIXI,PIXI,PIXI,PIXI);Object.assign(this.PIXI,_pixi_sprite); | ||
//# sourceMappingURL=sprite.min.js.map |
/*! | ||
* @pixi/sprite - v5.1.2 | ||
* Compiled Sat, 24 Aug 2019 01:06:18 UTC | ||
* @pixi/sprite - v5.1.3 | ||
* Compiled Mon, 09 Sep 2019 04:51:53 UTC | ||
* | ||
@@ -135,2 +135,9 @@ * @pixi/sprite is licensed under the MIT License. | ||
/** | ||
* this is used to store the uvs data of the sprite, assigned at the same time | ||
* as the vertexData in calculateVertices() | ||
* | ||
* @private | ||
* @member {Float32Array} | ||
*/ | ||
this.uvs = null; | ||
@@ -210,3 +217,2 @@ | ||
this.uvs = this._texture._uvs.uvsFloat32; | ||
// so if _width is 0 then width was not set.. | ||
@@ -247,2 +253,8 @@ if (this._width) | ||
// update texture UV here, because base texture can be changed without calling `_onTextureUpdate` | ||
if (this._textureID !== texture._updateID) | ||
{ | ||
this.uvs = this._texture._uvs.uvsFloat32; | ||
} | ||
this._transformID = this.transform._worldID; | ||
@@ -249,0 +261,0 @@ this._textureID = texture._updateID; |
/*! | ||
* @pixi/sprite - v5.1.2 | ||
* Compiled Sat, 24 Aug 2019 01:06:18 UTC | ||
* @pixi/sprite - v5.1.3 | ||
* Compiled Mon, 09 Sep 2019 04:51:53 UTC | ||
* | ||
@@ -139,2 +139,9 @@ * @pixi/sprite is licensed under the MIT License. | ||
/** | ||
* this is used to store the uvs data of the sprite, assigned at the same time | ||
* as the vertexData in calculateVertices() | ||
* | ||
* @private | ||
* @member {Float32Array} | ||
*/ | ||
this.uvs = null; | ||
@@ -214,3 +221,2 @@ | ||
this.uvs = this._texture._uvs.uvsFloat32; | ||
// so if _width is 0 then width was not set.. | ||
@@ -251,2 +257,8 @@ if (this._width) | ||
// update texture UV here, because base texture can be changed without calling `_onTextureUpdate` | ||
if (this._textureID !== texture._updateID) | ||
{ | ||
this.uvs = this._texture._uvs.uvsFloat32; | ||
} | ||
this._transformID = this.transform._worldID; | ||
@@ -253,0 +265,0 @@ this._textureID = texture._updateID; |
{ | ||
"name": "@pixi/sprite", | ||
"version": "5.1.2", | ||
"version": "5.1.3", | ||
"main": "lib/sprite.js", | ||
@@ -28,9 +28,9 @@ "module": "lib/sprite.es.js", | ||
"@pixi/constants": "^5.1.0", | ||
"@pixi/core": "^5.1.2", | ||
"@pixi/display": "^5.1.2", | ||
"@pixi/core": "^5.1.3", | ||
"@pixi/display": "^5.1.3", | ||
"@pixi/math": "^5.1.0", | ||
"@pixi/settings": "^5.1.1", | ||
"@pixi/utils": "^5.1.2" | ||
"@pixi/settings": "^5.1.3", | ||
"@pixi/utils": "^5.1.3" | ||
}, | ||
"gitHead": "9d8381bfb348e8ba570e1cab26bf2f699446f0ca" | ||
"gitHead": "ee5ed4ddb3e1967f7e8a88c952479d51368fd3e2" | ||
} |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
189431
1781
Updated@pixi/core@^5.1.3
Updated@pixi/display@^5.1.3
Updated@pixi/settings@^5.1.3
Updated@pixi/utils@^5.1.3