@wcardinal/wcardinal-ui 0.347.0 → 0.349.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/dist/types/wcardinal/ui/shape/variant/e-shape-connector-elbow-points-filler.d.ts +1 -1
- package/dist/types/wcardinal/ui/shape/variant/e-shape-embedded.d.ts +2 -2
- package/dist/wcardinal/ui/shape/variant/e-shape-connector-elbow-points-filler.js +33 -35
- package/dist/wcardinal/ui/shape/variant/e-shape-connector-elbow-points-filler.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/e-shape-embedded.js +6 -6
- package/dist/wcardinal/ui/shape/variant/e-shape-embedded.js.map +1 -1
- package/dist/wcardinal-ui-theme-dark.js +1 -1
- package/dist/wcardinal-ui-theme-dark.min.js +1 -1
- package/dist/wcardinal-ui-theme-white.js +1 -1
- package/dist/wcardinal-ui-theme-white.min.js +1 -1
- package/dist/wcardinal-ui.cjs.js +43 -45
- package/dist/wcardinal-ui.js +43 -45
- package/dist/wcardinal-ui.min.js +2 -2
- package/dist/wcardinal-ui.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -11,7 +11,7 @@ export declare class EShapeConnectorElbowPointsFiller {
|
|
|
11
11
|
set x(x: number);
|
|
12
12
|
get y(): number;
|
|
13
13
|
set y(y: number);
|
|
14
|
-
protected toSide(x: number, y: number):
|
|
14
|
+
protected toSide(x: number, y: number): 0 | 1 | 2 | 3;
|
|
15
15
|
protected toAxis(dx: number, dy: number, nx: number, ny: number, side: EShapeAcceptorEdgeSide): 0 | 1 | 2 | 3;
|
|
16
16
|
protected toTailAxis(x: number, y: number, nx: number, ny: number, side: EShapeAcceptorEdgeSide): 0 | 1 | 2 | 3;
|
|
17
17
|
tail(x: number, y: number, nx: number, ny: number, sxh: number, syh: number, margin: number, side: EShapeAcceptorEdgeSide): void;
|
|
@@ -13,8 +13,8 @@ export declare class EShapeEmbedded extends EShapeGroupViewer {
|
|
|
13
13
|
get name(): string;
|
|
14
14
|
get edges(): Map<string, EShapeAcceptorEdge>;
|
|
15
15
|
protected newEdges(): Map<string, EShapeAcceptorEdge>;
|
|
16
|
-
protected
|
|
17
|
-
protected
|
|
16
|
+
protected toEdgePosition(lp: number, cp: number, sh: number, s: number): number;
|
|
17
|
+
protected toEdgeNormal(x: number, y: number): EShapeAcceptorEdgeNormal;
|
|
18
18
|
protected isGroupSizeFittable(): boolean;
|
|
19
19
|
protected newGroupSize(mode: EShapeResourceManagerDeserializationMode, depth: number): EShapeGroupSize;
|
|
20
20
|
clone(): EShapeEmbedded;
|
|
@@ -67,18 +67,18 @@ var EShapeConnectorElbowPointsFiller = /** @class */ (function () {
|
|
|
67
67
|
// y = -x => 0 = x + y
|
|
68
68
|
if (0 <= x - y) {
|
|
69
69
|
if (0 <= x + y) {
|
|
70
|
-
return
|
|
70
|
+
return 1;
|
|
71
71
|
}
|
|
72
72
|
else {
|
|
73
|
-
return
|
|
73
|
+
return 0;
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
76
|
else {
|
|
77
77
|
if (0 <= x + y) {
|
|
78
|
-
return
|
|
78
|
+
return 2;
|
|
79
79
|
}
|
|
80
80
|
else {
|
|
81
|
-
return
|
|
81
|
+
return 3;
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
};
|
|
@@ -107,40 +107,38 @@ var EShapeConnectorElbowPointsFiller = /** @class */ (function () {
|
|
|
107
107
|
}
|
|
108
108
|
var d = null;
|
|
109
109
|
var result = 0;
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
110
|
+
var dd = dx * dx + dy * dy;
|
|
111
|
+
if (this._threshold < dd) {
|
|
112
|
+
var f = 1 / Math.sqrt(dd);
|
|
113
|
+
var fx = dx * f;
|
|
114
|
+
var fy = dy * f;
|
|
115
|
+
var d0 = +nx * fx + ny * fy;
|
|
116
|
+
var d1 = -ny * fx + nx * fy;
|
|
117
|
+
var d2 = -d0;
|
|
118
|
+
var d3 = -d1;
|
|
119
|
+
if (side & EShapeAcceptorEdgeSide.TOP) {
|
|
120
|
+
if (d == null || d < d0) {
|
|
121
|
+
d = d0;
|
|
122
|
+
result = this.toSide(nx, ny);
|
|
123
|
+
}
|
|
117
124
|
}
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
if (d == null || d < dx) {
|
|
124
|
-
d = dx;
|
|
125
|
-
result = 1;
|
|
125
|
+
if (side & EShapeAcceptorEdgeSide.RIGHT) {
|
|
126
|
+
if (d == null || d < d1) {
|
|
127
|
+
d = d1;
|
|
128
|
+
result = this.toSide(-ny, nx);
|
|
129
|
+
}
|
|
126
130
|
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
if (d == null || d < dy) {
|
|
133
|
-
d = dy;
|
|
134
|
-
result = 2;
|
|
131
|
+
if (side & EShapeAcceptorEdgeSide.BOTTOM) {
|
|
132
|
+
if (d == null || d < d2) {
|
|
133
|
+
d = d2;
|
|
134
|
+
result = this.toSide(-nx, -ny);
|
|
135
|
+
}
|
|
135
136
|
}
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
if (d == null || d < -dx) {
|
|
142
|
-
d = -dx;
|
|
143
|
-
result = 3;
|
|
137
|
+
if (side & EShapeAcceptorEdgeSide.LEFT) {
|
|
138
|
+
if (d == null || d < d3) {
|
|
139
|
+
d = d3;
|
|
140
|
+
result = this.toSide(ny, -nx);
|
|
141
|
+
}
|
|
144
142
|
}
|
|
145
143
|
}
|
|
146
144
|
return result;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"e-shape-connector-elbow-points-filler.js","sourceRoot":"","sources":["../../../../../src/main/typescript/wcardinal/ui/shape/variant/e-shape-connector-elbow-points-filler.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,O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AC;oBAChC,MAAM,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;iBAChC;qBAAM;oBACN,IAAI,CAAC,KAAK,IAAI,CAAC,CAAC;iBAChB;aACD;SACD;QAED,kBAAkB;QAClB,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;IAChC,CAAC;IACF,uCAAC;AAAD,CAAC,AA3TD,IA2TC","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { EShapeAcceptorEdgeSide } from \"../e-shape-acceptor-edge-side\";\n\nexport class EShapeConnectorElbowPointsFiller {\n\tprotected _x: number;\n\tprotected _y: number;\n\tprotected _z: number;\n\tprotected _values: number[];\n\tindex: number;\n\tprotected _threshold = 0.000001;\n\n\tconstructor(x: number, y: number, values: number[]) {\n\t\tthis._x = x;\n\t\tthis._y = y;\n\t\tthis._z = 0;\n\t\tthis._values = values;\n\t\tvalues[0] = x;\n\t\tvalues[1] = y;\n\t\tthis.index = 0;\n\t}\n\n\tget x(): number {\n\t\treturn this._x;\n\t}\n\n\tset x(x: number) {\n\t\tif (this._z === 0 || this._threshold < Math.abs(this._x - x)) {\n\t\t\tthis._x = x;\n\t\t\tconst index = this.index;\n\t\t\tconst values = this._values;\n\t\t\tif (this._z === 1) {\n\t\t\t\tvalues[index + 0] = this._x;\n\t\t\t\tvalues[index + 1] = this._y;\n\t\t\t} else {\n\t\t\t\tvalues[index + 2] = this._x;\n\t\t\t\tvalues[index + 3] = this._y;\n\t\t\t\tthis.index += 2;\n\t\t\t\tthis._z = 1;\n\t\t\t}\n\t\t}\n\t}\n\n\tget y(): number {\n\t\treturn this._y;\n\t}\n\n\tset y(y: number) {\n\t\tif (this._z === 0 || this._threshold < Math.abs(this._y - y)) {\n\t\t\tthis._y = y;\n\t\t\tconst index = this.index;\n\t\t\tconst values = this._values;\n\t\t\tif (this._z === 2) {\n\t\t\t\tvalues[index + 0] = this._x;\n\t\t\t\tvalues[index + 1] = this._y;\n\t\t\t} else {\n\t\t\t\tvalues[index + 2] = this._x;\n\t\t\t\tvalues[index + 3] = this._y;\n\t\t\t\tthis.index += 2;\n\t\t\t\tthis._z = 2;\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected toSide(x: number, y: number): EShapeAcceptorEdgeSide {\n\t\t// y = +x => 0 = x - y\n\t\t// y = -x => 0 = x + y\n\t\tif (0 <= x - y) {\n\t\t\tif (0 <= x + y) {\n\t\t\t\treturn EShapeAcceptorEdgeSide.RIGHT;\n\t\t\t} else {\n\t\t\t\treturn EShapeAcceptorEdgeSide.BOTTOM;\n\t\t\t}\n\t\t} else {\n\t\t\tif (0 <= x + y) {\n\t\t\t\treturn EShapeAcceptorEdgeSide.TOP;\n\t\t\t} else {\n\t\t\t\treturn EShapeAcceptorEdgeSide.LEFT;\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected toAxis(\n\t\tdx: number,\n\t\tdy: number,\n\t\tnx: number,\n\t\tny: number,\n\t\tside: EShapeAcceptorEdgeSide\n\t): 0 | 1 | 2 | 3 {\n\t\t// When (nx, ny) === (0, 0), treat as if side === EShapeAcceptorEdgeSide.ALL.\n\t\tconst anx = Math.abs(nx);\n\t\tconst any = Math.abs(ny);\n\t\tconst threshold = this._threshold;\n\t\tif (anx < threshold && any < threshold) {\n\t\t\tif (Math.abs(dx) < Math.abs(dy)) {\n\t\t\t\tif (0 <= dy) {\n\t\t\t\t\treturn 2; // Bottom\n\t\t\t\t} else {\n\t\t\t\t\treturn 0; // Top\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (0 <= dx) {\n\t\t\t\t\treturn 1; // Right\n\t\t\t\t} else {\n\t\t\t\t\treturn 3; // Left\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tlet d: number | null = null;\n\t\tlet result: 0 | 1 | 2 | 3 = 0;\n\n\t\t// 0 := (0, -1)\n\t\t// | ny, -nx | 0 |\n\t\t// | nx, ny | -1 |\n\t\tif (side & this.toSide(nx, -ny)) {\n\t\t\tif (d == null || d < -dy) {\n\t\t\t\td = -dy;\n\t\t\t\tresult = 0;\n\t\t\t}\n\t\t}\n\n\t\t// 1 := (1, 0)\n\t\t// | ny, -nx | 1 |\n\t\t// | nx, ny | 0 |\n\t\tif (side & this.toSide(ny, nx)) {\n\t\t\tif (d == null || d < dx) {\n\t\t\t\td = dx;\n\t\t\t\tresult = 1;\n\t\t\t}\n\t\t}\n\n\t\t// 2 := (0, 1)\n\t\t// | ny, -nx | 0 |\n\t\t// | nx, ny | 1 |\n\t\tif (side & this.toSide(-nx, ny)) {\n\t\t\tif (d == null || d < dy) {\n\t\t\t\td = dy;\n\t\t\t\tresult = 2;\n\t\t\t}\n\t\t}\n\n\t\t// 3 := (-1, 0)\n\t\t// | ny, -nx | -1 |\n\t\t// | nx, ny | 0 |\n\t\tif (side & this.toSide(-ny, -nx)) {\n\t\t\tif (d == null || d < -dx) {\n\t\t\t\td = -dx;\n\t\t\t\tresult = 3;\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tprotected toTailAxis(\n\t\tx: number,\n\t\ty: number,\n\t\tnx: number,\n\t\tny: number,\n\t\tside: EShapeAcceptorEdgeSide\n\t): 0 | 1 | 2 | 3 {\n\t\treturn this.toAxis(x - this.x, y - this.y, nx, ny, side);\n\t}\n\n\ttail(\n\t\tx: number,\n\t\ty: number,\n\t\tnx: number,\n\t\tny: number,\n\t\tsxh: number,\n\t\tsyh: number,\n\t\tmargin: number,\n\t\tside: EShapeAcceptorEdgeSide\n\t): void {\n\t\tswitch (this.toTailAxis(x, y, nx, ny, side)) {\n\t\t\tcase 0:\n\t\t\t\tif (this.y - margin <= y) {\n\t\t\t\t\tthis.y -= Math.max(margin, syh);\n\t\t\t\t\tthis.x = x;\n\t\t\t\t} else {\n\t\t\t\t\tthis.y = y;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\tif (x <= this.x + margin) {\n\t\t\t\t\tthis.x += Math.max(margin, sxh);\n\t\t\t\t\tthis.y = y;\n\t\t\t\t} else {\n\t\t\t\t\tthis.x = x;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tif (y <= this.y + margin) {\n\t\t\t\t\tthis.y += Math.max(margin, sxh);\n\t\t\t\t\tthis.x = x;\n\t\t\t\t} else {\n\t\t\t\t\tthis.y = y;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\tif (this.x - margin <= x) {\n\t\t\t\t\tthis.x -= Math.max(margin, sxh);\n\t\t\t\t\tthis.y = y;\n\t\t\t\t} else {\n\t\t\t\t\tthis.x = x;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tmiddle(x: number, y: number): void {\n\t\tconst dx = x - this._x;\n\t\tconst dy = y - this._y;\n\t\tif (Math.abs(dx) < Math.abs(dy)) {\n\t\t\tthis.y = y;\n\t\t} else {\n\t\t\tthis.x = x;\n\t\t}\n\t}\n\n\tprotected toHeadAxis(\n\t\tx: number,\n\t\ty: number,\n\t\tnx: number,\n\t\tny: number,\n\t\tside: EShapeAcceptorEdgeSide\n\t): 0 | 1 | 2 | 3 {\n\t\treturn this.toAxis(this.x - x, this.y - y, nx, ny, side);\n\t}\n\n\thead(\n\t\tx: number,\n\t\ty: number,\n\t\tnx: number,\n\t\tny: number,\n\t\tsxh: number,\n\t\tsyh: number,\n\t\tmargin: number,\n\t\tside: EShapeAcceptorEdgeSide\n\t): void {\n\t\tswitch (this.toHeadAxis(x, y, nx, ny, side)) {\n\t\t\tcase 0:\n\t\t\t\tif (y - margin <= this.y) {\n\t\t\t\t\tthis.y = y - Math.max(margin, syh);\n\t\t\t\t}\n\t\t\t\tthis.x = x;\n\t\t\t\tthis.y = y;\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\tif (this.x <= x + margin) {\n\t\t\t\t\tthis.x = x + Math.max(margin, sxh);\n\t\t\t\t}\n\t\t\t\tthis.y = y;\n\t\t\t\tthis.x = x;\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tif (this.y <= y + margin) {\n\t\t\t\t\tthis.y = y + Math.max(margin, syh);\n\t\t\t\t}\n\t\t\t\tthis.x = x;\n\t\t\t\tthis.y = y;\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\tif (x - margin <= this.x) {\n\t\t\t\t\tthis.x = x - Math.max(margin, sxh);\n\t\t\t\t}\n\t\t\t\tthis.y = y;\n\t\t\t\tthis.x = x;\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tmargin(tail: number, head: number): void {\n\t\tconst values = this._values;\n\n\t\t// Tail\n\t\tlet index = this.index;\n\t\tif (tail !== 0 && 2 <= index) {\n\t\t\tconst x0 = values[0];\n\t\t\tconst y0 = values[1];\n\t\t\tconst dx = values[2] - x0;\n\t\t\tconst dy = values[3] - y0;\n\t\t\tconst d = dx * dx + dy * dy;\n\t\t\tconst threshold = this._threshold;\n\t\t\tif (threshold < d) {\n\t\t\t\tconst f = tail / Math.sqrt(dx * dx + dy * dy);\n\t\t\t\tif (threshold < Math.abs(f - 1)) {\n\t\t\t\t\tvalues[0] = x0 + dx * f;\n\t\t\t\t\tvalues[1] = y0 + dy * f;\n\t\t\t\t} else {\n\t\t\t\t\tthis.index -= 2;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Head\n\t\tindex = this.index;\n\t\tif (head !== 0 && 2 <= index) {\n\t\t\tconst x1 = values[index + 0];\n\t\t\tconst y1 = values[index + 1];\n\t\t\tconst dx = values[index - 2] - x1;\n\t\t\tconst dy = values[index - 1] - y1;\n\t\t\tconst d = dx * dx + dy * dy;\n\t\t\tconst threshold = this._threshold;\n\t\t\tif (threshold < d) {\n\t\t\t\tconst f = head / Math.sqrt(dx * dx + dy * dy);\n\t\t\t\tif (threshold < Math.abs(f - 1)) {\n\t\t\t\t\tvalues[index + 0] = x1 + dx * f;\n\t\t\t\t\tvalues[index + 1] = y1 + dy * f;\n\t\t\t\t} else {\n\t\t\t\t\tthis.index -= 2;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Remote the rest\n\t\tvalues.length = this.index + 2;\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"e-shape-connector-elbow-points-filler.js","sourceRoot":"","sources":["../../../../../src/main/typescript/wcardinal/ui/shape/variant/e-shape-connector-elbow-points-filler.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAEvE;IAQC,0CAAY,CAAS,EAAE,CAAS,EAAE,MAAgB;QAFxC,eAAU,GAAG,QAAQ,CAAC;QAG/B,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC;QACZ,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC;QACZ,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC;QACZ,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;QACd,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;QACd,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;IAChB,CAAC;IAED,sBAAI,+CAAC;aAAL;YACC,OAAO,IAAI,CAAC,EAAE,CAAC;QAChB,CAAC;aAED,UAAM,CAAS;YACd,IAAI,IAAI,CAAC,EAAE,KAAK,CAAC,IAAI,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE;gBAC7D,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC;gBACZ,IAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;gBACzB,IAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC;gBAC5B,IAAI,IAAI,CAAC,EAAE,KAAK,CAAC,EAAE;oBAClB,MAAM,CAAC,KA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,EAAE,GAAG,MAAM,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;YAC7B,IAAM,EAAE,GAAG,MAAM,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;YAC7B,IAAM,EAAE,GAAG,MAAM,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC;YAClC,IAAM,EAAE,GAAG,MAAM,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC;YAClC,IAAM,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;YAC5B,IAAM,SAAS,GAAG,IAAI,CAAC,UAAU,CAAC;YAClC,IAAI,SAAS,GAAG,CAAC,EAAE;gBAClB,IAAM,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC;gBAC9C,IAAI,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE;oBAChC,MAAM,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;oBAChC,MAAM,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;iBAChC;qBAAM;oBACN,IAAI,CAAC,KAAK,IAAI,CAAC,CAAC;iBAChB;aACD;SACD;QAED,kBAAkB;QAClB,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;IAChC,CAAC;IACF,uCAAC;AAAD,CAAC,AApTD,IAoTC","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { EShapeAcceptorEdgeSide } from \"../e-shape-acceptor-edge-side\";\n\nexport class EShapeConnectorElbowPointsFiller {\n\tprotected _x: number;\n\tprotected _y: number;\n\tprotected _z: number;\n\tprotected _values: number[];\n\tindex: number;\n\tprotected _threshold = 0.000001;\n\n\tconstructor(x: number, y: number, values: number[]) {\n\t\tthis._x = x;\n\t\tthis._y = y;\n\t\tthis._z = 0;\n\t\tthis._values = values;\n\t\tvalues[0] = x;\n\t\tvalues[1] = y;\n\t\tthis.index = 0;\n\t}\n\n\tget x(): number {\n\t\treturn this._x;\n\t}\n\n\tset x(x: number) {\n\t\tif (this._z === 0 || this._threshold < Math.abs(this._x - x)) {\n\t\t\tthis._x = x;\n\t\t\tconst index = this.index;\n\t\t\tconst values = this._values;\n\t\t\tif (this._z === 1) {\n\t\t\t\tvalues[index + 0] = this._x;\n\t\t\t\tvalues[index + 1] = this._y;\n\t\t\t} else {\n\t\t\t\tvalues[index + 2] = this._x;\n\t\t\t\tvalues[index + 3] = this._y;\n\t\t\t\tthis.index += 2;\n\t\t\t\tthis._z = 1;\n\t\t\t}\n\t\t}\n\t}\n\n\tget y(): number {\n\t\treturn this._y;\n\t}\n\n\tset y(y: number) {\n\t\tif (this._z === 0 || this._threshold < Math.abs(this._y - y)) {\n\t\t\tthis._y = y;\n\t\t\tconst index = this.index;\n\t\t\tconst values = this._values;\n\t\t\tif (this._z === 2) {\n\t\t\t\tvalues[index + 0] = this._x;\n\t\t\t\tvalues[index + 1] = this._y;\n\t\t\t} else {\n\t\t\t\tvalues[index + 2] = this._x;\n\t\t\t\tvalues[index + 3] = this._y;\n\t\t\t\tthis.index += 2;\n\t\t\t\tthis._z = 2;\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected toSide(x: number, y: number): 0 | 1 | 2 | 3 {\n\t\t// y = +x => 0 = x - y\n\t\t// y = -x => 0 = x + y\n\t\tif (0 <= x - y) {\n\t\t\tif (0 <= x + y) {\n\t\t\t\treturn 1;\n\t\t\t} else {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t} else {\n\t\t\tif (0 <= x + y) {\n\t\t\t\treturn 2;\n\t\t\t} else {\n\t\t\t\treturn 3;\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected toAxis(\n\t\tdx: number,\n\t\tdy: number,\n\t\tnx: number,\n\t\tny: number,\n\t\tside: EShapeAcceptorEdgeSide\n\t): 0 | 1 | 2 | 3 {\n\t\t// When (nx, ny) === (0, 0), treat as if side === EShapeAcceptorEdgeSide.ALL.\n\t\tconst anx = Math.abs(nx);\n\t\tconst any = Math.abs(ny);\n\t\tconst threshold = this._threshold;\n\t\tif (anx < threshold && any < threshold) {\n\t\t\tif (Math.abs(dx) < Math.abs(dy)) {\n\t\t\t\tif (0 <= dy) {\n\t\t\t\t\treturn 2; // Bottom\n\t\t\t\t} else {\n\t\t\t\t\treturn 0; // Top\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (0 <= dx) {\n\t\t\t\t\treturn 1; // Right\n\t\t\t\t} else {\n\t\t\t\t\treturn 3; // Left\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tlet d: number | null = null;\n\t\tlet result: 0 | 1 | 2 | 3 = 0;\n\t\tconst dd = dx * dx + dy * dy;\n\t\tif (this._threshold < dd) {\n\t\t\tconst f = 1 / Math.sqrt(dd);\n\t\t\tconst fx = dx * f;\n\t\t\tconst fy = dy * f;\n\t\t\tconst d0 = +nx * fx + ny * fy;\n\t\t\tconst d1 = -ny * fx + nx * fy;\n\t\t\tconst d2 = -d0;\n\t\t\tconst d3 = -d1;\n\t\t\tif (side & EShapeAcceptorEdgeSide.TOP) {\n\t\t\t\tif (d == null || d < d0) {\n\t\t\t\t\td = d0;\n\t\t\t\t\tresult = this.toSide(nx, ny);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (side & EShapeAcceptorEdgeSide.RIGHT) {\n\t\t\t\tif (d == null || d < d1) {\n\t\t\t\t\td = d1;\n\t\t\t\t\tresult = this.toSide(-ny, nx);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (side & EShapeAcceptorEdgeSide.BOTTOM) {\n\t\t\t\tif (d == null || d < d2) {\n\t\t\t\t\td = d2;\n\t\t\t\t\tresult = this.toSide(-nx, -ny);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (side & EShapeAcceptorEdgeSide.LEFT) {\n\t\t\t\tif (d == null || d < d3) {\n\t\t\t\t\td = d3;\n\t\t\t\t\tresult = this.toSide(ny, -nx);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}\n\n\tprotected toTailAxis(\n\t\tx: number,\n\t\ty: number,\n\t\tnx: number,\n\t\tny: number,\n\t\tside: EShapeAcceptorEdgeSide\n\t): 0 | 1 | 2 | 3 {\n\t\treturn this.toAxis(x - this.x, y - this.y, nx, ny, side);\n\t}\n\n\ttail(\n\t\tx: number,\n\t\ty: number,\n\t\tnx: number,\n\t\tny: number,\n\t\tsxh: number,\n\t\tsyh: number,\n\t\tmargin: number,\n\t\tside: EShapeAcceptorEdgeSide\n\t): void {\n\t\tswitch (this.toTailAxis(x, y, nx, ny, side)) {\n\t\t\tcase 0:\n\t\t\t\tif (this.y - margin <= y) {\n\t\t\t\t\tthis.y -= Math.max(margin, syh);\n\t\t\t\t\tthis.x = x;\n\t\t\t\t} else {\n\t\t\t\t\tthis.y = y;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\tif (x <= this.x + margin) {\n\t\t\t\t\tthis.x += Math.max(margin, sxh);\n\t\t\t\t\tthis.y = y;\n\t\t\t\t} else {\n\t\t\t\t\tthis.x = x;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tif (y <= this.y + margin) {\n\t\t\t\t\tthis.y += Math.max(margin, sxh);\n\t\t\t\t\tthis.x = x;\n\t\t\t\t} else {\n\t\t\t\t\tthis.y = y;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\tif (this.x - margin <= x) {\n\t\t\t\t\tthis.x -= Math.max(margin, sxh);\n\t\t\t\t\tthis.y = y;\n\t\t\t\t} else {\n\t\t\t\t\tthis.x = x;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tmiddle(x: number, y: number): void {\n\t\tconst dx = x - this._x;\n\t\tconst dy = y - this._y;\n\t\tif (Math.abs(dx) < Math.abs(dy)) {\n\t\t\tthis.y = y;\n\t\t} else {\n\t\t\tthis.x = x;\n\t\t}\n\t}\n\n\tprotected toHeadAxis(\n\t\tx: number,\n\t\ty: number,\n\t\tnx: number,\n\t\tny: number,\n\t\tside: EShapeAcceptorEdgeSide\n\t): 0 | 1 | 2 | 3 {\n\t\treturn this.toAxis(this.x - x, this.y - y, nx, ny, side);\n\t}\n\n\thead(\n\t\tx: number,\n\t\ty: number,\n\t\tnx: number,\n\t\tny: number,\n\t\tsxh: number,\n\t\tsyh: number,\n\t\tmargin: number,\n\t\tside: EShapeAcceptorEdgeSide\n\t): void {\n\t\tswitch (this.toHeadAxis(x, y, nx, ny, side)) {\n\t\t\tcase 0:\n\t\t\t\tif (y - margin <= this.y) {\n\t\t\t\t\tthis.y = y - Math.max(margin, syh);\n\t\t\t\t}\n\t\t\t\tthis.x = x;\n\t\t\t\tthis.y = y;\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\tif (this.x <= x + margin) {\n\t\t\t\t\tthis.x = x + Math.max(margin, sxh);\n\t\t\t\t}\n\t\t\t\tthis.y = y;\n\t\t\t\tthis.x = x;\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tif (this.y <= y + margin) {\n\t\t\t\t\tthis.y = y + Math.max(margin, syh);\n\t\t\t\t}\n\t\t\t\tthis.x = x;\n\t\t\t\tthis.y = y;\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\tif (x - margin <= this.x) {\n\t\t\t\t\tthis.x = x - Math.max(margin, sxh);\n\t\t\t\t}\n\t\t\t\tthis.y = y;\n\t\t\t\tthis.x = x;\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tmargin(tail: number, head: number): void {\n\t\tconst values = this._values;\n\n\t\t// Tail\n\t\tlet index = this.index;\n\t\tif (tail !== 0 && 2 <= index) {\n\t\t\tconst x0 = values[0];\n\t\t\tconst y0 = values[1];\n\t\t\tconst dx = values[2] - x0;\n\t\t\tconst dy = values[3] - y0;\n\t\t\tconst d = dx * dx + dy * dy;\n\t\t\tconst threshold = this._threshold;\n\t\t\tif (threshold < d) {\n\t\t\t\tconst f = tail / Math.sqrt(dx * dx + dy * dy);\n\t\t\t\tif (threshold < Math.abs(f - 1)) {\n\t\t\t\t\tvalues[0] = x0 + dx * f;\n\t\t\t\t\tvalues[1] = y0 + dy * f;\n\t\t\t\t} else {\n\t\t\t\t\tthis.index -= 2;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Head\n\t\tindex = this.index;\n\t\tif (head !== 0 && 2 <= index) {\n\t\t\tconst x1 = values[index + 0];\n\t\t\tconst y1 = values[index + 1];\n\t\t\tconst dx = values[index - 2] - x1;\n\t\t\tconst dy = values[index - 1] - y1;\n\t\t\tconst d = dx * dx + dy * dy;\n\t\t\tconst threshold = this._threshold;\n\t\t\tif (threshold < d) {\n\t\t\t\tconst f = head / Math.sqrt(dx * dx + dy * dy);\n\t\t\t\tif (threshold < Math.abs(f - 1)) {\n\t\t\t\t\tvalues[index + 0] = x1 + dx * f;\n\t\t\t\t\tvalues[index + 1] = y1 + dy * f;\n\t\t\t\t} else {\n\t\t\t\t\tthis.index -= 2;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Remote the rest\n\t\tvalues.length = this.index + 2;\n\t}\n}\n"]}
|
|
@@ -52,9 +52,9 @@ var EShapeEmbedded = /** @class */ (function (_super) {
|
|
|
52
52
|
var clt = child.transform.localTransform;
|
|
53
53
|
result.set(child.id, {
|
|
54
54
|
type: child.subtype,
|
|
55
|
-
x: this.
|
|
56
|
-
y: this.
|
|
57
|
-
normal: this.
|
|
55
|
+
x: this.toEdgePosition(lpx, clt.tx, sxh, sx),
|
|
56
|
+
y: this.toEdgePosition(lpy, clt.ty, syh, sy),
|
|
57
|
+
normal: this.toEdgeNormal(-clt.c, -clt.d),
|
|
58
58
|
size: {
|
|
59
59
|
x: 0,
|
|
60
60
|
y: 0
|
|
@@ -67,13 +67,13 @@ var EShapeEmbedded = /** @class */ (function (_super) {
|
|
|
67
67
|
}
|
|
68
68
|
return result;
|
|
69
69
|
};
|
|
70
|
-
EShapeEmbedded.prototype.
|
|
70
|
+
EShapeEmbedded.prototype.toEdgePosition = function (lp, cp, sh, s) {
|
|
71
71
|
if (0.00001 < Math.abs(s)) {
|
|
72
72
|
return (lp + cp - sh) / s;
|
|
73
73
|
}
|
|
74
74
|
return 0;
|
|
75
75
|
};
|
|
76
|
-
EShapeEmbedded.prototype.
|
|
76
|
+
EShapeEmbedded.prototype.toEdgeNormal = function (x, y) {
|
|
77
77
|
var d = x * x + y * y;
|
|
78
78
|
if (0.00001 < d) {
|
|
79
79
|
var f = 1 / d;
|
|
@@ -84,7 +84,7 @@ var EShapeEmbedded = /** @class */ (function (_super) {
|
|
|
84
84
|
}
|
|
85
85
|
return {
|
|
86
86
|
x: 0,
|
|
87
|
-
y: 1
|
|
87
|
+
y: -1
|
|
88
88
|
};
|
|
89
89
|
};
|
|
90
90
|
EShapeEmbedded.prototype.isGroupSizeFittable = function () {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"e-shape-embedded.js","sourceRoot":"","sources":["../../../../../src/main/typescript/wcardinal/ui/shape/variant/e-shape-embedded.ts"],"names":[],"mappings":";AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,wCAAwC,EAAE,MAAM,kDAAkD,CAAC;AAE5G,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAC;AAE9E,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MA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,sBAAsB,EAAE,CAAC;QAChC,MAAM,CAAC,OAAO,EAAE,CAAC;QACjB,OAAO,MAAM,CAAC;IACf,CAAC;IAES,iCAAQ,GAAlB;QACC,IAAM,WAAW,GAAG,IAAI,CAAC,WAAoC,CAAC;QAC9D,OAAO,IAAI,WAAW,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;IACxE,CAAC;IAED,0CAAiB,GAAjB,UAAkB,OAA2C;QAC5D,OAAO,EAAE,CAAC;IACX,CAAC;IAED,uCAAc,GAAd,UAAe,OAA2C;QACzD,OAAO,CAAC,CAAC,CAAC;IACX,CAAC;IAED,0CAAiB,GAAjB,UAAkB,OAA2C;QAC5D,OAAO,CAAC,CAAC,CAAC;IACX,CAAC;IAED,kCAAS,GAAT,UAAU,OAA2C;QACpD,IAAM,MAAM,GAAG,iBAAM,SAAS,YAAC,OAAO,CAAC,CAAC;QACxC,MAAM,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC1C,OAAO,MAAM,CAAC;IACf,CAAC;IAED,gCAAO,GAAP,UAAQ,OAA2C;QAClD,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACxC,CAAC;IAED,mCAAU,GAAV,UAAW,OAA2C;QACrD,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC3C,CAAC;IACF,qBAAC;AAAD,CAAC,AA/ID,CAAoC,iBAAiB,GA+IpD","sourcesContent":["import { DDiagramSerializedItem } from \"../../d-diagram-serialized\";\nimport { EShapeAcceptorEdge } from \"../e-shape-acceptor-edge\";\nimport { EShapeAcceptorEdgeNormal } from \"../e-shape-acceptor-edge-normal\";\nimport { EShapeDefaults } from \"../e-shape-defaults\";\nimport { EShapeResourceManagerDeserializationMode } from \"../e-shape-resource-manager-deserialization-mode\";\nimport { EShapeResourceManagerSerialization } from \"../e-shape-resource-manager-serialization\";\nimport { EShapeType } from \"../e-shape-type\";\nimport { EShapeEmbeddedAcceptorEdge } from \"./e-shape-embedded-acceptor-edge\";\nimport { EShapeGroupSize } from \"./e-shape-group-size\";\nimport { EShapeGroupSizeEditor } from \"./e-shape-group-size-editor\";\nimport { EShapeGroupSizeViewer } from \"./e-shape-group-size-viewer\";\nimport { EShapeGroupViewer } from \"./e-shape-group-viewer\";\n\nexport class EShapeEmbedded extends EShapeGroupViewer {\n\tprotected _name: string;\n\tprotected _edges?: Map<string, EShapeAcceptorEdge>;\n\n\tconstructor(\n\t\tname: string,\n\t\tmode: EShapeResourceManagerDeserializationMode,\n\t\tdepth: number,\n\t\ttype: EShapeType = EShapeType.EMBEDDED\n\t) {\n\t\tsuper(mode, depth, type);\n\t\tthis._name = name;\n\t\tthis._depth = depth;\n\t}\n\n\tget name(): string {\n\t\treturn this._name;\n\t}\n\n\tget edges(): Map<string, EShapeAcceptorEdge> {\n\t\treturn (this._edges ??= this.newEdges());\n\t}\n\n\tprotected newEdges(): Map<string, EShapeAcceptorEdge> {\n\t\tconst result = new Map<string, EShapeAcceptorEdge>();\n\t\tconst layers = this.children;\n\t\tif (layers != null) {\n\t\t\tconst s = this.size;\n\t\t\tconst sx = s.x;\n\t\t\tconst sy = s.y;\n\t\t\tconst sxh = sx * 0.5;\n\t\t\tconst syh = sy * 0.5;\n\t\t\tfor (let i = 0, imax = layers.length; i < imax; ++i) {\n\t\t\t\tconst layer = layers[i];\n\t\t\t\tconst lp = layer.transform.position;\n\t\t\t\tconst lpx = lp.x + sxh;\n\t\t\t\tconst lpy = lp.y + syh;\n\t\t\t\tconst children = layer.children;\n\t\t\t\tfor (let j = 0, jmax = children.length; j < jmax; ++j) {\n\t\t\t\t\tconst child = children[j];\n\t\t\t\t\tif (child instanceof EShapeEmbeddedAcceptorEdge) {\n\t\t\t\t\t\tchild.transform.updateLocalTransform();\n\t\t\t\t\t\tconst clt = child.transform.localTransform;\n\t\t\t\t\t\tresult.set(child.id, {\n\t\t\t\t\t\t\ttype: child.subtype,\n\t\t\t\t\t\t\tx: this.toEdgePosition(lpx, clt.tx, sxh, sx),\n\t\t\t\t\t\t\ty: this.toEdgePosition(lpy, clt.ty, syh, sy),\n\t\t\t\t\t\t\tnormal: this.toEdgeNormal(-clt.c, -clt.d),\n\t\t\t\t\t\t\tsize: {\n\t\t\t\t\t\t\t\tx: 0,\n\t\t\t\t\t\t\t\ty: 0\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tside: child.side\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}\n\n\tprotected toEdgePosition(lp: number, cp: number, sh: number, s: number): number {\n\t\tif (0.00001 < Math.abs(s)) {\n\t\t\treturn (lp + cp - sh) / s;\n\t\t}\n\t\treturn 0;\n\t}\n\n\tprotected toEdgeNormal(x: number, y: number): EShapeAcceptorEdgeNormal {\n\t\tconst d = x * x + y * y;\n\t\tif (0.00001 < d) {\n\t\t\tconst f = 1 / d;\n\t\t\treturn {\n\t\t\t\tx: x * f,\n\t\t\t\ty: y * f\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\tx: 0,\n\t\t\ty: -1\n\t\t};\n\t}\n\n\tprotected isGroupSizeFittable(): boolean {\n\t\treturn false;\n\t}\n\n\tprotected newGroupSize(\n\t\tmode: EShapeResourceManagerDeserializationMode,\n\t\tdepth: number\n\t): EShapeGroupSize {\n\t\tconst sizeX = EShapeDefaults.SIZE_X;\n\t\tconst sizeY = EShapeDefaults.SIZE_Y;\n\t\tif (mode !== EShapeResourceManagerDeserializationMode.VIEWER && depth <= 0) {\n\t\t\treturn new EShapeGroupSizeEditor(this, sizeX, sizeY, this.isGroupSizeFittable());\n\t\t} else {\n\t\t\treturn new EShapeGroupSizeViewer(this, sizeX, sizeY, sizeX, sizeY);\n\t\t}\n\t}\n\n\tclone(): EShapeEmbedded {\n\t\tconst result = this.newClone().copy(this);\n\t\tconst children = this.children;\n\t\tfor (let i = 0, imax = children.length; i < imax; ++i) {\n\t\t\tconst clone = children[i].clone();\n\t\t\tclone.parent = result;\n\t\t\tresult.children.push(clone);\n\t\t}\n\t\tresult.onChildTransformChange();\n\t\tresult.toDirty();\n\t\treturn result;\n\t}\n\n\tprotected newClone(): EShapeEmbedded {\n\t\tconst constructor = this.constructor as typeof EShapeEmbedded;\n\t\treturn new constructor(this._name, this._mode, this._depth, this.type);\n\t}\n\n\tserializeChildren(manager: EShapeResourceManagerSerialization): DDiagramSerializedItem[] {\n\t\treturn [];\n\t}\n\n\tserializeImage(manager: EShapeResourceManagerSerialization): number {\n\t\treturn -1;\n\t}\n\n\tserializeGradient(manager: EShapeResourceManagerSerialization): number {\n\t\treturn -1;\n\t}\n\n\tserialize(manager: EShapeResourceManagerSerialization): DDiagramSerializedItem {\n\t\tconst result = super.serialize(manager);\n\t\tresult[15] = manager.addPiece(this._name);\n\t\treturn result;\n\t}\n\n\taddUuid(manager: EShapeResourceManagerSerialization): void {\n\t\tthis.uuid = manager.addUuid(this.uuid);\n\t}\n\n\tupdateUuid(manager: EShapeResourceManagerSerialization): void {\n\t\tthis.uuid = manager.updateUuid(this.uuid);\n\t}\n}\n"]}
|
package/dist/wcardinal-ui.cjs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Winter Cardinal UI v0.
|
|
2
|
+
Winter Cardinal UI v0.349.0
|
|
3
3
|
Copyright (C) 2019 Toshiba Corporation
|
|
4
4
|
SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
|
|
@@ -17728,9 +17728,9 @@ var EShapeEmbedded = /** @class */ (function (_super) {
|
|
|
17728
17728
|
var clt = child.transform.localTransform;
|
|
17729
17729
|
result.set(child.id, {
|
|
17730
17730
|
type: child.subtype,
|
|
17731
|
-
x: this.
|
|
17732
|
-
y: this.
|
|
17733
|
-
normal: this.
|
|
17731
|
+
x: this.toEdgePosition(lpx, clt.tx, sxh, sx),
|
|
17732
|
+
y: this.toEdgePosition(lpy, clt.ty, syh, sy),
|
|
17733
|
+
normal: this.toEdgeNormal(-clt.c, -clt.d),
|
|
17734
17734
|
size: {
|
|
17735
17735
|
x: 0,
|
|
17736
17736
|
y: 0
|
|
@@ -17743,13 +17743,13 @@ var EShapeEmbedded = /** @class */ (function (_super) {
|
|
|
17743
17743
|
}
|
|
17744
17744
|
return result;
|
|
17745
17745
|
};
|
|
17746
|
-
EShapeEmbedded.prototype.
|
|
17746
|
+
EShapeEmbedded.prototype.toEdgePosition = function (lp, cp, sh, s) {
|
|
17747
17747
|
if (0.00001 < Math.abs(s)) {
|
|
17748
17748
|
return (lp + cp - sh) / s;
|
|
17749
17749
|
}
|
|
17750
17750
|
return 0;
|
|
17751
17751
|
};
|
|
17752
|
-
EShapeEmbedded.prototype.
|
|
17752
|
+
EShapeEmbedded.prototype.toEdgeNormal = function (x, y) {
|
|
17753
17753
|
var d = x * x + y * y;
|
|
17754
17754
|
if (0.00001 < d) {
|
|
17755
17755
|
var f = 1 / d;
|
|
@@ -17760,7 +17760,7 @@ var EShapeEmbedded = /** @class */ (function (_super) {
|
|
|
17760
17760
|
}
|
|
17761
17761
|
return {
|
|
17762
17762
|
x: 0,
|
|
17763
|
-
y: 1
|
|
17763
|
+
y: -1
|
|
17764
17764
|
};
|
|
17765
17765
|
};
|
|
17766
17766
|
EShapeEmbedded.prototype.isGroupSizeFittable = function () {
|
|
@@ -38267,18 +38267,18 @@ var EShapeConnectorElbowPointsFiller = /** @class */ (function () {
|
|
|
38267
38267
|
// y = -x => 0 = x + y
|
|
38268
38268
|
if (0 <= x - y) {
|
|
38269
38269
|
if (0 <= x + y) {
|
|
38270
|
-
return
|
|
38270
|
+
return 1;
|
|
38271
38271
|
}
|
|
38272
38272
|
else {
|
|
38273
|
-
return
|
|
38273
|
+
return 0;
|
|
38274
38274
|
}
|
|
38275
38275
|
}
|
|
38276
38276
|
else {
|
|
38277
38277
|
if (0 <= x + y) {
|
|
38278
|
-
return
|
|
38278
|
+
return 2;
|
|
38279
38279
|
}
|
|
38280
38280
|
else {
|
|
38281
|
-
return
|
|
38281
|
+
return 3;
|
|
38282
38282
|
}
|
|
38283
38283
|
}
|
|
38284
38284
|
};
|
|
@@ -38307,40 +38307,38 @@ var EShapeConnectorElbowPointsFiller = /** @class */ (function () {
|
|
|
38307
38307
|
}
|
|
38308
38308
|
var d = null;
|
|
38309
38309
|
var result = 0;
|
|
38310
|
-
|
|
38311
|
-
|
|
38312
|
-
|
|
38313
|
-
|
|
38314
|
-
|
|
38315
|
-
|
|
38316
|
-
|
|
38317
|
-
|
|
38318
|
-
|
|
38319
|
-
|
|
38320
|
-
|
|
38321
|
-
|
|
38322
|
-
|
|
38323
|
-
|
|
38324
|
-
|
|
38325
|
-
|
|
38326
|
-
|
|
38327
|
-
|
|
38328
|
-
|
|
38329
|
-
|
|
38330
|
-
|
|
38331
|
-
|
|
38332
|
-
|
|
38333
|
-
|
|
38334
|
-
|
|
38335
|
-
|
|
38336
|
-
|
|
38337
|
-
|
|
38338
|
-
|
|
38339
|
-
|
|
38340
|
-
|
|
38341
|
-
|
|
38342
|
-
d = -dx;
|
|
38343
|
-
result = 3;
|
|
38310
|
+
var dd = dx * dx + dy * dy;
|
|
38311
|
+
if (this._threshold < dd) {
|
|
38312
|
+
var f = 1 / Math.sqrt(dd);
|
|
38313
|
+
var fx = dx * f;
|
|
38314
|
+
var fy = dy * f;
|
|
38315
|
+
var d0 = +nx * fx + ny * fy;
|
|
38316
|
+
var d1 = -ny * fx + nx * fy;
|
|
38317
|
+
var d2 = -d0;
|
|
38318
|
+
var d3 = -d1;
|
|
38319
|
+
if (side & EShapeAcceptorEdgeSide.TOP) {
|
|
38320
|
+
if (d == null || d < d0) {
|
|
38321
|
+
d = d0;
|
|
38322
|
+
result = this.toSide(nx, ny);
|
|
38323
|
+
}
|
|
38324
|
+
}
|
|
38325
|
+
if (side & EShapeAcceptorEdgeSide.RIGHT) {
|
|
38326
|
+
if (d == null || d < d1) {
|
|
38327
|
+
d = d1;
|
|
38328
|
+
result = this.toSide(-ny, nx);
|
|
38329
|
+
}
|
|
38330
|
+
}
|
|
38331
|
+
if (side & EShapeAcceptorEdgeSide.BOTTOM) {
|
|
38332
|
+
if (d == null || d < d2) {
|
|
38333
|
+
d = d2;
|
|
38334
|
+
result = this.toSide(-nx, -ny);
|
|
38335
|
+
}
|
|
38336
|
+
}
|
|
38337
|
+
if (side & EShapeAcceptorEdgeSide.LEFT) {
|
|
38338
|
+
if (d == null || d < d3) {
|
|
38339
|
+
d = d3;
|
|
38340
|
+
result = this.toSide(ny, -nx);
|
|
38341
|
+
}
|
|
38344
38342
|
}
|
|
38345
38343
|
}
|
|
38346
38344
|
return result;
|
package/dist/wcardinal-ui.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Winter Cardinal UI v0.
|
|
2
|
+
Winter Cardinal UI v0.349.0
|
|
3
3
|
Copyright (C) 2019 Toshiba Corporation
|
|
4
4
|
SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
|
|
@@ -17725,9 +17725,9 @@
|
|
|
17725
17725
|
var clt = child.transform.localTransform;
|
|
17726
17726
|
result.set(child.id, {
|
|
17727
17727
|
type: child.subtype,
|
|
17728
|
-
x: this.
|
|
17729
|
-
y: this.
|
|
17730
|
-
normal: this.
|
|
17728
|
+
x: this.toEdgePosition(lpx, clt.tx, sxh, sx),
|
|
17729
|
+
y: this.toEdgePosition(lpy, clt.ty, syh, sy),
|
|
17730
|
+
normal: this.toEdgeNormal(-clt.c, -clt.d),
|
|
17731
17731
|
size: {
|
|
17732
17732
|
x: 0,
|
|
17733
17733
|
y: 0
|
|
@@ -17740,13 +17740,13 @@
|
|
|
17740
17740
|
}
|
|
17741
17741
|
return result;
|
|
17742
17742
|
};
|
|
17743
|
-
EShapeEmbedded.prototype.
|
|
17743
|
+
EShapeEmbedded.prototype.toEdgePosition = function (lp, cp, sh, s) {
|
|
17744
17744
|
if (0.00001 < Math.abs(s)) {
|
|
17745
17745
|
return (lp + cp - sh) / s;
|
|
17746
17746
|
}
|
|
17747
17747
|
return 0;
|
|
17748
17748
|
};
|
|
17749
|
-
EShapeEmbedded.prototype.
|
|
17749
|
+
EShapeEmbedded.prototype.toEdgeNormal = function (x, y) {
|
|
17750
17750
|
var d = x * x + y * y;
|
|
17751
17751
|
if (0.00001 < d) {
|
|
17752
17752
|
var f = 1 / d;
|
|
@@ -17757,7 +17757,7 @@
|
|
|
17757
17757
|
}
|
|
17758
17758
|
return {
|
|
17759
17759
|
x: 0,
|
|
17760
|
-
y: 1
|
|
17760
|
+
y: -1
|
|
17761
17761
|
};
|
|
17762
17762
|
};
|
|
17763
17763
|
EShapeEmbedded.prototype.isGroupSizeFittable = function () {
|
|
@@ -38264,18 +38264,18 @@
|
|
|
38264
38264
|
// y = -x => 0 = x + y
|
|
38265
38265
|
if (0 <= x - y) {
|
|
38266
38266
|
if (0 <= x + y) {
|
|
38267
|
-
return
|
|
38267
|
+
return 1;
|
|
38268
38268
|
}
|
|
38269
38269
|
else {
|
|
38270
|
-
return
|
|
38270
|
+
return 0;
|
|
38271
38271
|
}
|
|
38272
38272
|
}
|
|
38273
38273
|
else {
|
|
38274
38274
|
if (0 <= x + y) {
|
|
38275
|
-
return
|
|
38275
|
+
return 2;
|
|
38276
38276
|
}
|
|
38277
38277
|
else {
|
|
38278
|
-
return
|
|
38278
|
+
return 3;
|
|
38279
38279
|
}
|
|
38280
38280
|
}
|
|
38281
38281
|
};
|
|
@@ -38304,40 +38304,38 @@
|
|
|
38304
38304
|
}
|
|
38305
38305
|
var d = null;
|
|
38306
38306
|
var result = 0;
|
|
38307
|
-
|
|
38308
|
-
|
|
38309
|
-
|
|
38310
|
-
|
|
38311
|
-
|
|
38312
|
-
|
|
38313
|
-
|
|
38314
|
-
|
|
38315
|
-
|
|
38316
|
-
|
|
38317
|
-
|
|
38318
|
-
|
|
38319
|
-
|
|
38320
|
-
|
|
38321
|
-
|
|
38322
|
-
|
|
38323
|
-
|
|
38324
|
-
|
|
38325
|
-
|
|
38326
|
-
|
|
38327
|
-
|
|
38328
|
-
|
|
38329
|
-
|
|
38330
|
-
|
|
38331
|
-
|
|
38332
|
-
|
|
38333
|
-
|
|
38334
|
-
|
|
38335
|
-
|
|
38336
|
-
|
|
38337
|
-
|
|
38338
|
-
|
|
38339
|
-
d = -dx;
|
|
38340
|
-
result = 3;
|
|
38307
|
+
var dd = dx * dx + dy * dy;
|
|
38308
|
+
if (this._threshold < dd) {
|
|
38309
|
+
var f = 1 / Math.sqrt(dd);
|
|
38310
|
+
var fx = dx * f;
|
|
38311
|
+
var fy = dy * f;
|
|
38312
|
+
var d0 = +nx * fx + ny * fy;
|
|
38313
|
+
var d1 = -ny * fx + nx * fy;
|
|
38314
|
+
var d2 = -d0;
|
|
38315
|
+
var d3 = -d1;
|
|
38316
|
+
if (side & EShapeAcceptorEdgeSide.TOP) {
|
|
38317
|
+
if (d == null || d < d0) {
|
|
38318
|
+
d = d0;
|
|
38319
|
+
result = this.toSide(nx, ny);
|
|
38320
|
+
}
|
|
38321
|
+
}
|
|
38322
|
+
if (side & EShapeAcceptorEdgeSide.RIGHT) {
|
|
38323
|
+
if (d == null || d < d1) {
|
|
38324
|
+
d = d1;
|
|
38325
|
+
result = this.toSide(-ny, nx);
|
|
38326
|
+
}
|
|
38327
|
+
}
|
|
38328
|
+
if (side & EShapeAcceptorEdgeSide.BOTTOM) {
|
|
38329
|
+
if (d == null || d < d2) {
|
|
38330
|
+
d = d2;
|
|
38331
|
+
result = this.toSide(-nx, -ny);
|
|
38332
|
+
}
|
|
38333
|
+
}
|
|
38334
|
+
if (side & EShapeAcceptorEdgeSide.LEFT) {
|
|
38335
|
+
if (d == null || d < d3) {
|
|
38336
|
+
d = d3;
|
|
38337
|
+
result = this.toSide(ny, -nx);
|
|
38338
|
+
}
|
|
38341
38339
|
}
|
|
38342
38340
|
}
|
|
38343
38341
|
return result;
|