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

@pixi/canvas-particles

Package Overview
Dependencies
Maintainers
1
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pixi/canvas-particles - npm Package Compare versions

Comparing version 5.2.4 to 5.3.0

64

dist/canvas-particles.js
/*!
* @pixi/canvas-particles - v5.2.4
* Compiled Sun, 03 May 2020 22:38:52 UTC
* @pixi/canvas-particles - v5.3.0
* Compiled Thu, 18 Jun 2020 23:27:40 UTC
*

@@ -19,91 +19,51 @@ * @pixi/canvas-particles is licensed under the MIT License.

*/
particles.ParticleContainer.prototype.renderCanvas = function renderCanvas(renderer)
{
if (!this.visible || this.worldAlpha <= 0 || !this.children.length || !this.renderable)
{
particles.ParticleContainer.prototype.renderCanvas = function renderCanvas(renderer) {
if (!this.visible || this.worldAlpha <= 0 || !this.children.length || !this.renderable) {
return;
}
var context = renderer.context;
var transform = this.worldTransform;
var isRotated = true;
var positionX = 0;
var positionY = 0;
var finalWidth = 0;
var finalHeight = 0;
renderer.setBlendMode(this.blendMode);
context.globalAlpha = this.worldAlpha;
this.displayObjectUpdateTransform();
for (var i = 0; i < this.children.length; ++i)
{
for (var i = 0; i < this.children.length; ++i) {
var child = this.children[i];
if (!child.visible)
{
if (!child.visible) {
continue;
}
if (!child._texture.valid)
{
if (!child._texture.valid) {
continue;
}
var frame = child._texture.frame;
context.globalAlpha = this.worldAlpha * child.alpha;
if (child.rotation % (Math.PI * 2) === 0)
{
if (child.rotation % (Math.PI * 2) === 0) {
// this is the fastest way to optimise! - if rotation is 0 then we can avoid any kind of setTransform call
if (isRotated)
{
if (isRotated) {
renderer.setContextTransform(transform, false, 1);
isRotated = false;
}
positionX = ((child.anchor.x) * (-frame.width * child.scale.x)) + child.position.x + 0.5;
positionY = ((child.anchor.y) * (-frame.height * child.scale.y)) + child.position.y + 0.5;
finalWidth = frame.width * child.scale.x;
finalHeight = frame.height * child.scale.y;
}
else
{
if (!isRotated)
{
else {
if (!isRotated) {
isRotated = true;
}
child.displayObjectUpdateTransform();
var childTransform = child.worldTransform;
renderer.setContextTransform(childTransform, this.roundPixels, 1);
positionX = ((child.anchor.x) * (-frame.width)) + 0.5;
positionY = ((child.anchor.y) * (-frame.height)) + 0.5;
finalWidth = frame.width;
finalHeight = frame.height;
}
var resolution = child._texture.baseTexture.resolution;
context.drawImage(
child._texture.baseTexture.getDrawableSource(),
frame.x * resolution,
frame.y * resolution,
frame.width * resolution,
frame.height * resolution,
positionX * renderer.resolution,
positionY * renderer.resolution,
finalWidth * renderer.resolution,
finalHeight * renderer.resolution
);
context.drawImage(child._texture.baseTexture.getDrawableSource(), frame.x * resolution, frame.y * resolution, frame.width * resolution, frame.height * resolution, positionX * renderer.resolution, positionY * renderer.resolution, finalWidth * renderer.resolution, finalHeight * renderer.resolution);
}

@@ -110,0 +70,0 @@ };

4

dist/canvas-particles.min.js
/*!
* @pixi/canvas-particles - v5.2.4
* Compiled Sun, 03 May 2020 22:38:52 UTC
* @pixi/canvas-particles - v5.3.0
* Compiled Thu, 18 Jun 2020 23:27:40 UTC
*

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

/*!
* @pixi/canvas-particles - v5.2.4
* Compiled Sun, 03 May 2020 22:38:52 UTC
* @pixi/canvas-particles - v5.3.0
* Compiled Thu, 18 Jun 2020 23:27:40 UTC
*

@@ -17,93 +17,53 @@ * @pixi/canvas-particles is licensed under the MIT License.

*/
ParticleContainer.prototype.renderCanvas = function renderCanvas(renderer)
{
if (!this.visible || this.worldAlpha <= 0 || !this.children.length || !this.renderable)
{
ParticleContainer.prototype.renderCanvas = function renderCanvas(renderer) {
if (!this.visible || this.worldAlpha <= 0 || !this.children.length || !this.renderable) {
return;
}
var context = renderer.context;
var transform = this.worldTransform;
var isRotated = true;
var positionX = 0;
var positionY = 0;
var finalWidth = 0;
var finalHeight = 0;
renderer.setBlendMode(this.blendMode);
context.globalAlpha = this.worldAlpha;
this.displayObjectUpdateTransform();
for (var i = 0; i < this.children.length; ++i)
{
for (var i = 0; i < this.children.length; ++i) {
var child = this.children[i];
if (!child.visible)
{
if (!child.visible) {
continue;
}
if (!child._texture.valid)
{
if (!child._texture.valid) {
continue;
}
var frame = child._texture.frame;
context.globalAlpha = this.worldAlpha * child.alpha;
if (child.rotation % (Math.PI * 2) === 0)
{
if (child.rotation % (Math.PI * 2) === 0) {
// this is the fastest way to optimise! - if rotation is 0 then we can avoid any kind of setTransform call
if (isRotated)
{
if (isRotated) {
renderer.setContextTransform(transform, false, 1);
isRotated = false;
}
positionX = ((child.anchor.x) * (-frame.width * child.scale.x)) + child.position.x + 0.5;
positionY = ((child.anchor.y) * (-frame.height * child.scale.y)) + child.position.y + 0.5;
finalWidth = frame.width * child.scale.x;
finalHeight = frame.height * child.scale.y;
}
else
{
if (!isRotated)
{
else {
if (!isRotated) {
isRotated = true;
}
child.displayObjectUpdateTransform();
var childTransform = child.worldTransform;
renderer.setContextTransform(childTransform, this.roundPixels, 1);
positionX = ((child.anchor.x) * (-frame.width)) + 0.5;
positionY = ((child.anchor.y) * (-frame.height)) + 0.5;
finalWidth = frame.width;
finalHeight = frame.height;
}
var resolution = child._texture.baseTexture.resolution;
context.drawImage(
child._texture.baseTexture.getDrawableSource(),
frame.x * resolution,
frame.y * resolution,
frame.width * resolution,
frame.height * resolution,
positionX * renderer.resolution,
positionY * renderer.resolution,
finalWidth * renderer.resolution,
finalHeight * renderer.resolution
);
context.drawImage(child._texture.baseTexture.getDrawableSource(), frame.x * resolution, frame.y * resolution, frame.width * resolution, frame.height * resolution, positionX * renderer.resolution, positionY * renderer.resolution, finalWidth * renderer.resolution, finalHeight * renderer.resolution);
}
};
//# sourceMappingURL=canvas-particles.es.js.map
/*!
* @pixi/canvas-particles - v5.2.4
* Compiled Sun, 03 May 2020 22:38:52 UTC
* @pixi/canvas-particles - v5.3.0
* Compiled Thu, 18 Jun 2020 23:27:40 UTC
*

@@ -19,93 +19,53 @@ * @pixi/canvas-particles is licensed under the MIT License.

*/
particles.ParticleContainer.prototype.renderCanvas = function renderCanvas(renderer)
{
if (!this.visible || this.worldAlpha <= 0 || !this.children.length || !this.renderable)
{
particles.ParticleContainer.prototype.renderCanvas = function renderCanvas(renderer) {
if (!this.visible || this.worldAlpha <= 0 || !this.children.length || !this.renderable) {
return;
}
var context = renderer.context;
var transform = this.worldTransform;
var isRotated = true;
var positionX = 0;
var positionY = 0;
var finalWidth = 0;
var finalHeight = 0;
renderer.setBlendMode(this.blendMode);
context.globalAlpha = this.worldAlpha;
this.displayObjectUpdateTransform();
for (var i = 0; i < this.children.length; ++i)
{
for (var i = 0; i < this.children.length; ++i) {
var child = this.children[i];
if (!child.visible)
{
if (!child.visible) {
continue;
}
if (!child._texture.valid)
{
if (!child._texture.valid) {
continue;
}
var frame = child._texture.frame;
context.globalAlpha = this.worldAlpha * child.alpha;
if (child.rotation % (Math.PI * 2) === 0)
{
if (child.rotation % (Math.PI * 2) === 0) {
// this is the fastest way to optimise! - if rotation is 0 then we can avoid any kind of setTransform call
if (isRotated)
{
if (isRotated) {
renderer.setContextTransform(transform, false, 1);
isRotated = false;
}
positionX = ((child.anchor.x) * (-frame.width * child.scale.x)) + child.position.x + 0.5;
positionY = ((child.anchor.y) * (-frame.height * child.scale.y)) + child.position.y + 0.5;
finalWidth = frame.width * child.scale.x;
finalHeight = frame.height * child.scale.y;
}
else
{
if (!isRotated)
{
else {
if (!isRotated) {
isRotated = true;
}
child.displayObjectUpdateTransform();
var childTransform = child.worldTransform;
renderer.setContextTransform(childTransform, this.roundPixels, 1);
positionX = ((child.anchor.x) * (-frame.width)) + 0.5;
positionY = ((child.anchor.y) * (-frame.height)) + 0.5;
finalWidth = frame.width;
finalHeight = frame.height;
}
var resolution = child._texture.baseTexture.resolution;
context.drawImage(
child._texture.baseTexture.getDrawableSource(),
frame.x * resolution,
frame.y * resolution,
frame.width * resolution,
frame.height * resolution,
positionX * renderer.resolution,
positionY * renderer.resolution,
finalWidth * renderer.resolution,
finalHeight * renderer.resolution
);
context.drawImage(child._texture.baseTexture.getDrawableSource(), frame.x * resolution, frame.y * resolution, frame.width * resolution, frame.height * resolution, positionX * renderer.resolution, positionY * renderer.resolution, finalWidth * renderer.resolution, finalHeight * renderer.resolution);
}
};
//# sourceMappingURL=canvas-particles.js.map
{
"name": "@pixi/canvas-particles",
"version": "5.2.4",
"version": "5.3.0",
"main": "lib/canvas-particles.js",

@@ -28,5 +28,5 @@ "module": "lib/canvas-particles.es.js",

"dependencies": {
"@pixi/particles": "5.2.4"
"@pixi/particles": "5.3.0"
},
"gitHead": "71c6b3b2061af4a4f3a95a265d46e933b8befc2c"
"gitHead": "a9b7b32a9c0aeb3d9c42ef04b2c2a39be1cd0880"
}

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