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

@pixi/canvas-graphics

Package Overview
Dependencies
Maintainers
3
Versions
121
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pixi/canvas-graphics - npm Package Compare versions

Comparing version 5.1.0 to 5.1.1

8

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

@@ -59,3 +59,3 @@ * @pixi/canvas-graphics is licensed under the MIT License.

// update tint if graphics was dirty
if (graphics.canvasTintDirty !== graphics.dirty
if (graphics.canvasTintDirty !== graphics.geometry.dirty
|| graphics._prevTint !== graphics.tint)

@@ -301,3 +301,3 @@ {

graphics._prevTint = graphics.tint;
graphics.canvasTintDirty = graphics.dirty;
graphics.canvasTintDirty = graphics.geometry.dirty;

@@ -304,0 +304,0 @@ var tintR = ((graphics.tint >> 16) & 0xFF) / 255;

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

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

*/
this.PIXI=this.PIXI||{};var _pixi_canvas_graphics=function(e,t,r,i,a){"use strict";var l,o=function(e){this.renderer=e};o.prototype.render=function(e){var r=this.renderer,i=r.context,a=e.worldAlpha,l=e.transform.worldTransform,o=r.resolution;i.setTransform(l.a*o,l.b*o,l.c*o,l.d*o,l.tx*o,l.ty*o),e.canvasTintDirty===e.dirty&&e._prevTint===e.tint||this.updateGraphicsTint(e),r.setBlendMode(e.blendMode);for(var s=e.geometry.graphicsData,n=0;n<s.length;n++){var h=s[n],p=h.shape,v=h.fillStyle,c=h.lineStyle,g=h._fillTint,u=h._lineTint;if(i.lineWidth=c.width,h.type===t.SHAPES.POLY){i.beginPath();var d=p.points,f=h.holes,b=void 0,T=void 0,y=void 0,S=void 0;i.moveTo(d[0],d[1]);for(var P=2;P<d.length;P+=2)i.lineTo(d[P],d[P+1]);if(p.closeStroke&&i.closePath(),f.length>0){b=0,y=d[0],S=d[1];for(var x=2;x+2<d.length;x+=2)b+=(d[x]-y)*(d[x+3]-S)-(d[x+2]-y)*(d[x+1]-S);for(var I=0;I<f.length;I++)if(d=f[I].shape.points){T=0,y=d[0],S=d[1];for(var m=2;m+2<d.length;m+=2)T+=(d[m]-y)*(d[m+3]-S)-(d[m+2]-y)*(d[m+1]-S);if(T*b<0){i.moveTo(d[0],d[1]);for(var A=2;A<d.length;A+=2)i.lineTo(d[A],d[A+1])}else{i.moveTo(d[d.length-2],d[d.length-1]);for(var C=d.length-4;C>=0;C-=2)i.lineTo(d[C],d[C+1])}f[I].shape.closeStroke&&i.closePath()}}v.visible&&(i.globalAlpha=v.alpha*a,i.fillStyle="#"+("00000"+(0|g).toString(16)).substr(-6),i.fill()),c.visible&&(i.globalAlpha=c.alpha*a,i.strokeStyle="#"+("00000"+(0|u).toString(16)).substr(-6),i.stroke())}else if(h.type===t.SHAPES.RECT)v.visible&&(i.globalAlpha=v.alpha*a,i.fillStyle="#"+("00000"+(0|g).toString(16)).substr(-6),i.fillRect(p.x,p.y,p.width,p.height)),c.visible&&(i.globalAlpha=c.alpha*a,i.strokeStyle="#"+("00000"+(0|u).toString(16)).substr(-6),i.strokeRect(p.x,p.y,p.width,p.height));else if(h.type===t.SHAPES.CIRC)i.beginPath(),i.arc(p.x,p.y,p.radius,0,2*Math.PI),i.closePath(),v.visible&&(i.globalAlpha=v.alpha*a,i.fillStyle="#"+("00000"+(0|g).toString(16)).substr(-6),i.fill()),c.visible&&(i.globalAlpha=c.alpha*a,i.strokeStyle="#"+("00000"+(0|u).toString(16)).substr(-6),i.stroke());else if(h.type===t.SHAPES.ELIP){var _=2*p.width,k=2*p.height,w=p.x-_/2,R=p.y-k/2;i.beginPath();var E=_/2*.5522848,G=k/2*.5522848,M=w+_,X=R+k,D=w+_/2,H=R+k/2;i.moveTo(w,H),i.bezierCurveTo(w,H-G,D-E,R,D,R),i.bezierCurveTo(D+E,R,M,H-G,M,H),i.bezierCurveTo(M,H+G,D+E,X,D,X),i.bezierCurveTo(D-E,X,w,H+G,w,H),i.closePath(),v.visible&&(i.globalAlpha=v.alpha*a,i.fillStyle="#"+("00000"+(0|g).toString(16)).substr(-6),i.fill()),c.visible&&(i.globalAlpha=c.alpha*a,i.strokeStyle="#"+("00000"+(0|u).toString(16)).substr(-6),i.stroke())}else if(h.type===t.SHAPES.RREC){var q=p.x,z=p.y,L=p.width,B=p.height,O=p.radius,j=Math.min(L,B)/2|0;O=O>j?j:O,i.beginPath(),i.moveTo(q,z+O),i.lineTo(q,z+B-O),i.quadraticCurveTo(q,z+B,q+O,z+B),i.lineTo(q+L-O,z+B),i.quadraticCurveTo(q+L,z+B,q+L,z+B-O),i.lineTo(q+L,z+O),i.quadraticCurveTo(q+L,z,q+L-O,z),i.lineTo(q+O,z),i.quadraticCurveTo(q,z,q,z+O),i.closePath(),v.visible&&(i.globalAlpha=v.alpha*a,i.fillStyle="#"+("00000"+(0|g).toString(16)).substr(-6),i.fill()),c.visible&&(i.globalAlpha=c.alpha*a,i.strokeStyle="#"+("00000"+(0|u).toString(16)).substr(-6),i.stroke())}}},o.prototype.updateGraphicsTint=function(e){e._prevTint=e.tint,e.canvasTintDirty=e.dirty;for(var t=(e.tint>>16&255)/255,r=(e.tint>>8&255)/255,i=(255&e.tint)/255,a=e.geometry.graphicsData,l=0;l<a.length;++l){var o=a[l],s=0|o.fillStyle.color,n=0|o.lineStyle.color;o._fillTint=((s>>16&255)/255*t*255<<16)+((s>>8&255)/255*r*255<<8)+(255&s)/255*i*255,o._lineTint=((n>>16&255)/255*t*255<<16)+((n>>8&255)/255*r*255<<8)+(255&n)/255*i*255}},o.prototype.destroy=function(){this.renderer=null};var s=new t.Matrix;return r.Graphics.prototype.generateCanvasTexture=function(e,t){void 0===t&&(t=1);var r=this.getLocalBounds(),o=a.RenderTexture.create(r.width,r.height,e,t);l||(l=new i.CanvasRenderer),this.transform.updateLocalTransform(),this.transform.localTransform.copyTo(s),s.invert(),s.tx-=r.x,s.ty-=r.y,l.render(this,o,!0,s);var n=a.Texture.from(o.baseTexture._canvasRenderTarget.canvas,{scaleMode:e});return n.baseTexture.resolution=t,n.baseTexture.update(),n},r.Graphics.prototype.cachedGraphicsData=[],r.Graphics.prototype._renderCanvas=function(e){!0!==this.isMask&&(this.finishPoly(),e.plugins.graphics.render(this))},e.CanvasGraphicsRenderer=o,e}({},PIXI,PIXI,PIXI,PIXI);Object.assign(this.PIXI,_pixi_canvas_graphics);
this.PIXI=this.PIXI||{};var _pixi_canvas_graphics=function(e,t,r,i,a){"use strict";var l,o=function(e){this.renderer=e};o.prototype.render=function(e){var r=this.renderer,i=r.context,a=e.worldAlpha,l=e.transform.worldTransform,o=r.resolution;i.setTransform(l.a*o,l.b*o,l.c*o,l.d*o,l.tx*o,l.ty*o),e.canvasTintDirty===e.geometry.dirty&&e._prevTint===e.tint||this.updateGraphicsTint(e),r.setBlendMode(e.blendMode);for(var s=e.geometry.graphicsData,n=0;n<s.length;n++){var h=s[n],p=h.shape,v=h.fillStyle,g=h.lineStyle,c=h._fillTint,u=h._lineTint;if(i.lineWidth=g.width,h.type===t.SHAPES.POLY){i.beginPath();var d=p.points,f=h.holes,b=void 0,y=void 0,T=void 0,S=void 0;i.moveTo(d[0],d[1]);for(var P=2;P<d.length;P+=2)i.lineTo(d[P],d[P+1]);if(p.closeStroke&&i.closePath(),f.length>0){b=0,T=d[0],S=d[1];for(var m=2;m+2<d.length;m+=2)b+=(d[m]-T)*(d[m+3]-S)-(d[m+2]-T)*(d[m+1]-S);for(var x=0;x<f.length;x++)if(d=f[x].shape.points){y=0,T=d[0],S=d[1];for(var I=2;I+2<d.length;I+=2)y+=(d[I]-T)*(d[I+3]-S)-(d[I+2]-T)*(d[I+1]-S);if(y*b<0){i.moveTo(d[0],d[1]);for(var A=2;A<d.length;A+=2)i.lineTo(d[A],d[A+1])}else{i.moveTo(d[d.length-2],d[d.length-1]);for(var C=d.length-4;C>=0;C-=2)i.lineTo(d[C],d[C+1])}f[x].shape.closeStroke&&i.closePath()}}v.visible&&(i.globalAlpha=v.alpha*a,i.fillStyle="#"+("00000"+(0|c).toString(16)).substr(-6),i.fill()),g.visible&&(i.globalAlpha=g.alpha*a,i.strokeStyle="#"+("00000"+(0|u).toString(16)).substr(-6),i.stroke())}else if(h.type===t.SHAPES.RECT)v.visible&&(i.globalAlpha=v.alpha*a,i.fillStyle="#"+("00000"+(0|c).toString(16)).substr(-6),i.fillRect(p.x,p.y,p.width,p.height)),g.visible&&(i.globalAlpha=g.alpha*a,i.strokeStyle="#"+("00000"+(0|u).toString(16)).substr(-6),i.strokeRect(p.x,p.y,p.width,p.height));else if(h.type===t.SHAPES.CIRC)i.beginPath(),i.arc(p.x,p.y,p.radius,0,2*Math.PI),i.closePath(),v.visible&&(i.globalAlpha=v.alpha*a,i.fillStyle="#"+("00000"+(0|c).toString(16)).substr(-6),i.fill()),g.visible&&(i.globalAlpha=g.alpha*a,i.strokeStyle="#"+("00000"+(0|u).toString(16)).substr(-6),i.stroke());else if(h.type===t.SHAPES.ELIP){var _=2*p.width,k=2*p.height,w=p.x-_/2,R=p.y-k/2;i.beginPath();var E=_/2*.5522848,G=k/2*.5522848,M=w+_,X=R+k,D=w+_/2,H=R+k/2;i.moveTo(w,H),i.bezierCurveTo(w,H-G,D-E,R,D,R),i.bezierCurveTo(D+E,R,M,H-G,M,H),i.bezierCurveTo(M,H+G,D+E,X,D,X),i.bezierCurveTo(D-E,X,w,H+G,w,H),i.closePath(),v.visible&&(i.globalAlpha=v.alpha*a,i.fillStyle="#"+("00000"+(0|c).toString(16)).substr(-6),i.fill()),g.visible&&(i.globalAlpha=g.alpha*a,i.strokeStyle="#"+("00000"+(0|u).toString(16)).substr(-6),i.stroke())}else if(h.type===t.SHAPES.RREC){var q=p.x,z=p.y,L=p.width,B=p.height,O=p.radius,j=Math.min(L,B)/2|0;O=O>j?j:O,i.beginPath(),i.moveTo(q,z+O),i.lineTo(q,z+B-O),i.quadraticCurveTo(q,z+B,q+O,z+B),i.lineTo(q+L-O,z+B),i.quadraticCurveTo(q+L,z+B,q+L,z+B-O),i.lineTo(q+L,z+O),i.quadraticCurveTo(q+L,z,q+L-O,z),i.lineTo(q+O,z),i.quadraticCurveTo(q,z,q,z+O),i.closePath(),v.visible&&(i.globalAlpha=v.alpha*a,i.fillStyle="#"+("00000"+(0|c).toString(16)).substr(-6),i.fill()),g.visible&&(i.globalAlpha=g.alpha*a,i.strokeStyle="#"+("00000"+(0|u).toString(16)).substr(-6),i.stroke())}}},o.prototype.updateGraphicsTint=function(e){e._prevTint=e.tint,e.canvasTintDirty=e.geometry.dirty;for(var t=(e.tint>>16&255)/255,r=(e.tint>>8&255)/255,i=(255&e.tint)/255,a=e.geometry.graphicsData,l=0;l<a.length;++l){var o=a[l],s=0|o.fillStyle.color,n=0|o.lineStyle.color;o._fillTint=((s>>16&255)/255*t*255<<16)+((s>>8&255)/255*r*255<<8)+(255&s)/255*i*255,o._lineTint=((n>>16&255)/255*t*255<<16)+((n>>8&255)/255*r*255<<8)+(255&n)/255*i*255}},o.prototype.destroy=function(){this.renderer=null};var s=new t.Matrix;return r.Graphics.prototype.generateCanvasTexture=function(e,t){void 0===t&&(t=1);var r=this.getLocalBounds(),o=a.RenderTexture.create(r.width,r.height,e,t);l||(l=new i.CanvasRenderer),this.transform.updateLocalTransform(),this.transform.localTransform.copyTo(s),s.invert(),s.tx-=r.x,s.ty-=r.y,l.render(this,o,!0,s);var n=a.Texture.from(o.baseTexture._canvasRenderTarget.canvas,{scaleMode:e});return n.baseTexture.resolution=t,n.baseTexture.update(),n},r.Graphics.prototype.cachedGraphicsData=[],r.Graphics.prototype._renderCanvas=function(e){!0!==this.isMask&&(this.finishPoly(),e.plugins.graphics.render(this))},e.CanvasGraphicsRenderer=o,e}({},PIXI,PIXI,PIXI,PIXI);Object.assign(this.PIXI,_pixi_canvas_graphics);
//# sourceMappingURL=canvas-graphics.min.js.map
/*!
* @pixi/canvas-graphics - v5.1.0
* Compiled Fri, 19 Jul 2019 21:54:36 UTC
* @pixi/canvas-graphics - v5.1.1
* Compiled Fri, 02 Aug 2019 23:20:23 UTC
*

@@ -60,3 +60,3 @@ * @pixi/canvas-graphics is licensed under the MIT License.

// update tint if graphics was dirty
if (graphics.canvasTintDirty !== graphics.dirty
if (graphics.canvasTintDirty !== graphics.geometry.dirty
|| graphics._prevTint !== graphics.tint)

@@ -302,3 +302,3 @@ {

graphics._prevTint = graphics.tint;
graphics.canvasTintDirty = graphics.dirty;
graphics.canvasTintDirty = graphics.geometry.dirty;

@@ -305,0 +305,0 @@ var tintR = ((graphics.tint >> 16) & 0xFF) / 255;

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

@@ -64,3 +64,3 @@ * @pixi/canvas-graphics is licensed under the MIT License.

// update tint if graphics was dirty
if (graphics.canvasTintDirty !== graphics.dirty
if (graphics.canvasTintDirty !== graphics.geometry.dirty
|| graphics._prevTint !== graphics.tint)

@@ -306,3 +306,3 @@ {

graphics._prevTint = graphics.tint;
graphics.canvasTintDirty = graphics.dirty;
graphics.canvasTintDirty = graphics.geometry.dirty;

@@ -309,0 +309,0 @@ var tintR = ((graphics.tint >> 16) & 0xFF) / 255;

{
"name": "@pixi/canvas-graphics",
"version": "5.1.0",
"version": "5.1.1",
"main": "lib/canvas-graphics.js",

@@ -27,8 +27,8 @@ "module": "lib/canvas-graphics.es.js",

"dependencies": {
"@pixi/canvas-renderer": "^5.1.0",
"@pixi/core": "^5.1.0",
"@pixi/graphics": "^5.1.0",
"@pixi/canvas-renderer": "^5.1.1",
"@pixi/core": "^5.1.1",
"@pixi/graphics": "^5.1.1",
"@pixi/math": "^5.1.0"
},
"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