@tsparticles/shape-image 3.0.0-beta.3 → 3.0.0-beta.4
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/browser/ImageDrawer.js +13 -5
- package/cjs/ImageDrawer.js +13 -5
- package/esm/ImageDrawer.js +13 -5
- package/package.json +3 -3
- package/report.html +4 -22
- package/tsparticles.shape.image.js +15 -9
- package/tsparticles.shape.image.min.js +1 -1
- package/tsparticles.shape.image.min.js.LICENSE.txt +1 -1
- package/umd/ImageDrawer.js +13 -5
package/browser/ImageDrawer.js
CHANGED
|
@@ -124,7 +124,11 @@ export class ImageDrawer {
|
|
|
124
124
|
if (!this._engine.images) {
|
|
125
125
|
this._engine.images = [];
|
|
126
126
|
}
|
|
127
|
-
const imageData = particle.shapeData
|
|
127
|
+
const imageData = particle.shapeData;
|
|
128
|
+
if (!imageData) {
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
const image = this._engine.images.find((t) => t.name === imageData.name || t.source === imageData.src);
|
|
128
132
|
if (!image) {
|
|
129
133
|
this.loadImageShape(imageData).then(() => {
|
|
130
134
|
this.loadShape(particle);
|
|
@@ -138,7 +142,11 @@ export class ImageDrawer {
|
|
|
138
142
|
if (!this._engine.images) {
|
|
139
143
|
this._engine.images = [];
|
|
140
144
|
}
|
|
141
|
-
const images = this._engine.images, imageData = particle.shapeData
|
|
145
|
+
const images = this._engine.images, imageData = particle.shapeData;
|
|
146
|
+
if (!imageData) {
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
const color = particle.getFillColor(), image = images.find((t) => t.name === imageData.name || t.source === imageData.src);
|
|
142
150
|
if (!image) {
|
|
143
151
|
return;
|
|
144
152
|
}
|
|
@@ -171,14 +179,14 @@ export class ImageDrawer {
|
|
|
171
179
|
if (!imageRes.ratio) {
|
|
172
180
|
imageRes.ratio = 1;
|
|
173
181
|
}
|
|
174
|
-
const fill = imageData.fill ?? particle.
|
|
182
|
+
const fill = imageData.fill ?? particle.shapeFill, close = imageData.close ?? particle.shapeClose, imageShape = {
|
|
175
183
|
image: imageRes,
|
|
176
184
|
fill,
|
|
177
185
|
close,
|
|
178
186
|
};
|
|
179
187
|
particle.image = imageShape.image;
|
|
180
|
-
particle.
|
|
181
|
-
particle.
|
|
188
|
+
particle.shapeFill = imageShape.fill;
|
|
189
|
+
particle.shapeClose = imageShape.close;
|
|
182
190
|
})();
|
|
183
191
|
}
|
|
184
192
|
}
|
package/cjs/ImageDrawer.js
CHANGED
|
@@ -127,7 +127,11 @@ class ImageDrawer {
|
|
|
127
127
|
if (!this._engine.images) {
|
|
128
128
|
this._engine.images = [];
|
|
129
129
|
}
|
|
130
|
-
const imageData = particle.shapeData
|
|
130
|
+
const imageData = particle.shapeData;
|
|
131
|
+
if (!imageData) {
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
const image = this._engine.images.find((t) => t.name === imageData.name || t.source === imageData.src);
|
|
131
135
|
if (!image) {
|
|
132
136
|
this.loadImageShape(imageData).then(() => {
|
|
133
137
|
this.loadShape(particle);
|
|
@@ -141,7 +145,11 @@ class ImageDrawer {
|
|
|
141
145
|
if (!this._engine.images) {
|
|
142
146
|
this._engine.images = [];
|
|
143
147
|
}
|
|
144
|
-
const images = this._engine.images, imageData = particle.shapeData
|
|
148
|
+
const images = this._engine.images, imageData = particle.shapeData;
|
|
149
|
+
if (!imageData) {
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
const color = particle.getFillColor(), image = images.find((t) => t.name === imageData.name || t.source === imageData.src);
|
|
145
153
|
if (!image) {
|
|
146
154
|
return;
|
|
147
155
|
}
|
|
@@ -174,14 +182,14 @@ class ImageDrawer {
|
|
|
174
182
|
if (!imageRes.ratio) {
|
|
175
183
|
imageRes.ratio = 1;
|
|
176
184
|
}
|
|
177
|
-
const fill = imageData.fill ?? particle.
|
|
185
|
+
const fill = imageData.fill ?? particle.shapeFill, close = imageData.close ?? particle.shapeClose, imageShape = {
|
|
178
186
|
image: imageRes,
|
|
179
187
|
fill,
|
|
180
188
|
close,
|
|
181
189
|
};
|
|
182
190
|
particle.image = imageShape.image;
|
|
183
|
-
particle.
|
|
184
|
-
particle.
|
|
191
|
+
particle.shapeFill = imageShape.fill;
|
|
192
|
+
particle.shapeClose = imageShape.close;
|
|
185
193
|
})();
|
|
186
194
|
}
|
|
187
195
|
}
|
package/esm/ImageDrawer.js
CHANGED
|
@@ -124,7 +124,11 @@ export class ImageDrawer {
|
|
|
124
124
|
if (!this._engine.images) {
|
|
125
125
|
this._engine.images = [];
|
|
126
126
|
}
|
|
127
|
-
const imageData = particle.shapeData
|
|
127
|
+
const imageData = particle.shapeData;
|
|
128
|
+
if (!imageData) {
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
const image = this._engine.images.find((t) => t.name === imageData.name || t.source === imageData.src);
|
|
128
132
|
if (!image) {
|
|
129
133
|
this.loadImageShape(imageData).then(() => {
|
|
130
134
|
this.loadShape(particle);
|
|
@@ -138,7 +142,11 @@ export class ImageDrawer {
|
|
|
138
142
|
if (!this._engine.images) {
|
|
139
143
|
this._engine.images = [];
|
|
140
144
|
}
|
|
141
|
-
const images = this._engine.images, imageData = particle.shapeData
|
|
145
|
+
const images = this._engine.images, imageData = particle.shapeData;
|
|
146
|
+
if (!imageData) {
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
const color = particle.getFillColor(), image = images.find((t) => t.name === imageData.name || t.source === imageData.src);
|
|
142
150
|
if (!image) {
|
|
143
151
|
return;
|
|
144
152
|
}
|
|
@@ -171,14 +179,14 @@ export class ImageDrawer {
|
|
|
171
179
|
if (!imageRes.ratio) {
|
|
172
180
|
imageRes.ratio = 1;
|
|
173
181
|
}
|
|
174
|
-
const fill = imageData.fill ?? particle.
|
|
182
|
+
const fill = imageData.fill ?? particle.shapeFill, close = imageData.close ?? particle.shapeClose, imageShape = {
|
|
175
183
|
image: imageRes,
|
|
176
184
|
fill,
|
|
177
185
|
close,
|
|
178
186
|
};
|
|
179
187
|
particle.image = imageShape.image;
|
|
180
|
-
particle.
|
|
181
|
-
particle.
|
|
188
|
+
particle.shapeFill = imageShape.fill;
|
|
189
|
+
particle.shapeClose = imageShape.close;
|
|
182
190
|
})();
|
|
183
191
|
}
|
|
184
192
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsparticles/shape-image",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.4",
|
|
4
4
|
"description": "tsParticles image shape",
|
|
5
5
|
"homepage": "https://particles.js.org",
|
|
6
6
|
"repository": {
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"css3",
|
|
34
34
|
"animated",
|
|
35
35
|
"background",
|
|
36
|
-
"
|
|
36
|
+
"tsparticles-shape"
|
|
37
37
|
],
|
|
38
38
|
"author": "Matteo Bruni <matteo.bruni@me.com>",
|
|
39
39
|
"license": "MIT",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"./package.json": "./package.json"
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
|
-
"@tsparticles/engine": "^3.0.0-beta.
|
|
62
|
+
"@tsparticles/engine": "^3.0.0-beta.4"
|
|
63
63
|
},
|
|
64
64
|
"publishConfig": {
|
|
65
65
|
"access": "public"
|