tsparticles 2.0.1 → 2.0.2

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.
@@ -4,7 +4,7 @@
4
4
  * Demo / Generator : https://particles.js.org/
5
5
  * GitHub : https://www.github.com/matteobruni/tsparticles
6
6
  * How to use? : Check the GitHub README
7
- * v2.0.1
7
+ * v2.0.2
8
8
  */
9
9
  (function webpackUniversalModuleDefinition(root, factory) {
10
10
  if(typeof exports === 'object' && typeof module === 'object')
@@ -7165,12 +7165,14 @@ class Particle {
7165
7165
  }
7166
7166
 
7167
7167
  getFillColor() {
7168
- var _a, _b, _c;
7168
+ var _a, _b;
7169
7169
 
7170
7170
  const color = (_a = this.bubble.color) !== null && _a !== void 0 ? _a : getHslFromAnimation(this.color);
7171
7171
 
7172
7172
  if (color && this.roll && (this.backColor || this.roll.alter)) {
7173
- const rolled = Math.floor(((_c = (_b = this.roll) === null || _b === void 0 ? void 0 : _b.angle) !== null && _c !== void 0 ? _c : 0) / (Math.PI / 2)) % 2;
7173
+ const backFactor = this.options.roll.mode === "both" ? 2 : 1,
7174
+ backSum = this.options.roll.mode === "horizontal" ? Math.PI / 2 : 0,
7175
+ rolled = Math.floor((((_b = this.roll.angle) !== null && _b !== void 0 ? _b : 0) + backSum) / (Math.PI / backFactor)) % 2;
7174
7176
 
7175
7177
  if (rolled) {
7176
7178
  if (this.backColor) {
@@ -14245,7 +14247,7 @@ function updateOpacity(particle, delta) {
14245
14247
  const minValue = particle.opacity.min;
14246
14248
  const maxValue = particle.opacity.max;
14247
14249
 
14248
- if (!(!particle.destroyed && particle.opacity.enable && (((_a = particle.opacity.maxLoops) !== null && _a !== void 0 ? _a : 0) <= 0 || ((_b = particle.opacity.loops) !== null && _b !== void 0 ? _b : 0) < ((_c = particle.opacity.maxLoops) !== null && _c !== void 0 ? _c : 0)))) {
14250
+ if (particle.destroyed || !particle.opacity.enable || ((_a = particle.opacity.maxLoops) !== null && _a !== void 0 ? _a : 0) > 0 && ((_b = particle.opacity.loops) !== null && _b !== void 0 ? _b : 0) > ((_c = particle.opacity.maxLoops) !== null && _c !== void 0 ? _c : 0)) {
14249
14251
  return;
14250
14252
  }
14251
14253
 
@@ -14338,9 +14340,9 @@ class OpacityUpdater {
14338
14340
  }
14339
14341
 
14340
14342
  isEnabled(particle) {
14341
- var _a, _b, _c;
14343
+ var _a, _b, _c, _d;
14342
14344
 
14343
- return !particle.destroyed && !particle.spawning && !!particle.opacity && particle.opacity.enable && (((_a = particle.opacity.maxLoops) !== null && _a !== void 0 ? _a : 0) <= 0 || ((_b = particle.opacity.loops) !== null && _b !== void 0 ? _b : 0) < ((_c = particle.opacity.maxLoops) !== null && _c !== void 0 ? _c : 0));
14345
+ return !particle.destroyed && !particle.spawning && !!particle.opacity && particle.opacity.enable && (((_a = particle.opacity.maxLoops) !== null && _a !== void 0 ? _a : 0) <= 0 || ((_b = particle.opacity.maxLoops) !== null && _b !== void 0 ? _b : 0) > 0 && ((_c = particle.opacity.loops) !== null && _c !== void 0 ? _c : 0) < ((_d = particle.opacity.maxLoops) !== null && _d !== void 0 ? _d : 0));
14344
14346
  }
14345
14347
 
14346
14348
  update(particle, delta) {
@@ -15899,7 +15901,7 @@ function updateSize(particle, delta) {
15899
15901
  const minValue = particle.size.min;
15900
15902
  const maxValue = particle.size.max;
15901
15903
 
15902
- if (!(!particle.destroyed && particle.size.enable && (((_b = particle.size.loops) !== null && _b !== void 0 ? _b : 0) <= 0 || ((_c = particle.size.loops) !== null && _c !== void 0 ? _c : 0) < ((_d = particle.size.maxLoops) !== null && _d !== void 0 ? _d : 0)))) {
15904
+ if (particle.destroyed || !particle.size.enable || ((_b = particle.size.maxLoops) !== null && _b !== void 0 ? _b : 0) > 0 && ((_c = particle.size.loops) !== null && _c !== void 0 ? _c : 0) > ((_d = particle.size.maxLoops) !== null && _d !== void 0 ? _d : 0)) {
15903
15905
  return;
15904
15906
  }
15905
15907
 
@@ -15945,9 +15947,9 @@ class SizeUpdater {
15945
15947
  init() {}
15946
15948
 
15947
15949
  isEnabled(particle) {
15948
- var _a, _b, _c;
15950
+ var _a, _b, _c, _d;
15949
15951
 
15950
- return !particle.destroyed && !particle.spawning && particle.size.enable && (((_a = particle.size.loops) !== null && _a !== void 0 ? _a : 0) <= 0 || ((_b = particle.size.loops) !== null && _b !== void 0 ? _b : 0) < ((_c = particle.size.maxLoops) !== null && _c !== void 0 ? _c : 0));
15952
+ return !particle.destroyed && !particle.spawning && particle.size.enable && (((_a = particle.size.maxLoops) !== null && _a !== void 0 ? _a : 0) <= 0 || ((_b = particle.size.maxLoops) !== null && _b !== void 0 ? _b : 0) > 0 && ((_c = particle.size.loops) !== null && _c !== void 0 ? _c : 0) < ((_d = particle.size.maxLoops) !== null && _d !== void 0 ? _d : 0));
15951
15953
  }
15952
15954
 
15953
15955
  update(particle, delta) {