@pixi/canvas-particles
Advanced tools
Comparing version 5.2.4 to 5.3.0
/*! | ||
* @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 @@ }; |
/*! | ||
* @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
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
34511
221
+ Added@pixi/constants@5.3.0(transitive)
+ Added@pixi/core@5.3.0(transitive)
+ Added@pixi/display@5.3.0(transitive)
+ Added@pixi/math@5.3.0(transitive)
+ Added@pixi/particles@5.3.0(transitive)
+ Added@pixi/runner@5.3.0(transitive)
+ Added@pixi/settings@5.3.0(transitive)
+ Added@pixi/ticker@5.3.0(transitive)
+ Added@pixi/utils@5.3.0(transitive)
- Removed@pixi/constants@5.2.4(transitive)
- Removed@pixi/core@5.2.4(transitive)
- Removed@pixi/display@5.2.4(transitive)
- Removed@pixi/math@5.2.4(transitive)
- Removed@pixi/particles@5.2.4(transitive)
- Removed@pixi/runner@5.2.4(transitive)
- Removed@pixi/settings@5.2.4(transitive)
- Removed@pixi/ticker@5.2.4(transitive)
- Removed@pixi/utils@5.2.4(transitive)
Updated@pixi/particles@5.3.0