@tsparticles/shape-arrow 3.0.2 → 3.1.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/browser/ArrowDrawer.js +18 -14
- package/cjs/ArrowDrawer.js +17 -13
- package/esm/ArrowDrawer.js +18 -14
- package/package.json +2 -2
- package/report.html +2 -2
- package/tsparticles.shape.arrow.js +26 -17
- package/tsparticles.shape.arrow.min.js +1 -1
- package/tsparticles.shape.arrow.min.js.LICENSE.txt +1 -1
- package/umd/ArrowDrawer.js +17 -13
package/browser/ArrowDrawer.js
CHANGED
|
@@ -1,21 +1,25 @@
|
|
|
1
|
-
import { getRangeValue } from "@tsparticles/engine";
|
|
1
|
+
import { getRangeValue, } from "@tsparticles/engine";
|
|
2
|
+
const double = 2, defaultHeightFactor = 0.5, defaultHeadWidthFactor = 0.2, defaultBodyHeightFactor = 0.5, half = 0.5, origin = {
|
|
3
|
+
x: 0,
|
|
4
|
+
y: 0,
|
|
5
|
+
};
|
|
2
6
|
export class ArrowDrawer {
|
|
3
7
|
draw(data) {
|
|
4
|
-
const { context, particle, radius } = data, width = radius *
|
|
5
|
-
context.moveTo(-width
|
|
6
|
-
context.lineTo(-width
|
|
7
|
-
context.lineTo(width
|
|
8
|
-
context.lineTo(width
|
|
9
|
-
context.lineTo(width
|
|
10
|
-
context.lineTo(width
|
|
11
|
-
context.lineTo(width
|
|
12
|
-
context.lineTo(-width
|
|
13
|
-
context.lineTo(-width
|
|
8
|
+
const { context, particle, radius } = data, width = radius * double, heightFactor = particle.heightFactor ?? defaultHeightFactor, headWidthFactor = particle.headWidthFactor ?? defaultHeadWidthFactor, bodyHeightFactor = particle.bodyHeightFactor ?? defaultBodyHeightFactor, height = width * heightFactor, headWidth = width * headWidthFactor, bodyHeight = height * bodyHeightFactor;
|
|
9
|
+
context.moveTo(-width * half, origin.y);
|
|
10
|
+
context.lineTo(-width * half, -bodyHeight * half);
|
|
11
|
+
context.lineTo(width * half - headWidth, -bodyHeight * half);
|
|
12
|
+
context.lineTo(width * half - headWidth, -height * half);
|
|
13
|
+
context.lineTo(width * half + headWidth, origin.y);
|
|
14
|
+
context.lineTo(width * half - headWidth, height * half);
|
|
15
|
+
context.lineTo(width * half - headWidth, bodyHeight * half);
|
|
16
|
+
context.lineTo(-width * half, bodyHeight * half);
|
|
17
|
+
context.lineTo(-width * half, origin.y);
|
|
14
18
|
}
|
|
15
19
|
particleInit(container, particle) {
|
|
16
20
|
const shapeData = particle.shapeData;
|
|
17
|
-
particle.heightFactor = getRangeValue(shapeData?.heightFactor ??
|
|
18
|
-
particle.headWidthFactor = getRangeValue(shapeData?.headWidthFactor ??
|
|
19
|
-
particle.bodyHeightFactor = getRangeValue(shapeData?.bodyHeightFactor ??
|
|
21
|
+
particle.heightFactor = getRangeValue(shapeData?.heightFactor ?? defaultHeightFactor);
|
|
22
|
+
particle.headWidthFactor = getRangeValue(shapeData?.headWidthFactor ?? defaultHeadWidthFactor);
|
|
23
|
+
particle.bodyHeightFactor = getRangeValue(shapeData?.bodyHeightFactor ?? defaultBodyHeightFactor);
|
|
20
24
|
}
|
|
21
25
|
}
|
package/cjs/ArrowDrawer.js
CHANGED
|
@@ -2,24 +2,28 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ArrowDrawer = void 0;
|
|
4
4
|
const engine_1 = require("@tsparticles/engine");
|
|
5
|
+
const double = 2, defaultHeightFactor = 0.5, defaultHeadWidthFactor = 0.2, defaultBodyHeightFactor = 0.5, half = 0.5, origin = {
|
|
6
|
+
x: 0,
|
|
7
|
+
y: 0,
|
|
8
|
+
};
|
|
5
9
|
class ArrowDrawer {
|
|
6
10
|
draw(data) {
|
|
7
|
-
const { context, particle, radius } = data, width = radius *
|
|
8
|
-
context.moveTo(-width
|
|
9
|
-
context.lineTo(-width
|
|
10
|
-
context.lineTo(width
|
|
11
|
-
context.lineTo(width
|
|
12
|
-
context.lineTo(width
|
|
13
|
-
context.lineTo(width
|
|
14
|
-
context.lineTo(width
|
|
15
|
-
context.lineTo(-width
|
|
16
|
-
context.lineTo(-width
|
|
11
|
+
const { context, particle, radius } = data, width = radius * double, heightFactor = particle.heightFactor ?? defaultHeightFactor, headWidthFactor = particle.headWidthFactor ?? defaultHeadWidthFactor, bodyHeightFactor = particle.bodyHeightFactor ?? defaultBodyHeightFactor, height = width * heightFactor, headWidth = width * headWidthFactor, bodyHeight = height * bodyHeightFactor;
|
|
12
|
+
context.moveTo(-width * half, origin.y);
|
|
13
|
+
context.lineTo(-width * half, -bodyHeight * half);
|
|
14
|
+
context.lineTo(width * half - headWidth, -bodyHeight * half);
|
|
15
|
+
context.lineTo(width * half - headWidth, -height * half);
|
|
16
|
+
context.lineTo(width * half + headWidth, origin.y);
|
|
17
|
+
context.lineTo(width * half - headWidth, height * half);
|
|
18
|
+
context.lineTo(width * half - headWidth, bodyHeight * half);
|
|
19
|
+
context.lineTo(-width * half, bodyHeight * half);
|
|
20
|
+
context.lineTo(-width * half, origin.y);
|
|
17
21
|
}
|
|
18
22
|
particleInit(container, particle) {
|
|
19
23
|
const shapeData = particle.shapeData;
|
|
20
|
-
particle.heightFactor = (0, engine_1.getRangeValue)(shapeData?.heightFactor ??
|
|
21
|
-
particle.headWidthFactor = (0, engine_1.getRangeValue)(shapeData?.headWidthFactor ??
|
|
22
|
-
particle.bodyHeightFactor = (0, engine_1.getRangeValue)(shapeData?.bodyHeightFactor ??
|
|
24
|
+
particle.heightFactor = (0, engine_1.getRangeValue)(shapeData?.heightFactor ?? defaultHeightFactor);
|
|
25
|
+
particle.headWidthFactor = (0, engine_1.getRangeValue)(shapeData?.headWidthFactor ?? defaultHeadWidthFactor);
|
|
26
|
+
particle.bodyHeightFactor = (0, engine_1.getRangeValue)(shapeData?.bodyHeightFactor ?? defaultBodyHeightFactor);
|
|
23
27
|
}
|
|
24
28
|
}
|
|
25
29
|
exports.ArrowDrawer = ArrowDrawer;
|
package/esm/ArrowDrawer.js
CHANGED
|
@@ -1,21 +1,25 @@
|
|
|
1
|
-
import { getRangeValue } from "@tsparticles/engine";
|
|
1
|
+
import { getRangeValue, } from "@tsparticles/engine";
|
|
2
|
+
const double = 2, defaultHeightFactor = 0.5, defaultHeadWidthFactor = 0.2, defaultBodyHeightFactor = 0.5, half = 0.5, origin = {
|
|
3
|
+
x: 0,
|
|
4
|
+
y: 0,
|
|
5
|
+
};
|
|
2
6
|
export class ArrowDrawer {
|
|
3
7
|
draw(data) {
|
|
4
|
-
const { context, particle, radius } = data, width = radius *
|
|
5
|
-
context.moveTo(-width
|
|
6
|
-
context.lineTo(-width
|
|
7
|
-
context.lineTo(width
|
|
8
|
-
context.lineTo(width
|
|
9
|
-
context.lineTo(width
|
|
10
|
-
context.lineTo(width
|
|
11
|
-
context.lineTo(width
|
|
12
|
-
context.lineTo(-width
|
|
13
|
-
context.lineTo(-width
|
|
8
|
+
const { context, particle, radius } = data, width = radius * double, heightFactor = particle.heightFactor ?? defaultHeightFactor, headWidthFactor = particle.headWidthFactor ?? defaultHeadWidthFactor, bodyHeightFactor = particle.bodyHeightFactor ?? defaultBodyHeightFactor, height = width * heightFactor, headWidth = width * headWidthFactor, bodyHeight = height * bodyHeightFactor;
|
|
9
|
+
context.moveTo(-width * half, origin.y);
|
|
10
|
+
context.lineTo(-width * half, -bodyHeight * half);
|
|
11
|
+
context.lineTo(width * half - headWidth, -bodyHeight * half);
|
|
12
|
+
context.lineTo(width * half - headWidth, -height * half);
|
|
13
|
+
context.lineTo(width * half + headWidth, origin.y);
|
|
14
|
+
context.lineTo(width * half - headWidth, height * half);
|
|
15
|
+
context.lineTo(width * half - headWidth, bodyHeight * half);
|
|
16
|
+
context.lineTo(-width * half, bodyHeight * half);
|
|
17
|
+
context.lineTo(-width * half, origin.y);
|
|
14
18
|
}
|
|
15
19
|
particleInit(container, particle) {
|
|
16
20
|
const shapeData = particle.shapeData;
|
|
17
|
-
particle.heightFactor = getRangeValue(shapeData?.heightFactor ??
|
|
18
|
-
particle.headWidthFactor = getRangeValue(shapeData?.headWidthFactor ??
|
|
19
|
-
particle.bodyHeightFactor = getRangeValue(shapeData?.bodyHeightFactor ??
|
|
21
|
+
particle.heightFactor = getRangeValue(shapeData?.heightFactor ?? defaultHeightFactor);
|
|
22
|
+
particle.headWidthFactor = getRangeValue(shapeData?.headWidthFactor ?? defaultHeadWidthFactor);
|
|
23
|
+
particle.bodyHeightFactor = getRangeValue(shapeData?.bodyHeightFactor ?? defaultBodyHeightFactor);
|
|
20
24
|
}
|
|
21
25
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsparticles/shape-arrow",
|
|
3
|
-
"version": "3.0
|
|
3
|
+
"version": "3.1.0",
|
|
4
4
|
"description": "tsParticles arrow shape",
|
|
5
5
|
"homepage": "https://particles.js.org",
|
|
6
6
|
"repository": {
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
"./package.json": "./package.json"
|
|
101
101
|
},
|
|
102
102
|
"dependencies": {
|
|
103
|
-
"@tsparticles/engine": "^3.0
|
|
103
|
+
"@tsparticles/engine": "^3.1.0"
|
|
104
104
|
},
|
|
105
105
|
"publishConfig": {
|
|
106
106
|
"access": "public"
|
package/report.html
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="UTF-8"/>
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
|
6
|
-
<title>@tsparticles/shape-arrow [
|
|
6
|
+
<title>@tsparticles/shape-arrow [13 Jan 2024 at 23:05]</title>
|
|
7
7
|
<link rel="shortcut icon" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAABrVBMVEUAAAD///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////+O1foceMD///+J0/qK1Pr7/v8Xdr/9///W8P4UdL7L7P0Scr2r4Pyj3vwad8D5/f/2/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R+hwWIIhGvORcJUBYXe3Xa3vq/mF/N9V13ugufMkfXn+KHsRD0B8AAAAASUVORK5CYII=" type="image/x-icon" />
|
|
8
8
|
|
|
9
9
|
<script>
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
<body>
|
|
32
32
|
<div id="app"></div>
|
|
33
33
|
<script>
|
|
34
|
-
window.chartData = [{"label":"tsparticles.shape.arrow.js","isAsset":true,"statSize":
|
|
34
|
+
window.chartData = [{"label":"tsparticles.shape.arrow.js","isAsset":true,"statSize":1823,"parsedSize":5691,"gzipSize":1716,"groups":[{"label":"dist/browser","path":"./dist/browser","statSize":1781,"groups":[{"id":386,"label":"index.js + 1 modules (concatenated)","path":"./dist/browser/index.js + 1 modules (concatenated)","statSize":1781,"parsedSize":5691,"gzipSize":1716,"concatenated":true,"groups":[{"label":"dist/browser","path":"./dist/browser/index.js + 1 modules (concatenated)/dist/browser","statSize":1781,"groups":[{"id":null,"label":"index.js","path":"./dist/browser/index.js + 1 modules (concatenated)/dist/browser/index.js","statSize":174,"parsedSize":555,"gzipSize":167,"inaccurateSizes":true},{"id":null,"label":"ArrowDrawer.js","path":"./dist/browser/index.js + 1 modules (concatenated)/dist/browser/ArrowDrawer.js","statSize":1607,"parsedSize":5135,"gzipSize":1548,"inaccurateSizes":true}],"parsedSize":5691,"gzipSize":1716,"inaccurateSizes":true}]}],"parsedSize":5691,"gzipSize":1716},{"label":"engine\",\"commonjs2\":\"@tsparticles/engine\",\"amd\":\"@tsparticles","path":"./engine\",\"commonjs2\":\"@tsparticles/engine\",\"amd\":\"@tsparticles","statSize":42,"groups":[{"id":533,"label":"engine\",\"root\":\"window\"}","path":"./engine\",\"commonjs2\":\"@tsparticles/engine\",\"amd\":\"@tsparticles/engine\",\"root\":\"window\"}","statSize":42}],"parsedSize":0,"gzipSize":0}],"isInitialByEntrypoint":{"tsparticles.shape.arrow":true}}];
|
|
35
35
|
window.entrypoints = ["tsparticles.shape.arrow","tsparticles.shape.arrow.min"];
|
|
36
36
|
window.defaultSizes = "parsed";
|
|
37
37
|
</script>
|
|
@@ -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
|
|
7
|
+
* v3.1.0
|
|
8
8
|
*/
|
|
9
9
|
(function webpackUniversalModuleDefinition(root, factory) {
|
|
10
10
|
if(typeof exports === 'object' && typeof module === 'object')
|
|
@@ -98,6 +98,15 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
98
98
|
var engine_root_window_ = __webpack_require__(533);
|
|
99
99
|
;// CONCATENATED MODULE: ./dist/browser/ArrowDrawer.js
|
|
100
100
|
|
|
101
|
+
const ArrowDrawer_double = 2,
|
|
102
|
+
defaultHeightFactor = 0.5,
|
|
103
|
+
defaultHeadWidthFactor = 0.2,
|
|
104
|
+
defaultBodyHeightFactor = 0.5,
|
|
105
|
+
half = 0.5,
|
|
106
|
+
origin = {
|
|
107
|
+
x: 0,
|
|
108
|
+
y: 0
|
|
109
|
+
};
|
|
101
110
|
class ArrowDrawer {
|
|
102
111
|
draw(data) {
|
|
103
112
|
const {
|
|
@@ -105,28 +114,28 @@ class ArrowDrawer {
|
|
|
105
114
|
particle,
|
|
106
115
|
radius
|
|
107
116
|
} = data,
|
|
108
|
-
width = radius *
|
|
109
|
-
heightFactor = particle.heightFactor ??
|
|
110
|
-
headWidthFactor = particle.headWidthFactor ??
|
|
111
|
-
bodyHeightFactor = particle.bodyHeightFactor ??
|
|
117
|
+
width = radius * ArrowDrawer_double,
|
|
118
|
+
heightFactor = particle.heightFactor ?? defaultHeightFactor,
|
|
119
|
+
headWidthFactor = particle.headWidthFactor ?? defaultHeadWidthFactor,
|
|
120
|
+
bodyHeightFactor = particle.bodyHeightFactor ?? defaultBodyHeightFactor,
|
|
112
121
|
height = width * heightFactor,
|
|
113
122
|
headWidth = width * headWidthFactor,
|
|
114
123
|
bodyHeight = height * bodyHeightFactor;
|
|
115
|
-
context.moveTo(-width
|
|
116
|
-
context.lineTo(-width
|
|
117
|
-
context.lineTo(width
|
|
118
|
-
context.lineTo(width
|
|
119
|
-
context.lineTo(width
|
|
120
|
-
context.lineTo(width
|
|
121
|
-
context.lineTo(width
|
|
122
|
-
context.lineTo(-width
|
|
123
|
-
context.lineTo(-width
|
|
124
|
+
context.moveTo(-width * half, origin.y);
|
|
125
|
+
context.lineTo(-width * half, -bodyHeight * half);
|
|
126
|
+
context.lineTo(width * half - headWidth, -bodyHeight * half);
|
|
127
|
+
context.lineTo(width * half - headWidth, -height * half);
|
|
128
|
+
context.lineTo(width * half + headWidth, origin.y);
|
|
129
|
+
context.lineTo(width * half - headWidth, height * half);
|
|
130
|
+
context.lineTo(width * half - headWidth, bodyHeight * half);
|
|
131
|
+
context.lineTo(-width * half, bodyHeight * half);
|
|
132
|
+
context.lineTo(-width * half, origin.y);
|
|
124
133
|
}
|
|
125
134
|
particleInit(container, particle) {
|
|
126
135
|
const shapeData = particle.shapeData;
|
|
127
|
-
particle.heightFactor = (0,engine_root_window_.getRangeValue)(shapeData?.heightFactor ??
|
|
128
|
-
particle.headWidthFactor = (0,engine_root_window_.getRangeValue)(shapeData?.headWidthFactor ??
|
|
129
|
-
particle.bodyHeightFactor = (0,engine_root_window_.getRangeValue)(shapeData?.bodyHeightFactor ??
|
|
136
|
+
particle.heightFactor = (0,engine_root_window_.getRangeValue)(shapeData?.heightFactor ?? defaultHeightFactor);
|
|
137
|
+
particle.headWidthFactor = (0,engine_root_window_.getRangeValue)(shapeData?.headWidthFactor ?? defaultHeadWidthFactor);
|
|
138
|
+
particle.bodyHeightFactor = (0,engine_root_window_.getRangeValue)(shapeData?.bodyHeightFactor ?? defaultBodyHeightFactor);
|
|
130
139
|
}
|
|
131
140
|
}
|
|
132
141
|
;// CONCATENATED MODULE: ./dist/browser/index.js
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see tsparticles.shape.arrow.min.js.LICENSE.txt */
|
|
2
|
-
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@tsparticles/engine"));else if("function"==typeof define&&define.amd)define(["@tsparticles/engine"],t);else{var o="object"==typeof exports?t(require("@tsparticles/engine")):t(e.window);for(var r in o)("object"==typeof exports?exports:e)[r]=o[r]}}(this,(e=>(()=>{"use strict";var t={533:t=>{t.exports=e}},o={};function r(e){var a=o[e];if(void 0!==a)return a.exports;var i=o[e]={exports:{}};return t[e](i,i.exports,r),i.exports}r.d=(e,t)=>{for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var a={};return(()=>{r.r(a),r.d(a,{loadArrowShape:()=>
|
|
2
|
+
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@tsparticles/engine"));else if("function"==typeof define&&define.amd)define(["@tsparticles/engine"],t);else{var o="object"==typeof exports?t(require("@tsparticles/engine")):t(e.window);for(var r in o)("object"==typeof exports?exports:e)[r]=o[r]}}(this,(e=>(()=>{"use strict";var t={533:t=>{t.exports=e}},o={};function r(e){var a=o[e];if(void 0!==a)return a.exports;var i=o[e]={exports:{}};return t[e](i,i.exports,r),i.exports}r.d=(e,t)=>{for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var a={};return(()=>{r.r(a),r.d(a,{loadArrowShape:()=>n});var e=r(533);const t=.5,o=0;class i{draw(e){const{context:r,particle:a,radius:i}=e,n=2*i,c=n*(a.heightFactor??.5),l=n*(a.headWidthFactor??.2),d=c*(a.bodyHeightFactor??.5);r.moveTo(-n*t,o),r.lineTo(-n*t,-d*t),r.lineTo(n*t-l,-d*t),r.lineTo(n*t-l,-c*t),r.lineTo(n*t+l,o),r.lineTo(n*t-l,c*t),r.lineTo(n*t-l,d*t),r.lineTo(-n*t,d*t),r.lineTo(-n*t,o)}particleInit(t,o){const r=o.shapeData;o.heightFactor=(0,e.getRangeValue)(r?.heightFactor??.5),o.headWidthFactor=(0,e.getRangeValue)(r?.headWidthFactor??.2),o.bodyHeightFactor=(0,e.getRangeValue)(r?.bodyHeightFactor??.5)}}async function n(e,t=!0){await e.addShape("arrow",new i,t)}})(),a})()));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
/*! tsParticles Arrow Shape v3.0
|
|
1
|
+
/*! tsParticles Arrow Shape v3.1.0 by Matteo Bruni */
|
package/umd/ArrowDrawer.js
CHANGED
|
@@ -11,24 +11,28 @@
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.ArrowDrawer = void 0;
|
|
13
13
|
const engine_1 = require("@tsparticles/engine");
|
|
14
|
+
const double = 2, defaultHeightFactor = 0.5, defaultHeadWidthFactor = 0.2, defaultBodyHeightFactor = 0.5, half = 0.5, origin = {
|
|
15
|
+
x: 0,
|
|
16
|
+
y: 0,
|
|
17
|
+
};
|
|
14
18
|
class ArrowDrawer {
|
|
15
19
|
draw(data) {
|
|
16
|
-
const { context, particle, radius } = data, width = radius *
|
|
17
|
-
context.moveTo(-width
|
|
18
|
-
context.lineTo(-width
|
|
19
|
-
context.lineTo(width
|
|
20
|
-
context.lineTo(width
|
|
21
|
-
context.lineTo(width
|
|
22
|
-
context.lineTo(width
|
|
23
|
-
context.lineTo(width
|
|
24
|
-
context.lineTo(-width
|
|
25
|
-
context.lineTo(-width
|
|
20
|
+
const { context, particle, radius } = data, width = radius * double, heightFactor = particle.heightFactor ?? defaultHeightFactor, headWidthFactor = particle.headWidthFactor ?? defaultHeadWidthFactor, bodyHeightFactor = particle.bodyHeightFactor ?? defaultBodyHeightFactor, height = width * heightFactor, headWidth = width * headWidthFactor, bodyHeight = height * bodyHeightFactor;
|
|
21
|
+
context.moveTo(-width * half, origin.y);
|
|
22
|
+
context.lineTo(-width * half, -bodyHeight * half);
|
|
23
|
+
context.lineTo(width * half - headWidth, -bodyHeight * half);
|
|
24
|
+
context.lineTo(width * half - headWidth, -height * half);
|
|
25
|
+
context.lineTo(width * half + headWidth, origin.y);
|
|
26
|
+
context.lineTo(width * half - headWidth, height * half);
|
|
27
|
+
context.lineTo(width * half - headWidth, bodyHeight * half);
|
|
28
|
+
context.lineTo(-width * half, bodyHeight * half);
|
|
29
|
+
context.lineTo(-width * half, origin.y);
|
|
26
30
|
}
|
|
27
31
|
particleInit(container, particle) {
|
|
28
32
|
const shapeData = particle.shapeData;
|
|
29
|
-
particle.heightFactor = (0, engine_1.getRangeValue)(shapeData?.heightFactor ??
|
|
30
|
-
particle.headWidthFactor = (0, engine_1.getRangeValue)(shapeData?.headWidthFactor ??
|
|
31
|
-
particle.bodyHeightFactor = (0, engine_1.getRangeValue)(shapeData?.bodyHeightFactor ??
|
|
33
|
+
particle.heightFactor = (0, engine_1.getRangeValue)(shapeData?.heightFactor ?? defaultHeightFactor);
|
|
34
|
+
particle.headWidthFactor = (0, engine_1.getRangeValue)(shapeData?.headWidthFactor ?? defaultHeadWidthFactor);
|
|
35
|
+
particle.bodyHeightFactor = (0, engine_1.getRangeValue)(shapeData?.bodyHeightFactor ?? defaultBodyHeightFactor);
|
|
32
36
|
}
|
|
33
37
|
}
|
|
34
38
|
exports.ArrowDrawer = ArrowDrawer;
|