@tsparticles/shape-line 3.0.0-alpha.0 → 3.0.0-beta.0
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/README.md +16 -12
- package/browser/LineDrawer.js +2 -0
- package/browser/index.js +2 -2
- package/cjs/LineDrawer.js +2 -0
- package/cjs/index.js +2 -13
- package/esm/LineDrawer.js +2 -0
- package/esm/index.js +2 -2
- package/package.json +6 -5
- package/report.html +4 -4
- package/tsparticles.shape.line.js +6 -4
- package/tsparticles.shape.line.min.js +1 -1
- package/tsparticles.shape.line.min.js.LICENSE.txt +1 -8
- package/types/index.d.ts +1 -1
- package/umd/LineDrawer.js +2 -0
- package/umd/index.js +2 -2
|
@@ -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
|
-
* v3.0.0-
|
|
7
|
+
* v3.0.0-beta.0
|
|
8
8
|
*/
|
|
9
9
|
(function webpackUniversalModuleDefinition(root, factory) {
|
|
10
10
|
if(typeof exports === 'object' && typeof module === 'object')
|
|
@@ -57,14 +57,16 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
57
57
|
|
|
58
58
|
// EXPORTS
|
|
59
59
|
__webpack_require__.d(__webpack_exports__, {
|
|
60
|
-
|
|
60
|
+
loadLineShape: () => (/* binding */ loadLineShape)
|
|
61
61
|
});
|
|
62
62
|
|
|
63
63
|
;// CONCATENATED MODULE: ./dist/browser/LineDrawer.js
|
|
64
64
|
class LineDrawer {
|
|
65
65
|
draw(context, particle, radius) {
|
|
66
|
+
const shapeData = particle.shapeData;
|
|
66
67
|
context.moveTo(-radius / 2, 0);
|
|
67
68
|
context.lineTo(radius / 2, 0);
|
|
69
|
+
context.lineCap = shapeData?.cap ?? "butt";
|
|
68
70
|
}
|
|
69
71
|
getSidesCount() {
|
|
70
72
|
return 1;
|
|
@@ -72,8 +74,8 @@ class LineDrawer {
|
|
|
72
74
|
}
|
|
73
75
|
;// CONCATENATED MODULE: ./dist/browser/index.js
|
|
74
76
|
|
|
75
|
-
async function loadLineShape(engine) {
|
|
76
|
-
await engine.addShape("line", new LineDrawer());
|
|
77
|
+
async function loadLineShape(engine, refresh = true) {
|
|
78
|
+
await engine.addShape("line", new LineDrawer(), refresh);
|
|
77
79
|
}
|
|
78
80
|
/******/ return __webpack_exports__;
|
|
79
81
|
/******/ })()
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see tsparticles.shape.line.min.js.LICENSE.txt */
|
|
2
|
-
!function(e,
|
|
2
|
+
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var o=t();for(var n in o)("object"==typeof exports?exports:e)[n]=o[n]}}(this,(()=>(()=>{"use strict";var e={d:(t,o)=>{for(var n in o)e.o(o,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:o[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{loadLineShape:()=>n});class o{draw(e,t,o){const n=t.shapeData;e.moveTo(-o/2,0),e.lineTo(o/2,0),e.lineCap=n?.cap??"butt"}getSidesCount(){return 1}}async function n(e,t=!0){await e.addShape("line",new o,t)}return t})()));
|
|
@@ -1,8 +1 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Author : Matteo Bruni
|
|
3
|
-
* MIT license: https://opensource.org/licenses/MIT
|
|
4
|
-
* Demo / Generator : https://particles.js.org/
|
|
5
|
-
* GitHub : https://www.github.com/matteobruni/tsparticles
|
|
6
|
-
* How to use? : Check the GitHub README
|
|
7
|
-
* v3.0.0-alpha.0
|
|
8
|
-
*/
|
|
1
|
+
/*! tsParticles Line Shape v3.0.0-beta.0 by Matteo Bruni */
|
package/types/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { Engine } from "@tsparticles/engine";
|
|
2
|
-
export declare function loadLineShape(engine: Engine): Promise<void>;
|
|
2
|
+
export declare function loadLineShape(engine: Engine, refresh?: boolean): Promise<void>;
|
package/umd/LineDrawer.js
CHANGED
|
@@ -12,8 +12,10 @@
|
|
|
12
12
|
exports.LineDrawer = void 0;
|
|
13
13
|
class LineDrawer {
|
|
14
14
|
draw(context, particle, radius) {
|
|
15
|
+
const shapeData = particle.shapeData;
|
|
15
16
|
context.moveTo(-radius / 2, 0);
|
|
16
17
|
context.lineTo(radius / 2, 0);
|
|
18
|
+
context.lineCap = shapeData?.cap ?? "butt";
|
|
17
19
|
}
|
|
18
20
|
getSidesCount() {
|
|
19
21
|
return 1;
|
package/umd/index.js
CHANGED
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.loadLineShape = void 0;
|
|
13
13
|
const LineDrawer_1 = require("./LineDrawer");
|
|
14
|
-
async function loadLineShape(engine) {
|
|
15
|
-
await engine.addShape("line", new LineDrawer_1.LineDrawer());
|
|
14
|
+
async function loadLineShape(engine, refresh = true) {
|
|
15
|
+
await engine.addShape("line", new LineDrawer_1.LineDrawer(), refresh);
|
|
16
16
|
}
|
|
17
17
|
exports.loadLineShape = loadLineShape;
|
|
18
18
|
});
|