@pixi/canvas-graphics
Advanced tools
Comparing version 5.0.3 to 5.0.4
/*! | ||
* @pixi/canvas-graphics - v5.0.3 | ||
* Compiled Sun, 19 May 2019 19:03:31 UTC | ||
* @pixi/canvas-graphics - v5.0.4 | ||
* Compiled Fri, 07 Jun 2019 17:17:49 UTC | ||
* | ||
@@ -89,2 +89,4 @@ * @pixi/canvas-graphics is licensed under the MIT License. | ||
var innerArea = (void 0); | ||
var px = (void 0); | ||
var py = (void 0); | ||
@@ -106,5 +108,8 @@ context.moveTo(points[0], points[1]); | ||
outerArea = 0; | ||
for (var j$1 = 0; j$1 < points.length; j$1 += 2) | ||
px = points[0]; | ||
py = points[1]; | ||
for (var j$1 = 2; j$1 + 2 < points.length; j$1 += 2) | ||
{ | ||
outerArea += (points[j$1] * points[j$1 + 3]) - (points[j$1 + 1] * points[j$1 + 2]); | ||
outerArea += ((points[j$1] - px) * (points[j$1 + 3] - py)) | ||
- ((points[j$1 + 2] - px) * (points[j$1 + 1] - py)); | ||
} | ||
@@ -114,8 +119,16 @@ | ||
{ | ||
points = holes[k].points; | ||
points = holes[k].shape.points; | ||
if (!points) | ||
{ | ||
continue; | ||
} | ||
innerArea = 0; | ||
for (var j$2 = 0; j$2 < points.length; j$2 += 2) | ||
px = points[0]; | ||
py = points[1]; | ||
for (var j$2 = 2; j$2 + 2 < points.length; j$2 += 2) | ||
{ | ||
innerArea += (points[j$2] * points[j$2 + 3]) - (points[j$2 + 1] * points[j$2 + 2]); | ||
innerArea += ((points[j$2] - px) * (points[j$2 + 3] - py)) | ||
- ((points[j$2 + 2] - px) * (points[j$2 + 1] - py)); | ||
} | ||
@@ -122,0 +135,0 @@ |
/*! | ||
* @pixi/canvas-graphics - v5.0.3 | ||
* Compiled Sun, 19 May 2019 19:03:31 UTC | ||
* @pixi/canvas-graphics - v5.0.4 | ||
* Compiled Fri, 07 Jun 2019 17:17:49 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),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=v.color,u=c.color;if(i.lineWidth=c.width,h.type===t.SHAPES.POLY){i.beginPath();var b=p.points,f=h.holes,d=void 0,T=void 0;i.moveTo(b[0],b[1]);for(var y=2;y<b.length;y+=2)i.lineTo(b[y],b[y+1]);if(p.closeStroke&&i.closePath(),f.length>0){d=0;for(var S=0;S<b.length;S+=2)d+=b[S]*b[S+3]-b[S+1]*b[S+2];for(var P=0;P<f.length;P++){b=f[P].points,T=0;for(var x=0;x<b.length;x+=2)T+=b[x]*b[x+3]-b[x+1]*b[x+2];if(T*d<0){i.moveTo(b[0],b[1]);for(var C=2;C<b.length;C+=2)i.lineTo(b[C],b[C+1])}else{i.moveTo(b[b.length-2],b[b.length-1]);for(var I=b.length-4;I>=0;I-=2)i.lineTo(b[I],b[I+1])}f[P].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 A=2*p.width,m=2*p.height,k=p.x-A/2,_=p.y-m/2;i.beginPath();var w=A/2*.5522848,R=m/2*.5522848,E=k+A,M=_+m,X=k+A/2,D=_+m/2;i.moveTo(k,D),i.bezierCurveTo(k,D-R,X-w,_,X,_),i.bezierCurveTo(X+w,_,E,D-R,E,D),i.bezierCurveTo(E,D+R,X+w,M,X,M),i.bezierCurveTo(X-w,M,k,D+R,k,D),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 G=p.x,H=p.y,q=p.width,z=p.height,L=p.radius,B=Math.min(q,z)/2|0;L=L>B?B:L,i.beginPath(),i.moveTo(G,H+L),i.lineTo(G,H+z-L),i.quadraticCurveTo(G,H+z,G+L,H+z),i.lineTo(G+q-L,H+z),i.quadraticCurveTo(G+q,H+z,G+q,H+z-L),i.lineTo(G+q,H+L),i.quadraticCurveTo(G+q,H,G+q-L,H),i.lineTo(G+L,H),i.quadraticCurveTo(G,H,G,H+L),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=0;a<e.graphicsData.length;++a){var l=e.graphicsData[a],o=0|l.fillColor,s=0|l.lineColor;l._fillTint=((o>>16&255)/255*t*255<<16)+((o>>8&255)/255*r*255<<8)+(255&o)/255*i*255,l._lineTint=((s>>16&255)/255*t*255<<16)+((s>>8&255)/255*r*255<<8)+(255&s)/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.dirty||(e._prevTint,e.tint),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=v.color,u=c.color;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 C=0;C<f.length;C++)if(d=f[C].shape.points){T=0,y=d[0],S=d[1];for(var I=2;I+2<d.length;I+=2)T+=(d[I]-y)*(d[I+3]-S)-(d[I+2]-y)*(d[I+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 m=d.length-4;m>=0;m-=2)i.lineTo(d[m],d[m+1])}f[C].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 k=2*p.width,_=2*p.height,w=p.x-k/2,R=p.y-_/2;i.beginPath();var E=k/2*.5522848,M=_/2*.5522848,X=w+k,D=R+_,G=w+k/2,H=R+_/2;i.moveTo(w,H),i.bezierCurveTo(w,H-M,G-E,R,G,R),i.bezierCurveTo(G+E,R,X,H-M,X,H),i.bezierCurveTo(X,H+M,G+E,D,G,D),i.bezierCurveTo(G-E,D,w,H+M,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=0;a<e.graphicsData.length;++a){var l=e.graphicsData[a],o=0|l.fillColor,s=0|l.lineColor;l._fillTint=((o>>16&255)/255*t*255<<16)+((o>>8&255)/255*r*255<<8)+(255&o)/255*i*255,l._lineTint=((s>>16&255)/255*t*255<<16)+((s>>8&255)/255*r*255<<8)+(255&s)/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.0.3 | ||
* Compiled Sun, 19 May 2019 19:03:31 UTC | ||
* @pixi/canvas-graphics - v5.0.4 | ||
* Compiled Fri, 07 Jun 2019 17:17:49 UTC | ||
* | ||
@@ -88,2 +88,4 @@ * @pixi/canvas-graphics is licensed under the MIT License. | ||
var innerArea = (void 0); | ||
var px = (void 0); | ||
var py = (void 0); | ||
@@ -105,5 +107,8 @@ context.moveTo(points[0], points[1]); | ||
outerArea = 0; | ||
for (var j$1 = 0; j$1 < points.length; j$1 += 2) | ||
px = points[0]; | ||
py = points[1]; | ||
for (var j$1 = 2; j$1 + 2 < points.length; j$1 += 2) | ||
{ | ||
outerArea += (points[j$1] * points[j$1 + 3]) - (points[j$1 + 1] * points[j$1 + 2]); | ||
outerArea += ((points[j$1] - px) * (points[j$1 + 3] - py)) | ||
- ((points[j$1 + 2] - px) * (points[j$1 + 1] - py)); | ||
} | ||
@@ -113,8 +118,16 @@ | ||
{ | ||
points = holes[k].points; | ||
points = holes[k].shape.points; | ||
if (!points) | ||
{ | ||
continue; | ||
} | ||
innerArea = 0; | ||
for (var j$2 = 0; j$2 < points.length; j$2 += 2) | ||
px = points[0]; | ||
py = points[1]; | ||
for (var j$2 = 2; j$2 + 2 < points.length; j$2 += 2) | ||
{ | ||
innerArea += (points[j$2] * points[j$2 + 3]) - (points[j$2 + 1] * points[j$2 + 2]); | ||
innerArea += ((points[j$2] - px) * (points[j$2 + 3] - py)) | ||
- ((points[j$2 + 2] - px) * (points[j$2 + 1] - py)); | ||
} | ||
@@ -121,0 +134,0 @@ |
/*! | ||
* @pixi/canvas-graphics - v5.0.3 | ||
* Compiled Sun, 19 May 2019 19:03:31 UTC | ||
* @pixi/canvas-graphics - v5.0.4 | ||
* Compiled Fri, 07 Jun 2019 17:17:49 UTC | ||
* | ||
@@ -92,2 +92,4 @@ * @pixi/canvas-graphics is licensed under the MIT License. | ||
var innerArea = (void 0); | ||
var px = (void 0); | ||
var py = (void 0); | ||
@@ -109,5 +111,8 @@ context.moveTo(points[0], points[1]); | ||
outerArea = 0; | ||
for (var j$1 = 0; j$1 < points.length; j$1 += 2) | ||
px = points[0]; | ||
py = points[1]; | ||
for (var j$1 = 2; j$1 + 2 < points.length; j$1 += 2) | ||
{ | ||
outerArea += (points[j$1] * points[j$1 + 3]) - (points[j$1 + 1] * points[j$1 + 2]); | ||
outerArea += ((points[j$1] - px) * (points[j$1 + 3] - py)) | ||
- ((points[j$1 + 2] - px) * (points[j$1 + 1] - py)); | ||
} | ||
@@ -117,8 +122,16 @@ | ||
{ | ||
points = holes[k].points; | ||
points = holes[k].shape.points; | ||
if (!points) | ||
{ | ||
continue; | ||
} | ||
innerArea = 0; | ||
for (var j$2 = 0; j$2 < points.length; j$2 += 2) | ||
px = points[0]; | ||
py = points[1]; | ||
for (var j$2 = 2; j$2 + 2 < points.length; j$2 += 2) | ||
{ | ||
innerArea += (points[j$2] * points[j$2 + 3]) - (points[j$2 + 1] * points[j$2 + 2]); | ||
innerArea += ((points[j$2] - px) * (points[j$2 + 3] - py)) | ||
- ((points[j$2 + 2] - px) * (points[j$2 + 1] - py)); | ||
} | ||
@@ -125,0 +138,0 @@ |
{ | ||
"name": "@pixi/canvas-graphics", | ||
"version": "5.0.3", | ||
"version": "5.0.4", | ||
"main": "lib/canvas-graphics.js", | ||
@@ -27,6 +27,6 @@ "module": "lib/canvas-graphics.es.js", | ||
"dependencies": { | ||
"@pixi/canvas-renderer": "^5.0.3", | ||
"@pixi/core": "^5.0.3", | ||
"@pixi/graphics": "^5.0.3", | ||
"@pixi/math": "^5.0.3" | ||
"@pixi/canvas-renderer": "^5.0.4", | ||
"@pixi/core": "^5.0.4", | ||
"@pixi/graphics": "^5.0.4", | ||
"@pixi/math": "^5.0.4" | ||
}, | ||
@@ -36,3 +36,3 @@ "devDependencies": { | ||
}, | ||
"gitHead": "ba03f57001cd8bae3ae3644911cd513c68184e7c" | ||
"gitHead": "7a771ca5f05eeba62222b53446d0c2bdfcac37f7" | ||
} |
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
147060
1054
Updated@pixi/canvas-renderer@^5.0.4
Updated@pixi/core@^5.0.4
Updated@pixi/graphics@^5.0.4
Updated@pixi/math@^5.0.4