tsparticles 1.42.2 → 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.
Files changed (73) hide show
  1. package/Core/Canvas.js +12 -5
  2. package/Core/Particles.js +2 -3
  3. package/browser/Core/Canvas.js +12 -5
  4. package/browser/Core/Particles.js +3 -4
  5. package/esm/Core/Canvas.js +12 -5
  6. package/esm/Core/Particles.js +2 -3
  7. package/package.json +1 -1
  8. package/report.html +2 -2
  9. package/report.slim.html +2 -2
  10. package/tsparticles.engine.js +11 -8
  11. package/tsparticles.engine.min.js +2 -2
  12. package/tsparticles.interaction.external.attract.js +11 -8
  13. package/tsparticles.interaction.external.attract.min.js +1 -1
  14. package/tsparticles.interaction.external.bounce.js +11 -8
  15. package/tsparticles.interaction.external.bounce.min.js +1 -1
  16. package/tsparticles.interaction.external.bubble.js +11 -8
  17. package/tsparticles.interaction.external.bubble.min.js +1 -1
  18. package/tsparticles.interaction.external.connect.js +11 -8
  19. package/tsparticles.interaction.external.connect.min.js +1 -1
  20. package/tsparticles.interaction.external.grab.js +11 -8
  21. package/tsparticles.interaction.external.grab.min.js +1 -1
  22. package/tsparticles.interaction.external.repulse.js +11 -8
  23. package/tsparticles.interaction.external.repulse.min.js +1 -1
  24. package/tsparticles.interaction.external.trail.js +11 -8
  25. package/tsparticles.interaction.external.trail.min.js +1 -1
  26. package/tsparticles.interaction.particles.attract.js +11 -8
  27. package/tsparticles.interaction.particles.attract.min.js +1 -1
  28. package/tsparticles.interaction.particles.collisions.js +11 -8
  29. package/tsparticles.interaction.particles.collisions.min.js +1 -1
  30. package/tsparticles.interaction.particles.links.js +11 -8
  31. package/tsparticles.interaction.particles.links.min.js +1 -1
  32. package/tsparticles.js +11 -8
  33. package/tsparticles.min.js +2 -2
  34. package/tsparticles.pathseg.min.js +1 -1
  35. package/tsparticles.plugins.absorbers.js +11 -8
  36. package/tsparticles.plugins.absorbers.min.js +1 -1
  37. package/tsparticles.plugins.emitters.js +11 -8
  38. package/tsparticles.plugins.emitters.min.js +1 -1
  39. package/tsparticles.plugins.polygonMask.js +11 -8
  40. package/tsparticles.plugins.polygonMask.min.js +1 -1
  41. package/tsparticles.shape.circle.min.js +1 -1
  42. package/tsparticles.shape.image.js +11 -8
  43. package/tsparticles.shape.image.min.js +1 -1
  44. package/tsparticles.shape.line.min.js +1 -1
  45. package/tsparticles.shape.polygon.min.js +1 -1
  46. package/tsparticles.shape.square.min.js +1 -1
  47. package/tsparticles.shape.star.min.js +1 -1
  48. package/tsparticles.shape.text.js +11 -8
  49. package/tsparticles.shape.text.min.js +1 -1
  50. package/tsparticles.slim.js +11 -8
  51. package/tsparticles.slim.min.js +2 -2
  52. package/tsparticles.updater.angle.js +11 -8
  53. package/tsparticles.updater.angle.min.js +1 -1
  54. package/tsparticles.updater.color.js +11 -8
  55. package/tsparticles.updater.color.min.js +1 -1
  56. package/tsparticles.updater.life.js +11 -8
  57. package/tsparticles.updater.life.min.js +1 -1
  58. package/tsparticles.updater.opacity.js +11 -8
  59. package/tsparticles.updater.opacity.min.js +1 -1
  60. package/tsparticles.updater.outModes.js +11 -8
  61. package/tsparticles.updater.outModes.min.js +1 -1
  62. package/tsparticles.updater.roll.js +11 -8
  63. package/tsparticles.updater.roll.min.js +1 -1
  64. package/tsparticles.updater.size.js +11 -8
  65. package/tsparticles.updater.size.min.js +1 -1
  66. package/tsparticles.updater.strokeColor.js +11 -8
  67. package/tsparticles.updater.strokeColor.min.js +1 -1
  68. package/tsparticles.updater.tilt.js +11 -8
  69. package/tsparticles.updater.tilt.min.js +1 -1
  70. package/tsparticles.updater.wobble.js +11 -8
  71. package/tsparticles.updater.wobble.min.js +1 -1
  72. package/umd/Core/Canvas.js +12 -5
  73. package/umd/Core/Particles.js +2 -3
@@ -107,11 +107,19 @@
107
107
  const container = this.container;
108
108
  const pxRatio = container.retina.pixelRatio;
109
109
  const size = container.canvas.size;
110
+ const newSize = {
111
+ width: this.element.offsetWidth * pxRatio,
112
+ height: this.element.offsetHeight * pxRatio,
113
+ };
114
+ if (newSize.height === size.height &&
115
+ newSize.width === size.width &&
116
+ newSize.height === this.element.height &&
117
+ newSize.width === this.element.width) {
118
+ return;
119
+ }
110
120
  const oldSize = Object.assign({}, size);
111
- size.width = this.element.offsetWidth * pxRatio;
112
- size.height = this.element.offsetHeight * pxRatio;
113
- this.element.width = size.width;
114
- this.element.height = size.height;
121
+ this.element.width = size.width = this.element.offsetWidth * pxRatio;
122
+ this.element.height = size.height = this.element.offsetHeight * pxRatio;
115
123
  if (this.container.started) {
116
124
  this.resizeFactor = {
117
125
  width: size.width / oldSize.width,
@@ -245,7 +253,6 @@
245
253
  a: cover.opacity,
246
254
  };
247
255
  this.coverColorStyle = (0, Utils_1.getStyleFromRgb)(coverColor, coverColor.a);
248
- console.log(this.coverColorStyle);
249
256
  }
250
257
  }
251
258
  initTrail() {
@@ -156,9 +156,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
156
156
  delete container.canvas.resizeFactor;
157
157
  }
158
158
  async draw(delta) {
159
- const container = this.container;
160
- container.canvas.clear();
161
- const canvasSize = this.container.canvas.size;
159
+ const container = this.container, canvasSize = this.container.canvas.size;
162
160
  this.quadTree = new Utils_1.QuadTree(new Utils_1.Rectangle(-canvasSize.width / 4, -canvasSize.height / 4, (canvasSize.width * 3) / 2, (canvasSize.height * 3) / 2), 4);
163
161
  await this.update(delta);
164
162
  if (this.needsSort) {
@@ -166,6 +164,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
166
164
  this.lastZIndex = this.zArray[this.zArray.length - 1].position.z;
167
165
  this.needsSort = false;
168
166
  }
167
+ container.canvas.clear();
169
168
  for (const [, plugin] of container.plugins) {
170
169
  container.canvas.drawPlugin(plugin, delta);
171
170
  }