Socket
Socket
Sign inDemoInstall

@pixi/canvas-sprite

Package Overview
Dependencies
Maintainers
2
Versions
121
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pixi/canvas-sprite - npm Package Compare versions

Comparing version 6.3.0 to 6.3.1

8

dist/browser/canvas-sprite.js
/*!
* @pixi/canvas-sprite - v6.3.0
* Compiled Wed, 23 Mar 2022 18:58:56 UTC
* @pixi/canvas-sprite - v6.3.1
* Compiled Tue, 03 May 2022 13:21:19 UTC
*

@@ -147,6 +147,8 @@ * @pixi/canvas-sprite is licensed under the MIT License.

Object.defineProperty(exports, '__esModule', { value: true });
return exports;
}({}, PIXI, PIXI, PIXI, PIXI));
})({}, PIXI, PIXI, PIXI, PIXI);
Object.assign(this.PIXI, _pixi_canvas_sprite);
//# sourceMappingURL=canvas-sprite.js.map
/*!
* @pixi/canvas-sprite - v6.3.0
* Compiled Wed, 23 Mar 2022 18:58:56 UTC
* @pixi/canvas-sprite - v6.3.1
* Compiled Tue, 03 May 2022 13:21:19 UTC
*

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

*/
this.PIXI=this.PIXI||{};var _pixi_canvas_sprite=function(t,r,e,o,i){"use strict";var n=new e.Matrix,a=function(){function t(t){this.renderer=t}return t.prototype.render=function(t){var i=t._texture,a=this.renderer,s=a.context;if(i.valid){var l=i._frame.width,h=i._frame.height,d=t.transform.worldTransform,u=0,p=0,c=i.baseTexture.getDrawableSource();if(!(i.orig.width<=0||i.orig.height<=0)&&i.valid&&c){a.setBlendMode(t.blendMode,!0),a.context.globalAlpha=t.worldAlpha;var f=i.baseTexture.scaleMode===r.SCALE_MODES.LINEAR;a.smoothProperty&&a.context[a.smoothProperty]!==f&&(s[a.smoothProperty]=f),i.trim?(u=i.trim.width/2+i.trim.x-t.anchor.x*i.orig.width,p=i.trim.height/2+i.trim.y-t.anchor.y*i.orig.height):(u=(.5-t.anchor.x)*i.orig.width,p=(.5-t.anchor.y)*i.orig.height),i.rotate&&(d.copyTo(n),d=n,e.groupD8.matrixAppendRotationInv(d,i.rotate,u,p),u=0,p=0),u-=l/2,p-=h/2,a.setContextTransform(d,t.roundPixels,1),t.roundPixels&&(u|=0,p|=0);var _=i.baseTexture.resolution,g=a._outerBlend;g&&(s.save(),s.beginPath(),s.rect(u*a.resolution,p*a.resolution,l*a.resolution,h*a.resolution),s.clip()),16777215!==t.tint?(t._cachedTint===t.tint&&t._tintedCanvas.tintId===t._texture._updateID||(t._cachedTint=t.tint,t._tintedCanvas=o.canvasUtils.getTintedCanvas(t,t.tint)),s.drawImage(t._tintedCanvas,0,0,Math.floor(l*_),Math.floor(h*_),Math.floor(u*a.resolution),Math.floor(p*a.resolution),Math.floor(l*a.resolution),Math.floor(h*a.resolution))):s.drawImage(c,i._frame.x*_,i._frame.y*_,Math.floor(l*_),Math.floor(h*_),Math.floor(u*a.resolution),Math.floor(p*a.resolution),Math.floor(l*a.resolution),Math.floor(h*a.resolution)),g&&s.restore(),a.setBlendMode(r.BLEND_MODES.NORMAL)}}},t.prototype.destroy=function(){this.renderer=null},t}();return i.Sprite.prototype._tintedCanvas=null,i.Sprite.prototype._renderCanvas=function(t){t.plugins.sprite.render(this)},t.CanvasSpriteRenderer=a,t}({},PIXI,PIXI,PIXI,PIXI);Object.assign(this.PIXI,_pixi_canvas_sprite);
this.PIXI=this.PIXI||{};var _pixi_canvas_sprite=function(t,e,r,o,i){"use strict";var n=new r.Matrix,a=function(){function t(t){this.renderer=t}return t.prototype.render=function(t){var i=t._texture,a=this.renderer,s=a.context;if(i.valid){var l=i._frame.width,h=i._frame.height,d=t.transform.worldTransform,u=0,p=0,c=i.baseTexture.getDrawableSource();if(!(i.orig.width<=0||i.orig.height<=0)&&i.valid&&c){a.setBlendMode(t.blendMode,!0),a.context.globalAlpha=t.worldAlpha;var f=i.baseTexture.scaleMode===e.SCALE_MODES.LINEAR;a.smoothProperty&&a.context[a.smoothProperty]!==f&&(s[a.smoothProperty]=f),i.trim?(u=i.trim.width/2+i.trim.x-t.anchor.x*i.orig.width,p=i.trim.height/2+i.trim.y-t.anchor.y*i.orig.height):(u=(.5-t.anchor.x)*i.orig.width,p=(.5-t.anchor.y)*i.orig.height),i.rotate&&(d.copyTo(n),d=n,r.groupD8.matrixAppendRotationInv(d,i.rotate,u,p),u=0,p=0),u-=l/2,p-=h/2,a.setContextTransform(d,t.roundPixels,1),t.roundPixels&&(u|=0,p|=0);var _=i.baseTexture.resolution,v=a._outerBlend;v&&(s.save(),s.beginPath(),s.rect(u*a.resolution,p*a.resolution,l*a.resolution,h*a.resolution),s.clip()),16777215!==t.tint?(t._cachedTint===t.tint&&t._tintedCanvas.tintId===t._texture._updateID||(t._cachedTint=t.tint,t._tintedCanvas=o.canvasUtils.getTintedCanvas(t,t.tint)),s.drawImage(t._tintedCanvas,0,0,Math.floor(l*_),Math.floor(h*_),Math.floor(u*a.resolution),Math.floor(p*a.resolution),Math.floor(l*a.resolution),Math.floor(h*a.resolution))):s.drawImage(c,i._frame.x*_,i._frame.y*_,Math.floor(l*_),Math.floor(h*_),Math.floor(u*a.resolution),Math.floor(p*a.resolution),Math.floor(l*a.resolution),Math.floor(h*a.resolution)),v&&s.restore(),a.setBlendMode(e.BLEND_MODES.NORMAL)}}},t.prototype.destroy=function(){this.renderer=null},t}();return i.Sprite.prototype._tintedCanvas=null,i.Sprite.prototype._renderCanvas=function(t){t.plugins.sprite.render(this)},t.CanvasSpriteRenderer=a,Object.defineProperty(t,"__esModule",{value:!0}),t}({},PIXI,PIXI,PIXI,PIXI);Object.assign(this.PIXI,_pixi_canvas_sprite);
//# sourceMappingURL=canvas-sprite.min.js.map
/*!
* @pixi/canvas-sprite - v6.3.0
* Compiled Wed, 23 Mar 2022 18:58:56 UTC
* @pixi/canvas-sprite - v6.3.1
* Compiled Tue, 03 May 2022 13:21:19 UTC
*

@@ -5,0 +5,0 @@ * @pixi/canvas-sprite is licensed under the MIT License.

/*!
* @pixi/canvas-sprite - v6.3.0
* Compiled Wed, 23 Mar 2022 18:58:56 UTC
* @pixi/canvas-sprite - v6.3.1
* Compiled Tue, 03 May 2022 13:21:19 UTC
*

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

*/
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var constants=require("@pixi/constants"),math=require("@pixi/math"),canvasRenderer=require("@pixi/canvas-renderer"),sprite=require("@pixi/sprite"),canvasRenderWorldTransform=new math.Matrix,CanvasSpriteRenderer=function(){function e(e){this.renderer=e}return e.prototype.render=function(e){var r=e._texture,t=this.renderer,o=t.context;if(r.valid){var n=r._frame.width,a=r._frame.height,i=e.transform.worldTransform,s=0,l=0,d=r.baseTexture.getDrawableSource();if(!(r.orig.width<=0||r.orig.height<=0)&&r.valid&&d){t.setBlendMode(e.blendMode,!0),t.context.globalAlpha=e.worldAlpha;var h=r.baseTexture.scaleMode===constants.SCALE_MODES.LINEAR;t.smoothProperty&&t.context[t.smoothProperty]!==h&&(o[t.smoothProperty]=h),r.trim?(s=r.trim.width/2+r.trim.x-e.anchor.x*r.orig.width,l=r.trim.height/2+r.trim.y-e.anchor.y*r.orig.height):(s=(.5-e.anchor.x)*r.orig.width,l=(.5-e.anchor.y)*r.orig.height),r.rotate&&(i.copyTo(canvasRenderWorldTransform),i=canvasRenderWorldTransform,math.groupD8.matrixAppendRotationInv(i,r.rotate,s,l),s=0,l=0),s-=n/2,l-=a/2,t.setContextTransform(i,e.roundPixels,1),e.roundPixels&&(s|=0,l|=0);var u=r.baseTexture.resolution,p=t._outerBlend;p&&(o.save(),o.beginPath(),o.rect(s*t.resolution,l*t.resolution,n*t.resolution,a*t.resolution),o.clip()),16777215!==e.tint?(e._cachedTint===e.tint&&e._tintedCanvas.tintId===e._texture._updateID||(e._cachedTint=e.tint,e._tintedCanvas=canvasRenderer.canvasUtils.getTintedCanvas(e,e.tint)),o.drawImage(e._tintedCanvas,0,0,Math.floor(n*u),Math.floor(a*u),Math.floor(s*t.resolution),Math.floor(l*t.resolution),Math.floor(n*t.resolution),Math.floor(a*t.resolution))):o.drawImage(d,r._frame.x*u,r._frame.y*u,Math.floor(n*u),Math.floor(a*u),Math.floor(s*t.resolution),Math.floor(l*t.resolution),Math.floor(n*t.resolution),Math.floor(a*t.resolution)),p&&o.restore(),t.setBlendMode(constants.BLEND_MODES.NORMAL)}}},e.prototype.destroy=function(){this.renderer=null},e}();sprite.Sprite.prototype._tintedCanvas=null,sprite.Sprite.prototype._renderCanvas=function(e){e.plugins.sprite.render(this)},exports.CanvasSpriteRenderer=CanvasSpriteRenderer;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("@pixi/constants"),e=require("@pixi/math"),r=require("@pixi/canvas-renderer"),o=require("@pixi/sprite"),i=new e.Matrix,n=function(){function o(t){this.renderer=t}return o.prototype.render=function(o){var n=o._texture,a=this.renderer,s=a.context;if(n.valid){var l=n._frame.width,h=n._frame.height,d=o.transform.worldTransform,u=0,p=0,f=n.baseTexture.getDrawableSource();if(!(n.orig.width<=0||n.orig.height<=0)&&n.valid&&f){a.setBlendMode(o.blendMode,!0),a.context.globalAlpha=o.worldAlpha;var c=n.baseTexture.scaleMode===t.SCALE_MODES.LINEAR;a.smoothProperty&&a.context[a.smoothProperty]!==c&&(s[a.smoothProperty]=c),n.trim?(u=n.trim.width/2+n.trim.x-o.anchor.x*n.orig.width,p=n.trim.height/2+n.trim.y-o.anchor.y*n.orig.height):(u=(.5-o.anchor.x)*n.orig.width,p=(.5-o.anchor.y)*n.orig.height),n.rotate&&(d.copyTo(i),d=i,e.groupD8.matrixAppendRotationInv(d,n.rotate,u,p),u=0,p=0),u-=l/2,p-=h/2,a.setContextTransform(d,o.roundPixels,1),o.roundPixels&&(u|=0,p|=0);var x=n.baseTexture.resolution,M=a._outerBlend;M&&(s.save(),s.beginPath(),s.rect(u*a.resolution,p*a.resolution,l*a.resolution,h*a.resolution),s.clip()),16777215!==o.tint?(o._cachedTint===o.tint&&o._tintedCanvas.tintId===o._texture._updateID||(o._cachedTint=o.tint,o._tintedCanvas=r.canvasUtils.getTintedCanvas(o,o.tint)),s.drawImage(o._tintedCanvas,0,0,Math.floor(l*x),Math.floor(h*x),Math.floor(u*a.resolution),Math.floor(p*a.resolution),Math.floor(l*a.resolution),Math.floor(h*a.resolution))):s.drawImage(f,n._frame.x*x,n._frame.y*x,Math.floor(l*x),Math.floor(h*x),Math.floor(u*a.resolution),Math.floor(p*a.resolution),Math.floor(l*a.resolution),Math.floor(h*a.resolution)),M&&s.restore(),a.setBlendMode(t.BLEND_MODES.NORMAL)}}},o.prototype.destroy=function(){this.renderer=null},o}();o.Sprite.prototype._tintedCanvas=null,o.Sprite.prototype._renderCanvas=function(t){t.plugins.sprite.render(this)},exports.CanvasSpriteRenderer=n;
//# sourceMappingURL=canvas-sprite.min.js.map
/*!
* @pixi/canvas-sprite - v6.3.0
* Compiled Wed, 23 Mar 2022 18:58:56 UTC
* @pixi/canvas-sprite - v6.3.1
* Compiled Tue, 03 May 2022 13:21:19 UTC
*

@@ -5,0 +5,0 @@ * @pixi/canvas-sprite is licensed under the MIT License.

/*!
* @pixi/canvas-sprite - v6.3.0
* Compiled Wed, 23 Mar 2022 18:58:56 UTC
* @pixi/canvas-sprite - v6.3.1
* Compiled Tue, 03 May 2022 13:21:19 UTC
*

@@ -5,0 +5,0 @@ * @pixi/canvas-sprite is licensed under the MIT License.

{
"name": "@pixi/canvas-sprite",
"version": "6.3.0",
"version": "6.3.1",
"main": "dist/cjs/canvas-sprite.js",

@@ -28,10 +28,10 @@ "module": "dist/esm/canvas-sprite.js",

"peerDependencies": {
"@pixi/canvas-display": "6.3.0",
"@pixi/canvas-renderer": "6.3.0",
"@pixi/constants": "6.3.0",
"@pixi/math": "6.3.0",
"@pixi/sprite": "6.3.0",
"@pixi/utils": "6.3.0"
"@pixi/canvas-display": "6.3.1",
"@pixi/canvas-renderer": "6.3.1",
"@pixi/constants": "6.3.1",
"@pixi/math": "6.3.1",
"@pixi/sprite": "6.3.1",
"@pixi/utils": "6.3.1"
},
"gitHead": "dc311cdd7a28e6817556cdc674fd15ef71069467"
"gitHead": "a520915d81f307c40fcbad5d877b0f2de465c4bf"
}

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

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