@pixi/filter-drop-shadow
Advanced tools
Comparing version 3.2.0 to 4.0.0
/*! | ||
* @pixi/filter-drop-shadow - v3.2.0 | ||
* Compiled Wed, 23 Dec 2020 00:29:02 UTC | ||
* @pixi/filter-drop-shadow - v4.0.0 | ||
* Compiled Wed, 03 Mar 2021 00:14:06 UTC | ||
* | ||
@@ -8,3 +8,3 @@ * @pixi/filter-drop-shadow is licensed under the MIT License. | ||
*/ | ||
var __filters=function(t,i,e,r,n,o){"use strict";var l="attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}",s="varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform float alpha;\nuniform vec3 color;\n\nuniform vec2 shift;\nuniform vec4 inputSize;\n\nvoid main(void){\n vec4 sample = texture2D(uSampler, vTextureCoord - shift * inputSize.zw);\n\n // Premultiply alpha\n sample.rgb = color.rgb * sample.a;\n\n // alpha user alpha\n sample *= alpha;\n\n gl_FragColor = sample;\n}",a=function(t){function e(e){e&&e.constructor!==Object&&(console.warn("DropShadowFilter now uses options instead of (rotation, distance, blur, color, alpha)"),e={rotation:e},void 0!==arguments[1]&&(e.distance=arguments[1]),void 0!==arguments[2]&&(e.blur=arguments[2]),void 0!==arguments[3]&&(e.color=arguments[3]),void 0!==arguments[4]&&(e.alpha=arguments[4])),e=Object.assign({rotation:45,distance:5,color:0,alpha:.5,shadowOnly:!1,kernels:null,blur:2,quality:3,pixelSize:1,resolution:r.settings.FILTER_RESOLUTION},e),t.call(this);var o=e.kernels,a=e.blur,u=e.quality,c=e.pixelSize,h=e.resolution;this._tintFilter=new t(l,s),this._tintFilter.uniforms.color=new Float32Array(4),this._tintFilter.uniforms.shift=new n.Point,this._tintFilter.resolution=h,this._blurFilter=o?new i.KawaseBlurFilter(o):new i.KawaseBlurFilter(a,u),this.pixelSize=c,this.resolution=h;var p=e.shadowOnly,f=e.rotation,d=e.distance,_=e.alpha,b=e.color;this.shadowOnly=p,this.rotation=f,this.distance=d,this.alpha=_,this.color=b,this._updatePadding()}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var a={resolution:{configurable:!0},distance:{configurable:!0},rotation:{configurable:!0},alpha:{configurable:!0},color:{configurable:!0},kernels:{configurable:!0},blur:{configurable:!0},quality:{configurable:!0},pixelSize:{configurable:!0}};return e.prototype.apply=function(t,i,e,r){var n=t.getFilterTexture();this._tintFilter.apply(t,i,n,1),this._blurFilter.apply(t,n,e,r),!0!==this.shadowOnly&&t.applyFilter(this,i,e,0),t.returnFilterTexture(n)},e.prototype._updatePadding=function(){this.padding=this.distance+2*this.blur},e.prototype._updateShift=function(){this._tintFilter.uniforms.shift.set(this.distance*Math.cos(this.angle),this.distance*Math.sin(this.angle))},a.resolution.get=function(){return this._resolution},a.resolution.set=function(t){this._resolution=t,this._tintFilter&&(this._tintFilter.resolution=t),this._blurFilter&&(this._blurFilter.resolution=t)},a.distance.get=function(){return this._distance},a.distance.set=function(t){this._distance=t,this._updatePadding(),this._updateShift()},a.rotation.get=function(){return this.angle/n.DEG_TO_RAD},a.rotation.set=function(t){this.angle=t*n.DEG_TO_RAD,this._updateShift()},a.alpha.get=function(){return this._tintFilter.uniforms.alpha},a.alpha.set=function(t){this._tintFilter.uniforms.alpha=t},a.color.get=function(){return o.rgb2hex(this._tintFilter.uniforms.color)},a.color.set=function(t){o.hex2rgb(t,this._tintFilter.uniforms.color)},a.kernels.get=function(){return this._blurFilter.kernels},a.kernels.set=function(t){this._blurFilter.kernels=t},a.blur.get=function(){return this._blurFilter.blur},a.blur.set=function(t){this._blurFilter.blur=t,this._updatePadding()},a.quality.get=function(){return this._blurFilter.quality},a.quality.set=function(t){this._blurFilter.quality=t},a.pixelSize.get=function(){return this._blurFilter.pixelSize},a.pixelSize.set=function(t){this._blurFilter.pixelSize=t},Object.defineProperties(e.prototype,a),e}(e.Filter);return t.DropShadowFilter=a,t}({},PIXI.filters,PIXI,PIXI,PIXI,PIXI.utils);Object.assign(PIXI.filters,__filters); | ||
var __filters=function(t,e,r,i,n,o){"use strict";var l=function(t,e){return(l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)};Object.create;Object.create;var u=function(t){function u(o){var l=t.call(this)||this;l.angle=45,l._distance=5,l._resolution=i.settings.FILTER_RESOLUTION;var a=Object.assign(u.defaults,o),s=a.kernels,c=a.blur,p=a.quality,f=a.pixelSize,h=a.resolution;l._tintFilter=new r.Filter("attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform float alpha;\nuniform vec3 color;\n\nuniform vec2 shift;\nuniform vec4 inputSize;\n\nvoid main(void){\n vec4 sample = texture2D(uSampler, vTextureCoord - shift * inputSize.zw);\n\n // Premultiply alpha\n sample.rgb = color.rgb * sample.a;\n\n // alpha user alpha\n sample *= alpha;\n\n gl_FragColor = sample;\n}"),l._tintFilter.uniforms.color=new Float32Array(4),l._tintFilter.uniforms.shift=new n.Point,l._tintFilter.resolution=h,l._blurFilter=s?new e.KawaseBlurFilter(s):new e.KawaseBlurFilter(c,p),l.pixelSize=f,l.resolution=h;var b=a.shadowOnly,_=a.rotation,d=a.distance,y=a.alpha,g=a.color;return l.shadowOnly=b,l.rotation=_,l.distance=d,l.alpha=y,l.color=g,l._updatePadding(),l}return function(t,e){function r(){this.constructor=t}l(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}(u,t),u.prototype.apply=function(t,e,r,i){var n=t.getFilterTexture();this._tintFilter.apply(t,e,n,1),this._blurFilter.apply(t,n,r,i),!0!==this.shadowOnly&&t.applyFilter(this,e,r,0),t.returnFilterTexture(n)},u.prototype._updatePadding=function(){this.padding=this.distance+2*this.blur},u.prototype._updateShift=function(){this._tintFilter.uniforms.shift.set(this.distance*Math.cos(this.angle),this.distance*Math.sin(this.angle))},Object.defineProperty(u.prototype,"resolution",{get:function(){return this._resolution},set:function(t){this._resolution=t,this._tintFilter&&(this._tintFilter.resolution=t),this._blurFilter&&(this._blurFilter.resolution=t)},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"distance",{get:function(){return this._distance},set:function(t){this._distance=t,this._updatePadding(),this._updateShift()},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"rotation",{get:function(){return this.angle/n.DEG_TO_RAD},set:function(t){this.angle=t*n.DEG_TO_RAD,this._updateShift()},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"alpha",{get:function(){return this._tintFilter.uniforms.alpha},set:function(t){this._tintFilter.uniforms.alpha=t},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"color",{get:function(){return o.rgb2hex(this._tintFilter.uniforms.color)},set:function(t){o.hex2rgb(t,this._tintFilter.uniforms.color)},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"kernels",{get:function(){return this._blurFilter.kernels},set:function(t){this._blurFilter.kernels=t},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"blur",{get:function(){return this._blurFilter.blur},set:function(t){this._blurFilter.blur=t,this._updatePadding()},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"quality",{get:function(){return this._blurFilter.quality},set:function(t){this._blurFilter.quality=t},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"pixelSize",{get:function(){return this._blurFilter.pixelSize},set:function(t){this._blurFilter.pixelSize=t},enumerable:!1,configurable:!0}),u.defaults={rotation:45,distance:5,color:0,alpha:.5,shadowOnly:!1,kernels:null,blur:2,quality:3,pixelSize:1,resolution:i.settings.FILTER_RESOLUTION},u}(r.Filter);return t.DropShadowFilter=u,Object.defineProperty(t,"__esModule",{value:!0}),t}({},PIXI.filters,PIXI,PIXI,PIXI,PIXI.utils);Object.assign(PIXI.filters,__filters); | ||
//# sourceMappingURL=filter-drop-shadow.js.map |
{ | ||
"name": "@pixi/filter-drop-shadow", | ||
"version": "3.2.0", | ||
"main": "lib/filter-drop-shadow.cjs.js", | ||
"version": "4.0.0", | ||
"main": "dist/filter-drop-shadow.cjs.js", | ||
"bundle": "dist/filter-drop-shadow.js", | ||
@@ -11,4 +11,4 @@ "description": "PixiJS filter to apply a drop shadow effect", | ||
], | ||
"module": "lib/filter-drop-shadow.esm.js", | ||
"types": "types.d.ts", | ||
"module": "dist/filter-drop-shadow.esm.js", | ||
"types": "index.d.ts", | ||
"homepage": "http://pixijs.com/", | ||
@@ -25,5 +25,4 @@ "bugs": "https://github.com/pixijs/pixi-filters/issues", | ||
"files": [ | ||
"lib", | ||
"dist", | ||
"types.d.ts" | ||
"index.d.ts" | ||
], | ||
@@ -34,14 +33,20 @@ "globals": { | ||
"dependencies": { | ||
"@pixi/filter-kawase-blur": "3.2.0" | ||
"@pixi/filter-kawase-blur": "4.0.0" | ||
}, | ||
"peerDependencies": { | ||
"@pixi/core": "^5.0.0", | ||
"@pixi/math": "^5.0.0", | ||
"@pixi/settings": "^5.0.0", | ||
"@pixi/utils": "^5.0.0" | ||
"@pixi/constants": "^6.0.0", | ||
"@pixi/core": "^6.0.0", | ||
"@pixi/math": "^6.0.0", | ||
"@pixi/settings": "^6.0.0", | ||
"@pixi/utils": "^6.0.0" | ||
}, | ||
"devDependencies": { | ||
"@tools/fragments": "^3.0.3" | ||
"@pixi/constants": "^6.0.0", | ||
"@pixi/core": "^6.0.0", | ||
"@pixi/math": "^6.0.0", | ||
"@pixi/settings": "^6.0.0", | ||
"@pixi/utils": "^6.0.0", | ||
"@tools/fragments": "4.0.0" | ||
}, | ||
"gitHead": "40907de46bbebb4ea190822f03c33b3aec9547ac" | ||
"gitHead": "87aeb2c547d853ec3ffa0754bbff0d89a1c4d0cf" | ||
} |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
103706
713
6
6
1
+ Added@pixi/constants@6.5.10(transitive)
+ Added@pixi/core@6.5.10(transitive)
+ Added@pixi/extensions@6.5.10(transitive)
+ Added@pixi/filter-kawase-blur@4.0.0(transitive)
+ Added@pixi/math@6.5.10(transitive)
+ Added@pixi/runner@6.5.10(transitive)
+ Added@pixi/settings@6.5.10(transitive)
+ Added@pixi/ticker@6.5.10(transitive)
+ Added@pixi/utils@6.5.10(transitive)
+ Added@types/earcut@2.1.4(transitive)
+ Added@types/offscreencanvas@2019.7.3(transitive)
- Removed@pixi/constants@5.3.12(transitive)
- Removed@pixi/core@5.3.12(transitive)
- Removed@pixi/filter-kawase-blur@3.2.0(transitive)
- Removed@pixi/math@5.3.12(transitive)
- Removed@pixi/runner@5.3.12(transitive)
- Removed@pixi/settings@5.3.12(transitive)
- Removed@pixi/ticker@5.3.12(transitive)
- Removed@pixi/utils@5.3.12(transitive)
- Removedismobilejs@1.1.1(transitive)