New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@pixi/mesh

Package Overview
Dependencies
Maintainers
3
Versions
122
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pixi/mesh - npm Package Compare versions

Comparing version 5.1.5 to 5.2.0

6

dist/mesh.js
/*!
* @pixi/mesh - v5.1.5
* Compiled Tue, 24 Sep 2019 04:07:05 UTC
* @pixi/mesh - v5.2.0
* Compiled Wed, 06 Nov 2019 02:32:43 UTC
*

@@ -706,3 +706,3 @@ * @pixi/mesh is licensed under the MIT License.

utils.premultiplyTintToRgba(this._tint, this._alpha, this.uniforms.uColor, baseTexture.premultiplyAlpha);
utils.premultiplyTintToRgba(this._tint, this._alpha, this.uniforms.uColor, baseTexture.alphaMode);
}

@@ -709,0 +709,0 @@ if (this.uvMatrix.update())

/*!
* @pixi/mesh - v5.1.5
* Compiled Tue, 24 Sep 2019 04:07:05 UTC
* @pixi/mesh - v5.2.0
* Compiled Wed, 06 Nov 2019 02:32:43 UTC
*

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

*/
this.PIXI=this.PIXI||{};var _pixi_mesh=function(t,e,r,i,a,s,n){"use strict";var o=function(t,e){this.uvBuffer=t,this.uvMatrix=e,this.data=null,this._bufferUpdateId=-1,this._textureUpdateId=-1,this._updateID=0};o.prototype.update=function(t){if(t||this._bufferUpdateId!==this.uvBuffer._updateID||this._textureUpdateId!==this.uvMatrix._updateID){this._bufferUpdateId=this.uvBuffer._updateID,this._textureUpdateId=this.uvMatrix._updateID;var e=this.uvBuffer.data;this.data&&this.data.length===e.length||(this.data=new Float32Array(e.length)),this.uvMatrix.multiplyUvs(e,this.data),this._updateID++}};var u=new r.Point,h=new r.Polygon,l=function(t){function r(r,a,n,o){void 0===o&&(o=i.DRAW_MODES.TRIANGLES),t.call(this),this.geometry=r,r.refCount++,this.shader=a,this.state=n||e.State.for2d(),this.drawMode=o,this.start=0,this.size=0,this.uvs=null,this.indices=null,this.vertexData=new Float32Array(1),this.vertexDirty=0,this._transformID=-1,this.tint=16777215,this.blendMode=i.BLEND_MODES.NORMAL,this._roundPixels=s.settings.ROUND_PIXELS,this.batchUvs=null}t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r;var a={uvBuffer:{configurable:!0},verticesBuffer:{configurable:!0},material:{configurable:!0},blendMode:{configurable:!0},roundPixels:{configurable:!0},tint:{configurable:!0},texture:{configurable:!0}};return a.uvBuffer.get=function(){return this.geometry.buffers[1]},a.verticesBuffer.get=function(){return this.geometry.buffers[0]},a.material.set=function(t){this.shader=t},a.material.get=function(){return this.shader},a.blendMode.set=function(t){this.state.blendMode=t},a.blendMode.get=function(){return this.state.blendMode},a.roundPixels.set=function(t){this._roundPixels!==t&&(this._transformID=-1),this._roundPixels=t},a.roundPixels.get=function(){return this._roundPixels},a.tint.get=function(){return this.shader.tint},a.tint.set=function(t){this.shader.tint=t},a.texture.get=function(){return this.shader.texture},a.texture.set=function(t){this.shader.texture=t},r.prototype._render=function(t){var e=this.geometry.buffers[0].data;this.shader.batchable&&this.drawMode===i.DRAW_MODES.TRIANGLES&&e.length<2*r.BATCHABLE_SIZE?this._renderToBatch(t):this._renderDefault(t)},r.prototype._renderDefault=function(t){var e=this.shader;e.alpha=this.worldAlpha,e.update&&e.update(),t.batch.flush(),e.program.uniformData.translationMatrix&&(e.uniforms.translationMatrix=this.transform.worldTransform.toArray(!0)),t.shader.bind(e),t.state.set(this.state),t.geometry.bind(this.geometry,e),t.geometry.draw(this.drawMode,this.size,this.start,this.geometry.instanceCount)},r.prototype._renderToBatch=function(t){var e=this.geometry;this.shader.uvMatrix&&(this.shader.uvMatrix.update(),this.calculateUvs()),this.calculateVertices(),this.indices=e.indexBuffer.data,this._tintRGB=this.shader._tintRGB,this._texture=this.shader.texture;var r=this.material.pluginName;t.batch.setObjectRenderer(t.plugins[r]),t.plugins[r].render(this)},r.prototype.calculateVertices=function(){var t=this.geometry,e=t.buffers[0].data;if(t.vertexDirtyId!==this.vertexDirty||this._transformID!==this.transform._worldID){this._transformID=this.transform._worldID,this.vertexData.length!==e.length&&(this.vertexData=new Float32Array(e.length));for(var r=this.transform.worldTransform,i=r.a,a=r.b,s=r.c,n=r.d,o=r.tx,u=r.ty,h=this.vertexData,l=0;l<h.length/2;l++){var d=e[2*l],f=e[2*l+1];h[2*l]=i*d+s*f+o,h[2*l+1]=a*d+n*f+u}if(this._roundPixels)for(var c=0;c<h.length;c++)h[c]=Math.round(h[c]);this.vertexDirty=t.vertexDirtyId}},r.prototype.calculateUvs=function(){var t=this.geometry.buffers[1];this.shader.uvMatrix.isSimple?this.uvs=t.data:(this.batchUvs||(this.batchUvs=new o(t,this.shader.uvMatrix)),this.batchUvs.update(),this.uvs=this.batchUvs.data)},r.prototype._calculateBounds=function(){this.calculateVertices(),this._bounds.addVertexData(this.vertexData,0,this.vertexData.length)},r.prototype.containsPoint=function(t){if(!this.getBounds().contains(t.x,t.y))return!1;this.worldTransform.applyInverse(t,u);for(var e=this.geometry.getBuffer("aVertexPosition").data,r=h.points,i=this.geometry.getIndex().data,a=i.length,s=4===this.drawMode?3:1,n=0;n+2<a;n+=s){var o=2*i[n],l=2*i[n+1],d=2*i[n+2];if(r[0]=e[o],r[1]=e[o+1],r[2]=e[l],r[3]=e[l+1],r[4]=e[d],r[5]=e[d+1],h.contains(u.x,u.y))return!0}return!1},r.prototype.destroy=function(e){t.prototype.destroy.call(this,e),this.geometry.refCount--,0===this.geometry.refCount&&this.geometry.dispose(),this.geometry=null,this.shader=null,this.state=null,this.uvs=null,this.indices=null,this.vertexData=null},Object.defineProperties(r.prototype,a),r}(a.Container);l.BATCHABLE_SIZE=100;var d="attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform mat3 uTextureMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = (uTextureMatrix * vec3(aTextureCoord, 1.0)).xy;\n}\n",f="varying vec2 vTextureCoord;\nuniform vec4 uColor;\n\nuniform sampler2D uSampler;\n\nvoid main(void)\n{\n gl_FragColor = texture2D(uSampler, vTextureCoord) * uColor;\n}\n",c=function(t){function i(i,a){var s={uSampler:i,alpha:1,uTextureMatrix:r.Matrix.IDENTITY,uColor:new Float32Array([1,1,1,1])};(a=Object.assign({tint:16777215,alpha:1,pluginName:"batch"},a)).uniforms&&Object.assign(s,a.uniforms),t.call(this,a.program||e.Program.from(d,f),s),this._colorDirty=!1,this.uvMatrix=new e.TextureMatrix(i),this.batchable=void 0===a.program,this.pluginName=a.pluginName,this.tint=a.tint,this.alpha=a.alpha}t&&(i.__proto__=t),i.prototype=Object.create(t&&t.prototype),i.prototype.constructor=i;var a={texture:{configurable:!0},alpha:{configurable:!0},tint:{configurable:!0}};return a.texture.get=function(){return this.uniforms.uSampler},a.texture.set=function(t){this.uniforms.uSampler!==t&&(this.uniforms.uSampler=t,this.uvMatrix.texture=t)},a.alpha.set=function(t){t!==this._alpha&&(this._alpha=t,this._colorDirty=!0)},a.alpha.get=function(){return this._alpha},a.tint.set=function(t){t!==this._tint&&(this._tint=t,this._tintRGB=(t>>16)+(65280&t)+((255&t)<<16),this._colorDirty=!0)},a.tint.get=function(){return this._tint},i.prototype.update=function(){if(this._colorDirty){this._colorDirty=!1;var t=this.texture.baseTexture;n.premultiplyTintToRgba(this._tint,this._alpha,this.uniforms.uColor,t.premultiplyAlpha)}this.uvMatrix.update()&&(this.uniforms.uTextureMatrix=this.uvMatrix.mapCoord)},Object.defineProperties(i.prototype,a),i}(e.Shader),p=function(t){function r(r,a,s){t.call(this);var n=new e.Buffer(r),o=new e.Buffer(a,!0),u=new e.Buffer(s,!0,!0);this.addAttribute("aVertexPosition",n,2,!1,i.TYPES.FLOAT).addAttribute("aTextureCoord",o,2,!1,i.TYPES.FLOAT).addIndex(u),this._updateId=-1}t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r;var a={vertexDirtyId:{configurable:!0}};return a.vertexDirtyId.get=function(){return this.buffers[0]._updateID},Object.defineProperties(r.prototype,a),r}(e.Geometry);return t.Mesh=l,t.MeshBatchUvs=o,t.MeshGeometry=p,t.MeshMaterial=c,t}({},PIXI,PIXI,PIXI,PIXI,PIXI,PIXI.utils);Object.assign(this.PIXI,_pixi_mesh);
this.PIXI=this.PIXI||{};var _pixi_mesh=function(t,e,r,i,a,s,n){"use strict";var o=function(t,e){this.uvBuffer=t,this.uvMatrix=e,this.data=null,this._bufferUpdateId=-1,this._textureUpdateId=-1,this._updateID=0};o.prototype.update=function(t){if(t||this._bufferUpdateId!==this.uvBuffer._updateID||this._textureUpdateId!==this.uvMatrix._updateID){this._bufferUpdateId=this.uvBuffer._updateID,this._textureUpdateId=this.uvMatrix._updateID;var e=this.uvBuffer.data;this.data&&this.data.length===e.length||(this.data=new Float32Array(e.length)),this.uvMatrix.multiplyUvs(e,this.data),this._updateID++}};var u=new r.Point,h=new r.Polygon,d=function(t){function r(r,a,n,o){void 0===o&&(o=i.DRAW_MODES.TRIANGLES),t.call(this),this.geometry=r,r.refCount++,this.shader=a,this.state=n||e.State.for2d(),this.drawMode=o,this.start=0,this.size=0,this.uvs=null,this.indices=null,this.vertexData=new Float32Array(1),this.vertexDirty=0,this._transformID=-1,this.tint=16777215,this.blendMode=i.BLEND_MODES.NORMAL,this._roundPixels=s.settings.ROUND_PIXELS,this.batchUvs=null}t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r;var a={uvBuffer:{configurable:!0},verticesBuffer:{configurable:!0},material:{configurable:!0},blendMode:{configurable:!0},roundPixels:{configurable:!0},tint:{configurable:!0},texture:{configurable:!0}};return a.uvBuffer.get=function(){return this.geometry.buffers[1]},a.verticesBuffer.get=function(){return this.geometry.buffers[0]},a.material.set=function(t){this.shader=t},a.material.get=function(){return this.shader},a.blendMode.set=function(t){this.state.blendMode=t},a.blendMode.get=function(){return this.state.blendMode},a.roundPixels.set=function(t){this._roundPixels!==t&&(this._transformID=-1),this._roundPixels=t},a.roundPixels.get=function(){return this._roundPixels},a.tint.get=function(){return this.shader.tint},a.tint.set=function(t){this.shader.tint=t},a.texture.get=function(){return this.shader.texture},a.texture.set=function(t){this.shader.texture=t},r.prototype._render=function(t){var e=this.geometry.buffers[0].data;this.shader.batchable&&this.drawMode===i.DRAW_MODES.TRIANGLES&&e.length<2*r.BATCHABLE_SIZE?this._renderToBatch(t):this._renderDefault(t)},r.prototype._renderDefault=function(t){var e=this.shader;e.alpha=this.worldAlpha,e.update&&e.update(),t.batch.flush(),e.program.uniformData.translationMatrix&&(e.uniforms.translationMatrix=this.transform.worldTransform.toArray(!0)),t.shader.bind(e),t.state.set(this.state),t.geometry.bind(this.geometry,e),t.geometry.draw(this.drawMode,this.size,this.start,this.geometry.instanceCount)},r.prototype._renderToBatch=function(t){var e=this.geometry;this.shader.uvMatrix&&(this.shader.uvMatrix.update(),this.calculateUvs()),this.calculateVertices(),this.indices=e.indexBuffer.data,this._tintRGB=this.shader._tintRGB,this._texture=this.shader.texture;var r=this.material.pluginName;t.batch.setObjectRenderer(t.plugins[r]),t.plugins[r].render(this)},r.prototype.calculateVertices=function(){var t=this.geometry,e=t.buffers[0].data;if(t.vertexDirtyId!==this.vertexDirty||this._transformID!==this.transform._worldID){this._transformID=this.transform._worldID,this.vertexData.length!==e.length&&(this.vertexData=new Float32Array(e.length));for(var r=this.transform.worldTransform,i=r.a,a=r.b,s=r.c,n=r.d,o=r.tx,u=r.ty,h=this.vertexData,d=0;d<h.length/2;d++){var l=e[2*d],f=e[2*d+1];h[2*d]=i*l+s*f+o,h[2*d+1]=a*l+n*f+u}if(this._roundPixels)for(var c=0;c<h.length;c++)h[c]=Math.round(h[c]);this.vertexDirty=t.vertexDirtyId}},r.prototype.calculateUvs=function(){var t=this.geometry.buffers[1];this.shader.uvMatrix.isSimple?this.uvs=t.data:(this.batchUvs||(this.batchUvs=new o(t,this.shader.uvMatrix)),this.batchUvs.update(),this.uvs=this.batchUvs.data)},r.prototype._calculateBounds=function(){this.calculateVertices(),this._bounds.addVertexData(this.vertexData,0,this.vertexData.length)},r.prototype.containsPoint=function(t){if(!this.getBounds().contains(t.x,t.y))return!1;this.worldTransform.applyInverse(t,u);for(var e=this.geometry.getBuffer("aVertexPosition").data,r=h.points,i=this.geometry.getIndex().data,a=i.length,s=4===this.drawMode?3:1,n=0;n+2<a;n+=s){var o=2*i[n],d=2*i[n+1],l=2*i[n+2];if(r[0]=e[o],r[1]=e[o+1],r[2]=e[d],r[3]=e[d+1],r[4]=e[l],r[5]=e[l+1],h.contains(u.x,u.y))return!0}return!1},r.prototype.destroy=function(e){t.prototype.destroy.call(this,e),this.geometry.refCount--,0===this.geometry.refCount&&this.geometry.dispose(),this.geometry=null,this.shader=null,this.state=null,this.uvs=null,this.indices=null,this.vertexData=null},Object.defineProperties(r.prototype,a),r}(a.Container);d.BATCHABLE_SIZE=100;var l="attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform mat3 uTextureMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = (uTextureMatrix * vec3(aTextureCoord, 1.0)).xy;\n}\n",f="varying vec2 vTextureCoord;\nuniform vec4 uColor;\n\nuniform sampler2D uSampler;\n\nvoid main(void)\n{\n gl_FragColor = texture2D(uSampler, vTextureCoord) * uColor;\n}\n",c=function(t){function i(i,a){var s={uSampler:i,alpha:1,uTextureMatrix:r.Matrix.IDENTITY,uColor:new Float32Array([1,1,1,1])};(a=Object.assign({tint:16777215,alpha:1,pluginName:"batch"},a)).uniforms&&Object.assign(s,a.uniforms),t.call(this,a.program||e.Program.from(l,f),s),this._colorDirty=!1,this.uvMatrix=new e.TextureMatrix(i),this.batchable=void 0===a.program,this.pluginName=a.pluginName,this.tint=a.tint,this.alpha=a.alpha}t&&(i.__proto__=t),i.prototype=Object.create(t&&t.prototype),i.prototype.constructor=i;var a={texture:{configurable:!0},alpha:{configurable:!0},tint:{configurable:!0}};return a.texture.get=function(){return this.uniforms.uSampler},a.texture.set=function(t){this.uniforms.uSampler!==t&&(this.uniforms.uSampler=t,this.uvMatrix.texture=t)},a.alpha.set=function(t){t!==this._alpha&&(this._alpha=t,this._colorDirty=!0)},a.alpha.get=function(){return this._alpha},a.tint.set=function(t){t!==this._tint&&(this._tint=t,this._tintRGB=(t>>16)+(65280&t)+((255&t)<<16),this._colorDirty=!0)},a.tint.get=function(){return this._tint},i.prototype.update=function(){if(this._colorDirty){this._colorDirty=!1;var t=this.texture.baseTexture;n.premultiplyTintToRgba(this._tint,this._alpha,this.uniforms.uColor,t.alphaMode)}this.uvMatrix.update()&&(this.uniforms.uTextureMatrix=this.uvMatrix.mapCoord)},Object.defineProperties(i.prototype,a),i}(e.Shader),p=function(t){function r(r,a,s){t.call(this);var n=new e.Buffer(r),o=new e.Buffer(a,!0),u=new e.Buffer(s,!0,!0);this.addAttribute("aVertexPosition",n,2,!1,i.TYPES.FLOAT).addAttribute("aTextureCoord",o,2,!1,i.TYPES.FLOAT).addIndex(u),this._updateId=-1}t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r;var a={vertexDirtyId:{configurable:!0}};return a.vertexDirtyId.get=function(){return this.buffers[0]._updateID},Object.defineProperties(r.prototype,a),r}(e.Geometry);return t.Mesh=d,t.MeshBatchUvs=o,t.MeshGeometry=p,t.MeshMaterial=c,t}({},PIXI,PIXI,PIXI,PIXI,PIXI,PIXI.utils);Object.assign(this.PIXI,_pixi_mesh);
//# sourceMappingURL=mesh.min.js.map
/*!
* @pixi/mesh - v5.1.5
* Compiled Tue, 24 Sep 2019 04:07:05 UTC
* @pixi/mesh - v5.2.0
* Compiled Wed, 06 Nov 2019 02:32:43 UTC
*

@@ -709,3 +709,3 @@ * @pixi/mesh is licensed under the MIT License.

premultiplyTintToRgba(this._tint, this._alpha, this.uniforms.uColor, baseTexture.premultiplyAlpha);
premultiplyTintToRgba(this._tint, this._alpha, this.uniforms.uColor, baseTexture.alphaMode);
}

@@ -712,0 +712,0 @@ if (this.uvMatrix.update())

/*!
* @pixi/mesh - v5.1.5
* Compiled Tue, 24 Sep 2019 04:07:05 UTC
* @pixi/mesh - v5.2.0
* Compiled Wed, 06 Nov 2019 02:32:43 UTC
*

@@ -713,3 +713,3 @@ * @pixi/mesh is licensed under the MIT License.

utils.premultiplyTintToRgba(this._tint, this._alpha, this.uniforms.uColor, baseTexture.premultiplyAlpha);
utils.premultiplyTintToRgba(this._tint, this._alpha, this.uniforms.uColor, baseTexture.alphaMode);
}

@@ -716,0 +716,0 @@ if (this.uvMatrix.update())

{
"name": "@pixi/mesh",
"version": "5.1.5",
"version": "5.2.0",
"main": "lib/mesh.js",

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

"dependencies": {
"@pixi/constants": "^5.1.0",
"@pixi/core": "^5.1.5",
"@pixi/display": "^5.1.3",
"@pixi/math": "^5.1.0",
"@pixi/settings": "^5.1.3",
"@pixi/utils": "^5.1.3"
"@pixi/constants": "^5.2.0",
"@pixi/core": "^5.2.0",
"@pixi/display": "^5.2.0",
"@pixi/math": "^5.2.0",
"@pixi/settings": "^5.2.0",
"@pixi/utils": "^5.2.0"
},
"gitHead": "8cf3db88d06355cbabea64150cdb0774191e502c"
"gitHead": "aaf96b460582b83a1fa73037ef2dd69dd9e84415"
}

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