tsparticles 1.42.0 → 1.42.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Core/Canvas.d.ts +1 -1
- package/Core/Canvas.js +16 -7
- package/Core/Particles.js +2 -3
- package/Plugins/Emitters/Options/Classes/Emitter.js +2 -2
- package/browser/Core/Canvas.d.ts +1 -1
- package/browser/Core/Canvas.js +16 -7
- package/browser/Core/Particles.js +3 -4
- package/browser/Plugins/Emitters/Options/Classes/Emitter.js +2 -2
- package/esm/Core/Canvas.d.ts +1 -1
- package/esm/Core/Canvas.js +16 -7
- package/esm/Core/Particles.js +2 -3
- package/esm/Plugins/Emitters/Options/Classes/Emitter.js +2 -2
- package/package.json +15 -3
- package/report.html +2 -2
- package/report.slim.html +2 -2
- package/tsparticles.engine.js +15 -10
- package/tsparticles.engine.min.js +2 -2
- package/tsparticles.interaction.external.attract.js +15 -10
- package/tsparticles.interaction.external.attract.min.js +1 -1
- package/tsparticles.interaction.external.bounce.js +15 -10
- package/tsparticles.interaction.external.bounce.min.js +1 -1
- package/tsparticles.interaction.external.bubble.js +15 -10
- package/tsparticles.interaction.external.bubble.min.js +1 -1
- package/tsparticles.interaction.external.connect.js +15 -10
- package/tsparticles.interaction.external.connect.min.js +1 -1
- package/tsparticles.interaction.external.grab.js +15 -10
- package/tsparticles.interaction.external.grab.min.js +1 -1
- package/tsparticles.interaction.external.repulse.js +15 -10
- package/tsparticles.interaction.external.repulse.min.js +1 -1
- package/tsparticles.interaction.external.trail.js +15 -10
- package/tsparticles.interaction.external.trail.min.js +1 -1
- package/tsparticles.interaction.particles.attract.js +15 -10
- package/tsparticles.interaction.particles.attract.min.js +1 -1
- package/tsparticles.interaction.particles.collisions.js +15 -10
- package/tsparticles.interaction.particles.collisions.min.js +1 -1
- package/tsparticles.interaction.particles.links.js +15 -10
- package/tsparticles.interaction.particles.links.min.js +1 -1
- package/tsparticles.js +17 -12
- package/tsparticles.min.js +2 -2
- package/tsparticles.pathseg.min.js +1 -1
- package/tsparticles.plugins.absorbers.js +15 -10
- package/tsparticles.plugins.absorbers.min.js +1 -1
- package/tsparticles.plugins.emitters.js +17 -12
- package/tsparticles.plugins.emitters.min.js +2 -2
- package/tsparticles.plugins.polygonMask.js +15 -10
- package/tsparticles.plugins.polygonMask.min.js +1 -1
- package/tsparticles.shape.circle.min.js +1 -1
- package/tsparticles.shape.image.js +15 -10
- package/tsparticles.shape.image.min.js +1 -1
- package/tsparticles.shape.line.min.js +1 -1
- package/tsparticles.shape.polygon.min.js +1 -1
- package/tsparticles.shape.square.min.js +1 -1
- package/tsparticles.shape.star.min.js +1 -1
- package/tsparticles.shape.text.js +15 -10
- package/tsparticles.shape.text.min.js +1 -1
- package/tsparticles.slim.js +15 -10
- package/tsparticles.slim.min.js +2 -2
- package/tsparticles.updater.angle.js +15 -10
- package/tsparticles.updater.angle.min.js +1 -1
- package/tsparticles.updater.color.js +15 -10
- package/tsparticles.updater.color.min.js +1 -1
- package/tsparticles.updater.life.js +15 -10
- package/tsparticles.updater.life.min.js +1 -1
- package/tsparticles.updater.opacity.js +15 -10
- package/tsparticles.updater.opacity.min.js +1 -1
- package/tsparticles.updater.outModes.js +15 -10
- package/tsparticles.updater.outModes.min.js +1 -1
- package/tsparticles.updater.roll.js +15 -10
- package/tsparticles.updater.roll.min.js +1 -1
- package/tsparticles.updater.size.js +15 -10
- package/tsparticles.updater.size.min.js +1 -1
- package/tsparticles.updater.strokeColor.js +15 -10
- package/tsparticles.updater.strokeColor.min.js +1 -1
- package/tsparticles.updater.tilt.js +15 -10
- package/tsparticles.updater.tilt.min.js +1 -1
- package/tsparticles.updater.wobble.js +15 -10
- package/tsparticles.updater.wobble.min.js +1 -1
- package/umd/Core/Canvas.d.ts +1 -1
- package/umd/Core/Canvas.js +16 -7
- package/umd/Core/Particles.js +2 -3
- package/umd/Plugins/Emitters/Options/Classes/Emitter.js +2 -2
package/tsparticles.engine.js
CHANGED
|
@@ -2515,9 +2515,9 @@
|
|
|
2515
2515
|
paint() {
|
|
2516
2516
|
const options = this.container.actualOptions;
|
|
2517
2517
|
this.draw((ctx => {
|
|
2518
|
-
if (options.backgroundMask.enable && options.backgroundMask.cover
|
|
2518
|
+
if (options.backgroundMask.enable && options.backgroundMask.cover) {
|
|
2519
2519
|
clear(ctx, this.size);
|
|
2520
|
-
this.paintBase(
|
|
2520
|
+
this.paintBase(this.coverColorStyle);
|
|
2521
2521
|
} else {
|
|
2522
2522
|
this.paintBase();
|
|
2523
2523
|
}
|
|
@@ -2560,11 +2560,16 @@
|
|
|
2560
2560
|
const container = this.container;
|
|
2561
2561
|
const pxRatio = container.retina.pixelRatio;
|
|
2562
2562
|
const size = container.canvas.size;
|
|
2563
|
+
const newSize = {
|
|
2564
|
+
width: this.element.offsetWidth * pxRatio,
|
|
2565
|
+
height: this.element.offsetHeight * pxRatio
|
|
2566
|
+
};
|
|
2567
|
+
if (newSize.height === size.height && newSize.width === size.width && newSize.height === this.element.height && newSize.width === this.element.width) {
|
|
2568
|
+
return;
|
|
2569
|
+
}
|
|
2563
2570
|
const oldSize = Object.assign({}, size);
|
|
2564
|
-
size.width = this.element.offsetWidth * pxRatio;
|
|
2565
|
-
size.height = this.element.offsetHeight * pxRatio;
|
|
2566
|
-
this.element.width = size.width;
|
|
2567
|
-
this.element.height = size.height;
|
|
2571
|
+
this.element.width = size.width = this.element.offsetWidth * pxRatio;
|
|
2572
|
+
this.element.height = size.height = this.element.offsetHeight * pxRatio;
|
|
2568
2573
|
if (this.container.started) {
|
|
2569
2574
|
this.resizeFactor = {
|
|
2570
2575
|
width: size.width / oldSize.width,
|
|
@@ -2688,12 +2693,13 @@
|
|
|
2688
2693
|
const color = cover.color;
|
|
2689
2694
|
const coverRgb = colorToRgb(color);
|
|
2690
2695
|
if (coverRgb) {
|
|
2691
|
-
|
|
2696
|
+
const coverColor = {
|
|
2692
2697
|
r: coverRgb.r,
|
|
2693
2698
|
g: coverRgb.g,
|
|
2694
2699
|
b: coverRgb.b,
|
|
2695
2700
|
a: cover.opacity
|
|
2696
2701
|
};
|
|
2702
|
+
this.coverColorStyle = getStyleFromRgb(coverColor, coverColor.a);
|
|
2697
2703
|
}
|
|
2698
2704
|
}
|
|
2699
2705
|
initTrail() {
|
|
@@ -5902,9 +5908,7 @@
|
|
|
5902
5908
|
delete container.canvas.resizeFactor;
|
|
5903
5909
|
}
|
|
5904
5910
|
async draw(delta) {
|
|
5905
|
-
const container = this.container;
|
|
5906
|
-
container.canvas.clear();
|
|
5907
|
-
const canvasSize = this.container.canvas.size;
|
|
5911
|
+
const container = this.container, canvasSize = this.container.canvas.size;
|
|
5908
5912
|
this.quadTree = new QuadTree(new Rectangle(-canvasSize.width / 4, -canvasSize.height / 4, canvasSize.width * 3 / 2, canvasSize.height * 3 / 2), 4);
|
|
5909
5913
|
await this.update(delta);
|
|
5910
5914
|
if (this.needsSort) {
|
|
@@ -5912,6 +5916,7 @@
|
|
|
5912
5916
|
this.lastZIndex = this.zArray[this.zArray.length - 1].position.z;
|
|
5913
5917
|
this.needsSort = false;
|
|
5914
5918
|
}
|
|
5919
|
+
container.canvas.clear();
|
|
5915
5920
|
for (const [, plugin] of container.plugins) {
|
|
5916
5921
|
container.canvas.drawPlugin(plugin, delta);
|
|
5917
5922
|
}
|