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.
- package/Core/Canvas.js +12 -5
- package/Core/Particles.js +2 -3
- package/browser/Core/Canvas.js +12 -5
- package/browser/Core/Particles.js +3 -4
- package/esm/Core/Canvas.js +12 -5
- package/esm/Core/Particles.js +2 -3
- package/package.json +1 -1
- package/report.html +2 -2
- package/report.slim.html +2 -2
- package/tsparticles.engine.js +11 -8
- package/tsparticles.engine.min.js +2 -2
- package/tsparticles.interaction.external.attract.js +11 -8
- package/tsparticles.interaction.external.attract.min.js +1 -1
- package/tsparticles.interaction.external.bounce.js +11 -8
- package/tsparticles.interaction.external.bounce.min.js +1 -1
- package/tsparticles.interaction.external.bubble.js +11 -8
- package/tsparticles.interaction.external.bubble.min.js +1 -1
- package/tsparticles.interaction.external.connect.js +11 -8
- package/tsparticles.interaction.external.connect.min.js +1 -1
- package/tsparticles.interaction.external.grab.js +11 -8
- package/tsparticles.interaction.external.grab.min.js +1 -1
- package/tsparticles.interaction.external.repulse.js +11 -8
- package/tsparticles.interaction.external.repulse.min.js +1 -1
- package/tsparticles.interaction.external.trail.js +11 -8
- package/tsparticles.interaction.external.trail.min.js +1 -1
- package/tsparticles.interaction.particles.attract.js +11 -8
- package/tsparticles.interaction.particles.attract.min.js +1 -1
- package/tsparticles.interaction.particles.collisions.js +11 -8
- package/tsparticles.interaction.particles.collisions.min.js +1 -1
- package/tsparticles.interaction.particles.links.js +11 -8
- package/tsparticles.interaction.particles.links.min.js +1 -1
- package/tsparticles.js +11 -8
- package/tsparticles.min.js +2 -2
- package/tsparticles.pathseg.min.js +1 -1
- package/tsparticles.plugins.absorbers.js +11 -8
- package/tsparticles.plugins.absorbers.min.js +1 -1
- package/tsparticles.plugins.emitters.js +11 -8
- package/tsparticles.plugins.emitters.min.js +1 -1
- package/tsparticles.plugins.polygonMask.js +11 -8
- package/tsparticles.plugins.polygonMask.min.js +1 -1
- package/tsparticles.shape.circle.min.js +1 -1
- package/tsparticles.shape.image.js +11 -8
- 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 +11 -8
- package/tsparticles.shape.text.min.js +1 -1
- package/tsparticles.slim.js +11 -8
- package/tsparticles.slim.min.js +2 -2
- package/tsparticles.updater.angle.js +11 -8
- package/tsparticles.updater.angle.min.js +1 -1
- package/tsparticles.updater.color.js +11 -8
- package/tsparticles.updater.color.min.js +1 -1
- package/tsparticles.updater.life.js +11 -8
- package/tsparticles.updater.life.min.js +1 -1
- package/tsparticles.updater.opacity.js +11 -8
- package/tsparticles.updater.opacity.min.js +1 -1
- package/tsparticles.updater.outModes.js +11 -8
- package/tsparticles.updater.outModes.min.js +1 -1
- package/tsparticles.updater.roll.js +11 -8
- package/tsparticles.updater.roll.min.js +1 -1
- package/tsparticles.updater.size.js +11 -8
- package/tsparticles.updater.size.min.js +1 -1
- package/tsparticles.updater.strokeColor.js +11 -8
- package/tsparticles.updater.strokeColor.min.js +1 -1
- package/tsparticles.updater.tilt.js +11 -8
- package/tsparticles.updater.tilt.min.js +1 -1
- package/tsparticles.updater.wobble.js +11 -8
- package/tsparticles.updater.wobble.min.js +1 -1
- package/umd/Core/Canvas.js +12 -5
- package/umd/Core/Particles.js +2 -3
package/umd/Core/Canvas.js
CHANGED
|
@@ -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() {
|
package/umd/Core/Particles.js
CHANGED
|
@@ -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
|
}
|