@tsparticles/plugin-polygon-mask 4.0.0-alpha.2 → 4.0.0-alpha.21
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/185.min.js +1 -0
- package/459.min.js +2 -0
- package/browser/Options/Classes/PolygonMask.js +9 -0
- package/browser/Options/Classes/PolygonMaskDraw.js +2 -0
- package/browser/Options/Classes/PolygonMaskDrawStroke.js +4 -0
- package/browser/Options/Classes/PolygonMaskInline.js +1 -0
- package/browser/Options/Classes/PolygonMaskLocalSvg.js +2 -0
- package/browser/Options/Classes/PolygonMaskMove.js +2 -0
- package/browser/PolygonMaskInstance.js +313 -308
- package/browser/PolygonMaskPlugin.js +6 -5
- package/browser/index.js +3 -3
- package/browser/pathseg.js +5 -15
- package/browser/utils.js +4 -2
- package/cjs/Options/Classes/PolygonMask.js +9 -0
- package/cjs/Options/Classes/PolygonMaskDraw.js +2 -0
- package/cjs/Options/Classes/PolygonMaskDrawStroke.js +4 -0
- package/cjs/Options/Classes/PolygonMaskInline.js +1 -0
- package/cjs/Options/Classes/PolygonMaskLocalSvg.js +2 -0
- package/cjs/Options/Classes/PolygonMaskMove.js +2 -0
- package/cjs/PolygonMaskInstance.js +313 -308
- package/cjs/PolygonMaskPlugin.js +6 -5
- package/cjs/index.js +3 -3
- package/cjs/pathseg.js +5 -15
- package/cjs/utils.js +4 -2
- package/dist_browser_PolygonMaskInstance_js.js +50 -0
- package/dist_browser_PolygonMaskPlugin_js.js +8 -38
- package/esm/Options/Classes/PolygonMask.js +9 -0
- package/esm/Options/Classes/PolygonMaskDraw.js +2 -0
- package/esm/Options/Classes/PolygonMaskDrawStroke.js +4 -0
- package/esm/Options/Classes/PolygonMaskInline.js +1 -0
- package/esm/Options/Classes/PolygonMaskLocalSvg.js +2 -0
- package/esm/Options/Classes/PolygonMaskMove.js +2 -0
- package/esm/PolygonMaskInstance.js +313 -308
- package/esm/PolygonMaskPlugin.js +6 -5
- package/esm/index.js +3 -3
- package/esm/pathseg.js +5 -15
- package/esm/utils.js +4 -2
- package/package.json +2 -2
- package/report.html +3 -3
- package/tsparticles.plugin.polygon-mask.js +15 -15
- package/tsparticles.plugin.polygon-mask.min.js +2 -2
- package/types/PolygonMaskPlugin.d.ts +4 -5
- package/types/index.d.ts +1 -1
- package/umd/Options/Classes/PolygonMask.js +9 -0
- package/umd/Options/Classes/PolygonMaskDraw.js +2 -0
- package/umd/Options/Classes/PolygonMaskDrawStroke.js +4 -0
- package/umd/Options/Classes/PolygonMaskInline.js +1 -0
- package/umd/Options/Classes/PolygonMaskLocalSvg.js +2 -0
- package/umd/Options/Classes/PolygonMaskMove.js +2 -0
- package/umd/PolygonMaskInstance.js +312 -307
- package/umd/PolygonMaskPlugin.js +41 -6
- package/umd/index.js +3 -3
- package/umd/pathseg.js +5 -15
- package/umd/utils.js +4 -2
- package/409.min.js +0 -2
- package/409.min.js.LICENSE.txt +0 -1
- package/tsparticles.plugin.polygon-mask.min.js.LICENSE.txt +0 -1
package/esm/pathseg.js
CHANGED
|
@@ -1166,11 +1166,7 @@
|
|
|
1166
1166
|
Source.prototype._isCurrentSpace = function () {
|
|
1167
1167
|
const character = this._string[this._currentIndex];
|
|
1168
1168
|
return (character <= " " &&
|
|
1169
|
-
(character == " " ||
|
|
1170
|
-
character == "\n" ||
|
|
1171
|
-
character == "\t" ||
|
|
1172
|
-
character == "\r" ||
|
|
1173
|
-
character == "\f"));
|
|
1169
|
+
(character == " " || character == "\n" || character == "\t" || character == "\r" || character == "\f"));
|
|
1174
1170
|
};
|
|
1175
1171
|
Source.prototype._skipOptionalSpaces = function () {
|
|
1176
1172
|
while (this._currentIndex < this._endIndex && this._isCurrentSpace())
|
|
@@ -1243,10 +1239,7 @@
|
|
|
1243
1239
|
}
|
|
1244
1240
|
};
|
|
1245
1241
|
Source.prototype._nextCommandHelper = function (lookahead, previousCommand) {
|
|
1246
|
-
if ((lookahead == "+" ||
|
|
1247
|
-
lookahead == "-" ||
|
|
1248
|
-
lookahead == "." ||
|
|
1249
|
-
(lookahead >= "0" && lookahead <= "9")) &&
|
|
1242
|
+
if ((lookahead == "+" || lookahead == "-" || lookahead == "." || (lookahead >= "0" && lookahead <= "9")) &&
|
|
1250
1243
|
previousCommand != window.SVGPathSeg.PATHSEG_CLOSEPATH) {
|
|
1251
1244
|
if (previousCommand == window.SVGPathSeg.PATHSEG_MOVETO_ABS)
|
|
1252
1245
|
return window.SVGPathSeg.PATHSEG_LINETO_ABS;
|
|
@@ -1260,8 +1253,7 @@
|
|
|
1260
1253
|
if (!this.hasMoreData())
|
|
1261
1254
|
return true;
|
|
1262
1255
|
const command = this.peekSegmentType();
|
|
1263
|
-
return
|
|
1264
|
-
command == window.SVGPathSeg.PATHSEG_MOVETO_REL);
|
|
1256
|
+
return command == window.SVGPathSeg.PATHSEG_MOVETO_ABS || command == window.SVGPathSeg.PATHSEG_MOVETO_REL;
|
|
1265
1257
|
};
|
|
1266
1258
|
Source.prototype._parseNumber = function () {
|
|
1267
1259
|
let exponent = 0;
|
|
@@ -1279,8 +1271,7 @@
|
|
|
1279
1271
|
sign = -1;
|
|
1280
1272
|
}
|
|
1281
1273
|
if (this._currentIndex == this._endIndex ||
|
|
1282
|
-
((this._string.charAt(this._currentIndex) < "0" ||
|
|
1283
|
-
this._string.charAt(this._currentIndex) > "9") &&
|
|
1274
|
+
((this._string.charAt(this._currentIndex) < "0" || this._string.charAt(this._currentIndex) > "9") &&
|
|
1284
1275
|
this._string.charAt(this._currentIndex) != "."))
|
|
1285
1276
|
return undefined;
|
|
1286
1277
|
const startIntPartIndex = this._currentIndex;
|
|
@@ -1312,8 +1303,7 @@
|
|
|
1312
1303
|
}
|
|
1313
1304
|
if (this._currentIndex != startIndex &&
|
|
1314
1305
|
this._currentIndex + 1 < this._endIndex &&
|
|
1315
|
-
(this._string.charAt(this._currentIndex) == "e" ||
|
|
1316
|
-
this._string.charAt(this._currentIndex) == "E") &&
|
|
1306
|
+
(this._string.charAt(this._currentIndex) == "e" || this._string.charAt(this._currentIndex) == "E") &&
|
|
1317
1307
|
this._string.charAt(this._currentIndex + 1) != "x" &&
|
|
1318
1308
|
this._string.charAt(this._currentIndex + 1) != "m") {
|
|
1319
1309
|
this._currentIndex++;
|
package/esm/utils.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Vector, getDistances, getStyleFromRgb, rangeColorToRgb, } from "@tsparticles/engine";
|
|
1
|
+
import { Vector, double, getDistances, getStyleFromRgb, rangeColorToRgb, } from "@tsparticles/engine";
|
|
2
2
|
const squareExp = 2, inSegmentRange = {
|
|
3
3
|
min: 0,
|
|
4
4
|
max: 1,
|
|
5
|
-
}
|
|
5
|
+
};
|
|
6
6
|
export function drawPolygonMask(engine, context, rawData, stroke, hdr = false) {
|
|
7
7
|
const color = rangeColorToRgb(engine, stroke.color);
|
|
8
8
|
if (!color) {
|
|
@@ -88,6 +88,8 @@ export function parsePaths(paths, scale, offset) {
|
|
|
88
88
|
case svgPathSeg.PATHSEG_UNKNOWN:
|
|
89
89
|
case svgPathSeg.PATHSEG_CLOSEPATH:
|
|
90
90
|
continue;
|
|
91
|
+
default:
|
|
92
|
+
continue;
|
|
91
93
|
}
|
|
92
94
|
res.push({
|
|
93
95
|
x: p.x * scale + offset.x,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsparticles/plugin-polygon-mask",
|
|
3
|
-
"version": "4.0.0-alpha.
|
|
3
|
+
"version": "4.0.0-alpha.21",
|
|
4
4
|
"description": "tsParticles polygon mask plugin",
|
|
5
5
|
"homepage": "https://particles.js.org",
|
|
6
6
|
"repository": {
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
"./package.json": "./package.json"
|
|
89
89
|
},
|
|
90
90
|
"dependencies": {
|
|
91
|
-
"@tsparticles/engine": "4.0.0-alpha.
|
|
91
|
+
"@tsparticles/engine": "4.0.0-alpha.21"
|
|
92
92
|
},
|
|
93
93
|
"publishConfig": {
|
|
94
94
|
"access": "public"
|