@wcardinal/wcardinal-ui 0.322.0 → 0.324.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/e-shape-acceptor-edge-type.d.ts +6 -0
- package/dist/types/wcardinal/ui/shape/e-shape-acceptor-edge.d.ts +2 -2
- package/dist/types/wcardinal/ui/shape/e-shape-acceptor-impl.d.ts +6 -5
- package/dist/types/wcardinal/ui/shape/e-shape-acceptor-type.d.ts +6 -0
- package/dist/types/wcardinal/ui/shape/index.d.ts +1 -0
- package/dist/wcardinal/ui/shape/e-shape-acceptor-edge-type.js +10 -0
- package/dist/wcardinal/ui/shape/e-shape-acceptor-edge-type.js.map +1 -0
- package/dist/wcardinal/ui/shape/e-shape-acceptor-edge.js.map +1 -1
- package/dist/wcardinal/ui/shape/e-shape-acceptor-impl.js +24 -2
- package/dist/wcardinal/ui/shape/e-shape-acceptor-impl.js.map +1 -1
- package/dist/wcardinal/ui/shape/e-shape-acceptor-type.js +5 -5
- package/dist/wcardinal/ui/shape/e-shape-acceptor-type.js.map +1 -1
- package/dist/wcardinal/ui/shape/e-shape-acceptors.js +10 -10
- package/dist/wcardinal/ui/shape/e-shape-acceptors.js.map +1 -1
- package/dist/wcardinal/ui/shape/index.js +1 -0
- package/dist/wcardinal/ui/shape/index.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/e-shape-connector-elbow-points-filler.js +10 -10
- package/dist/wcardinal/ui/shape/variant/e-shape-connector-elbow-points-filler.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 +60 -32
- package/dist/wcardinal-ui.js +60 -32
- package/dist/wcardinal-ui.min.js +2 -2
- package/dist/wcardinal-ui.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { EShapeAcceptorEdgeNormal } from "./e-shape-acceptor-edge-normal";
|
|
2
2
|
import { EShapeAcceptorEdgeSide } from "./e-shape-acceptor-edge-side";
|
|
3
3
|
import { EShapeAcceptorEdgeSize } from "./e-shape-acceptor-edge-size";
|
|
4
|
-
import {
|
|
4
|
+
import { EShapeAcceptorEdgeType } from "./e-shape-acceptor-edge-type";
|
|
5
5
|
export interface EShapeAcceptorEdge {
|
|
6
|
-
type:
|
|
6
|
+
type: EShapeAcceptorEdgeType;
|
|
7
7
|
x: number;
|
|
8
8
|
y: number;
|
|
9
9
|
normal: EShapeAcceptorEdgeNormal;
|
|
@@ -3,15 +3,16 @@ import { EShapeAcceptor } from "./e-shape-acceptor";
|
|
|
3
3
|
import { EShapeAcceptorEdge } from "./e-shape-acceptor-edge";
|
|
4
4
|
import { EShapeAcceptorEdgeNormal } from "./e-shape-acceptor-edge-normal";
|
|
5
5
|
import { EShapeAcceptorEdgeSide } from "./e-shape-acceptor-edge-side";
|
|
6
|
-
import {
|
|
6
|
+
import { EShapeAcceptorEdgeType } from "./e-shape-acceptor-edge-type";
|
|
7
7
|
export declare class EShapeAcceptorImpl implements EShapeAcceptor {
|
|
8
8
|
protected _edges: Map<string, EShapeAcceptorEdge>;
|
|
9
9
|
constructor();
|
|
10
|
-
add(id: string, type:
|
|
11
|
-
add(id: string, type:
|
|
12
|
-
add(id: string, type:
|
|
13
|
-
add(id: string, type:
|
|
10
|
+
add(id: string, type: EShapeAcceptorEdgeType | keyof typeof EShapeAcceptorEdgeType, x: number, y: number): boolean;
|
|
11
|
+
add(id: string, type: EShapeAcceptorEdgeType | keyof typeof EShapeAcceptorEdgeType, x: number, y: number, nx: number, ny: number): boolean;
|
|
12
|
+
add(id: string, type: EShapeAcceptorEdgeType | keyof typeof EShapeAcceptorEdgeType, x: number, y: number, nx: number, ny: number, sx: number, sy: number): boolean;
|
|
13
|
+
add(id: string, type: EShapeAcceptorEdgeType | keyof typeof EShapeAcceptorEdgeType, x: number, y: number, nx: number, ny: number, sx: number, sy: number, side: EShapeAcceptorEdgeSide | keyof typeof EShapeAcceptorEdgeSide | Array<keyof typeof EShapeAcceptorEdgeSide>): boolean;
|
|
14
14
|
protected toNormal(x: number, y: number, nx?: number, ny?: number): EShapeAcceptorEdgeNormal;
|
|
15
|
+
protected toSide(side?: EShapeAcceptorEdgeSide | keyof typeof EShapeAcceptorEdgeSide | Array<keyof typeof EShapeAcceptorEdgeSide>): EShapeAcceptorEdgeSide;
|
|
15
16
|
remove(id: string): EShapeAcceptorEdge | null;
|
|
16
17
|
size(): number;
|
|
17
18
|
get(shape: EShape, id: string): EShapeAcceptorEdge | null;
|
|
@@ -1,6 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @deprecated in favor of {@link EShapeAcceptorEdgeType}.
|
|
3
|
+
*/
|
|
1
4
|
export declare const EShapeAcceptorType: {
|
|
2
5
|
readonly TAIL: 1;
|
|
3
6
|
readonly HEAD: 2;
|
|
4
7
|
readonly ALL: 3;
|
|
5
8
|
};
|
|
9
|
+
/**
|
|
10
|
+
* @deprecated in favor of {@link EShapeAcceptorEdgeType}.
|
|
11
|
+
*/
|
|
6
12
|
export declare type EShapeAcceptorType = typeof EShapeAcceptorType[keyof typeof EShapeAcceptorType];
|
|
@@ -4,6 +4,7 @@ export * from "./variant";
|
|
|
4
4
|
export * from "./e-shape-acceptor-edge-normal";
|
|
5
5
|
export * from "./e-shape-acceptor-edge-side";
|
|
6
6
|
export * from "./e-shape-acceptor-edge-size";
|
|
7
|
+
export * from "./e-shape-acceptor-edge-type";
|
|
7
8
|
export * from "./e-shape-acceptor-edge";
|
|
8
9
|
export * from "./e-shape-acceptor-impl";
|
|
9
10
|
export * from "./e-shape-acceptor-type";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"e-shape-acceptor-edge-type.js","sourceRoot":"","sources":["../../../../src/main/typescript/wcardinal/ui/shape/e-shape-acceptor-edge-type.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,CAAC,IAAM,sBAAsB,GAAG;IACrC,IAAI,EAAE,CAAC;IACP,IAAI,EAAE,CAAC;IACP,GAAG,EAAE,CAAC;CACG,CAAC","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport const EShapeAcceptorEdgeType = {\n\tTAIL: 1,\n\tHEAD: 2,\n\tALL: 3\n} as const;\n\nexport type EShapeAcceptorEdgeType =\n\ttypeof EShapeAcceptorEdgeType[keyof typeof EShapeAcceptorEdgeType];\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"e-shape-acceptor-edge.js","sourceRoot":"","sources":["../../../../src/main/typescript/wcardinal/ui/shape/e-shape-acceptor-edge.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { EShapeAcceptorEdgeNormal } from \"./e-shape-acceptor-edge-normal\";\nimport { EShapeAcceptorEdgeSide } from \"./e-shape-acceptor-edge-side\";\nimport { EShapeAcceptorEdgeSize } from \"./e-shape-acceptor-edge-size\";\nimport {
|
|
1
|
+
{"version":3,"file":"e-shape-acceptor-edge.js","sourceRoot":"","sources":["../../../../src/main/typescript/wcardinal/ui/shape/e-shape-acceptor-edge.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { EShapeAcceptorEdgeNormal } from \"./e-shape-acceptor-edge-normal\";\nimport { EShapeAcceptorEdgeSide } from \"./e-shape-acceptor-edge-side\";\nimport { EShapeAcceptorEdgeSize } from \"./e-shape-acceptor-edge-size\";\nimport { EShapeAcceptorEdgeType } from \"./e-shape-acceptor-edge-type\";\n\nexport interface EShapeAcceptorEdge {\n\ttype: EShapeAcceptorEdgeType;\n\tx: number;\n\ty: number;\n\tnormal: EShapeAcceptorEdgeNormal;\n\tsize: EShapeAcceptorEdgeSize;\n\tside: EShapeAcceptorEdgeSide;\n}\n"]}
|
|
@@ -2,14 +2,18 @@
|
|
|
2
2
|
* Copyright (C) 2019 Toshiba Corporation
|
|
3
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
*/
|
|
5
|
+
import { isNumber } from "../util/is-number";
|
|
6
|
+
import { isString } from "../util/is-string";
|
|
7
|
+
import { toEnum } from "../util/to-enum";
|
|
5
8
|
import { EShapeAcceptorEdgeSide } from "./e-shape-acceptor-edge-side";
|
|
9
|
+
import { EShapeAcceptorEdgeType } from "./e-shape-acceptor-edge-type";
|
|
6
10
|
var EShapeAcceptorImpl = /** @class */ (function () {
|
|
7
11
|
function EShapeAcceptorImpl() {
|
|
8
12
|
this._edges = new Map();
|
|
9
13
|
}
|
|
10
14
|
EShapeAcceptorImpl.prototype.add = function (id, type, x, y, nx, ny, sx, sy, side) {
|
|
11
15
|
this._edges.set(id, {
|
|
12
|
-
type: type,
|
|
16
|
+
type: toEnum(type, EShapeAcceptorEdgeType),
|
|
13
17
|
x: x,
|
|
14
18
|
y: y,
|
|
15
19
|
normal: this.toNormal(x, y, nx, ny),
|
|
@@ -17,7 +21,7 @@ var EShapeAcceptorImpl = /** @class */ (function () {
|
|
|
17
21
|
x: sx !== null && sx !== void 0 ? sx : 0,
|
|
18
22
|
y: sy !== null && sy !== void 0 ? sy : 0
|
|
19
23
|
},
|
|
20
|
-
side: side
|
|
24
|
+
side: this.toSide(side)
|
|
21
25
|
});
|
|
22
26
|
return true;
|
|
23
27
|
};
|
|
@@ -45,6 +49,24 @@ var EShapeAcceptorImpl = /** @class */ (function () {
|
|
|
45
49
|
}
|
|
46
50
|
}
|
|
47
51
|
};
|
|
52
|
+
EShapeAcceptorImpl.prototype.toSide = function (side) {
|
|
53
|
+
if (side == null) {
|
|
54
|
+
return EShapeAcceptorEdgeSide.TOP;
|
|
55
|
+
}
|
|
56
|
+
else if (isNumber(side)) {
|
|
57
|
+
return side;
|
|
58
|
+
}
|
|
59
|
+
else if (isString(side)) {
|
|
60
|
+
return toEnum(side, EShapeAcceptorEdgeSide);
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
var result = EShapeAcceptorEdgeSide.NONE;
|
|
64
|
+
for (var i = 0, imax = side.length; i < imax; ++i) {
|
|
65
|
+
result |= toEnum(side[i], EShapeAcceptorEdgeSide);
|
|
66
|
+
}
|
|
67
|
+
return result;
|
|
68
|
+
}
|
|
69
|
+
};
|
|
48
70
|
EShapeAcceptorImpl.prototype.remove = function (id) {
|
|
49
71
|
var edges = this._edges;
|
|
50
72
|
var result = edges.get(id);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"e-shape-acceptor-impl.js","sourceRoot":"","sources":["../../../../src/main/typescript/wcardinal/ui/shape/e-shape-acceptor-impl.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"e-shape-acceptor-impl.js","sourceRoot":"","sources":["../../../../src/main/typescript/wcardinal/ui/shape/e-shape-acceptor-impl.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAKzC,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AACtE,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAEtE;IAGC;QACC,IAAI,CAAC,MAAM,GAAG,IAAI,GAAG,EAA8B,CAAC;IACrD,CAAC;IAwCD,gCAAG,GAAH,UACC,EAAU,EACV,IAAkE,EAClE,CAAS,EACT,CAAS,EACT,EAAW,EACX,EAAW,EACX,EAAW,EACX,EAAW,EACX,IAG6C;QAE7C,IAAI,CAAC,MAAM,C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IAAI,CAAC,MAAM,CAAC;QAC1B,IAAI,CAAC,GAAG,KAAK,CAAC,IAAI,EAAE;YACnB,KAAK,CAAC,KAAK,EAAE,CAAC;YACd,OAAO,IAAI,CAAC;SACZ;QACD,OAAO,KAAK,CAAC;IACd,CAAC;IACF,yBAAC;AAAD,CAAC,AAxJD,IAwJC","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { isNumber } from \"../util/is-number\";\nimport { isString } from \"../util/is-string\";\nimport { toEnum } from \"../util/to-enum\";\nimport { EShape } from \"./e-shape\";\nimport { EShapeAcceptor } from \"./e-shape-acceptor\";\nimport { EShapeAcceptorEdge } from \"./e-shape-acceptor-edge\";\nimport { EShapeAcceptorEdgeNormal } from \"./e-shape-acceptor-edge-normal\";\nimport { EShapeAcceptorEdgeSide } from \"./e-shape-acceptor-edge-side\";\nimport { EShapeAcceptorEdgeType } from \"./e-shape-acceptor-edge-type\";\n\nexport class EShapeAcceptorImpl implements EShapeAcceptor {\n\tprotected _edges: Map<string, EShapeAcceptorEdge>;\n\n\tconstructor() {\n\t\tthis._edges = new Map<string, EShapeAcceptorEdge>();\n\t}\n\n\tadd(\n\t\tid: string,\n\t\ttype: EShapeAcceptorEdgeType | keyof typeof EShapeAcceptorEdgeType,\n\t\tx: number,\n\t\ty: number\n\t): boolean;\n\tadd(\n\t\tid: string,\n\t\ttype: EShapeAcceptorEdgeType | keyof typeof EShapeAcceptorEdgeType,\n\t\tx: number,\n\t\ty: number,\n\t\tnx: number,\n\t\tny: number\n\t): boolean;\n\tadd(\n\t\tid: string,\n\t\ttype: EShapeAcceptorEdgeType | keyof typeof EShapeAcceptorEdgeType,\n\t\tx: number,\n\t\ty: number,\n\t\tnx: number,\n\t\tny: number,\n\t\tsx: number,\n\t\tsy: number\n\t): boolean;\n\tadd(\n\t\tid: string,\n\t\ttype: EShapeAcceptorEdgeType | keyof typeof EShapeAcceptorEdgeType,\n\t\tx: number,\n\t\ty: number,\n\t\tnx: number,\n\t\tny: number,\n\t\tsx: number,\n\t\tsy: number,\n\t\tside:\n\t\t\t| EShapeAcceptorEdgeSide\n\t\t\t| keyof typeof EShapeAcceptorEdgeSide\n\t\t\t| Array<keyof typeof EShapeAcceptorEdgeSide>\n\t): boolean;\n\tadd(\n\t\tid: string,\n\t\ttype: EShapeAcceptorEdgeType | keyof typeof EShapeAcceptorEdgeType,\n\t\tx: number,\n\t\ty: number,\n\t\tnx?: number,\n\t\tny?: number,\n\t\tsx?: number,\n\t\tsy?: number,\n\t\tside?:\n\t\t\t| EShapeAcceptorEdgeSide\n\t\t\t| keyof typeof EShapeAcceptorEdgeSide\n\t\t\t| Array<keyof typeof EShapeAcceptorEdgeSide>\n\t): boolean {\n\t\tthis._edges.set(id, {\n\t\t\ttype: toEnum(type, EShapeAcceptorEdgeType),\n\t\t\tx,\n\t\t\ty,\n\t\t\tnormal: this.toNormal(x, y, nx, ny),\n\t\t\tsize: {\n\t\t\t\tx: sx ?? 0,\n\t\t\t\ty: sy ?? 0\n\t\t\t},\n\t\t\tside: this.toSide(side)\n\t\t});\n\t\treturn true;\n\t}\n\n\tprotected toNormal(x: number, y: number, nx?: number, ny?: number): EShapeAcceptorEdgeNormal {\n\t\tif (nx != null && ny != null) {\n\t\t\treturn {\n\t\t\t\tx: nx,\n\t\t\t\ty: ny\n\t\t\t};\n\t\t} else {\n\t\t\tconst d = x * x + y * y;\n\t\t\tif (0.00001 < d) {\n\t\t\t\tconst m = 1 / Math.sqrt(d);\n\t\t\t\treturn {\n\t\t\t\t\tx: x * m,\n\t\t\t\t\ty: y * m\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\treturn {\n\t\t\t\t\tx: 0,\n\t\t\t\t\ty: 0\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected toSide(\n\t\tside?:\n\t\t\t| EShapeAcceptorEdgeSide\n\t\t\t| keyof typeof EShapeAcceptorEdgeSide\n\t\t\t| Array<keyof typeof EShapeAcceptorEdgeSide>\n\t): EShapeAcceptorEdgeSide {\n\t\tif (side == null) {\n\t\t\treturn EShapeAcceptorEdgeSide.TOP;\n\t\t} else if (isNumber(side)) {\n\t\t\treturn side;\n\t\t} else if (isString(side)) {\n\t\t\treturn toEnum(side, EShapeAcceptorEdgeSide);\n\t\t} else {\n\t\t\tlet result: EShapeAcceptorEdgeSide = EShapeAcceptorEdgeSide.NONE;\n\t\t\tfor (let i = 0, imax = side.length; i < imax; ++i) {\n\t\t\t\tresult |= toEnum(side[i], EShapeAcceptorEdgeSide);\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t}\n\n\tremove(id: string): EShapeAcceptorEdge | null {\n\t\tconst edges = this._edges;\n\t\tconst result = edges.get(id);\n\t\tif (result != null) {\n\t\t\tedges.delete(id);\n\t\t\treturn result;\n\t\t}\n\t\treturn null;\n\t}\n\n\tsize(): number {\n\t\treturn this._edges.size;\n\t}\n\n\tget(shape: EShape, id: string): EShapeAcceptorEdge | null {\n\t\treturn this._edges.get(id) || null;\n\t}\n\n\teach(shape: EShape, iteratee: (edge: EShapeAcceptorEdge, id: string) => void): this {\n\t\tthis._edges.forEach(iteratee);\n\t\treturn this;\n\t}\n\n\tcontains(id: string): boolean {\n\t\treturn this._edges.has(id);\n\t}\n\n\tclear(): boolean {\n\t\tconst edges = this._edges;\n\t\tif (0 < edges.size) {\n\t\t\tedges.clear();\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n}\n"]}
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* Copyright (C) 2019 Toshiba Corporation
|
|
3
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
*/
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
import { EShapeAcceptorEdgeType } from "./e-shape-acceptor-edge-type";
|
|
6
|
+
/**
|
|
7
|
+
* @deprecated in favor of {@link EShapeAcceptorEdgeType}.
|
|
8
|
+
*/
|
|
9
|
+
export var EShapeAcceptorType = EShapeAcceptorEdgeType;
|
|
10
10
|
//# sourceMappingURL=e-shape-acceptor-type.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"e-shape-acceptor-type.js","sourceRoot":"","sources":["../../../../src/main/typescript/wcardinal/ui/shape/e-shape-acceptor-type.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,
|
|
1
|
+
{"version":3,"file":"e-shape-acceptor-type.js","sourceRoot":"","sources":["../../../../src/main/typescript/wcardinal/ui/shape/e-shape-acceptor-type.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAEtE;;GAEG;AACH,MAAM,CAAC,IAAM,kBAAkB,GAAG,sBAAsB,CAAC","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { EShapeAcceptorEdgeType } from \"./e-shape-acceptor-edge-type\";\n\n/**\n * @deprecated in favor of {@link EShapeAcceptorEdgeType}.\n */\nexport const EShapeAcceptorType = EShapeAcceptorEdgeType;\n\n/**\n * @deprecated in favor of {@link EShapeAcceptorEdgeType}.\n */\nexport type EShapeAcceptorType = typeof EShapeAcceptorType[keyof typeof EShapeAcceptorType];\n"]}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* Copyright (C) 2019 Toshiba Corporation
|
|
3
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
*/
|
|
5
|
+
import { EShapeAcceptorEdgeType } from "./e-shape-acceptor-edge-type";
|
|
5
6
|
import { EShapeAcceptorImpl } from "./e-shape-acceptor-impl";
|
|
6
|
-
import { EShapeAcceptorType } from "./e-shape-acceptor-type";
|
|
7
7
|
var EShapeAcceptors = /** @class */ (function () {
|
|
8
8
|
function EShapeAcceptors() {
|
|
9
9
|
}
|
|
@@ -30,15 +30,15 @@ var EShapeAcceptors = /** @class */ (function () {
|
|
|
30
30
|
EShapeAcceptors.newDefault = function () {
|
|
31
31
|
var result = new EShapeAcceptorImpl();
|
|
32
32
|
var s = 1 / Math.sqrt(2);
|
|
33
|
-
result.add("TOP",
|
|
34
|
-
result.add("LEFT",
|
|
35
|
-
result.add("RIGHT",
|
|
36
|
-
result.add("BOTTOM",
|
|
37
|
-
result.add("CENTER",
|
|
38
|
-
result.add("TOP_LEFT",
|
|
39
|
-
result.add("TOP_RIGHT",
|
|
40
|
-
result.add("BOTTOM_LEFT",
|
|
41
|
-
result.add("BOTTOM_RIGHT",
|
|
33
|
+
result.add("TOP", EShapeAcceptorEdgeType.ALL, 0, -0.5, 0, -1);
|
|
34
|
+
result.add("LEFT", EShapeAcceptorEdgeType.ALL, -0.5, 0, -1, 0);
|
|
35
|
+
result.add("RIGHT", EShapeAcceptorEdgeType.ALL, 0.5, 0, 1, 0);
|
|
36
|
+
result.add("BOTTOM", EShapeAcceptorEdgeType.ALL, 0, 0.5, 0, 1);
|
|
37
|
+
result.add("CENTER", EShapeAcceptorEdgeType.ALL, 0, 0, 0, 0);
|
|
38
|
+
result.add("TOP_LEFT", EShapeAcceptorEdgeType.ALL, -0.5, -0.5, -s, -s);
|
|
39
|
+
result.add("TOP_RIGHT", EShapeAcceptorEdgeType.ALL, 0.5, -0.5, s, -s);
|
|
40
|
+
result.add("BOTTOM_LEFT", EShapeAcceptorEdgeType.ALL, -0.5, 0.5, -s, s);
|
|
41
|
+
result.add("BOTTOM_RIGHT", EShapeAcceptorEdgeType.ALL, 0.5, 0.5, s, s);
|
|
42
42
|
return result;
|
|
43
43
|
};
|
|
44
44
|
return EShapeAcceptors;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"e-shape-acceptors.js","sourceRoot":"","sources":["../../../../src/main/typescript/wcardinal/ui/shape/e-shape-acceptors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"e-shape-acceptors.js","sourceRoot":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E,sBAAsB,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QAC/D,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,sBAAsB,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QAC9D,MAAM,CAAC,GAAG,CAAC,QAAQ,EAAE,sBAAsB,CAAC,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QAC/D,MAAM,CAAC,GAAG,CAAC,QAAQ,EAAE,sBAAsB,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QAC7D,MAAM,CAAC,GAAG,CAAC,UAAU,EAAE,sBAAsB,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QACvE,MAAM,CAAC,GAAG,CAAC,WAAW,EAAE,sBAAsB,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QACtE,MAAM,CAAC,GAAG,CAAC,aAAa,EAAE,sBAAsB,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACxE,MAAM,CAAC,GAAG,CAAC,cAAc,EAAE,sBAAsB,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QACvE,OAAO,MAAM,CAAC;IACf,CAAC;IACF,sBAAC;AAAD,CAAC,AAxCD,IAwCC","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { EShapeAcceptor } from \"./e-shape-acceptor\";\nimport { EShapeAcceptorEdgeType } from \"./e-shape-acceptor-edge-type\";\nimport { EShapeAcceptorImpl } from \"./e-shape-acceptor-impl\";\nimport { EShapeType } from \"./e-shape-type\";\n\nexport class EShapeAcceptors {\n\tprotected static _default?: EShapeAcceptor;\n\tprotected static _typeToAcceptor?: Map<EShapeType, EShapeAcceptor>;\n\n\tstatic set(type: EShapeType, acceptor: EShapeAcceptor): void {\n\t\tlet typeToAcceptor = this._typeToAcceptor;\n\t\tif (typeToAcceptor == null) {\n\t\t\ttypeToAcceptor = new Map<EShapeType, EShapeAcceptor>();\n\t\t\tthis._typeToAcceptor = typeToAcceptor;\n\t\t}\n\t\ttypeToAcceptor.set(type, acceptor);\n\t}\n\n\tstatic get(type: EShapeType): EShapeAcceptor {\n\t\treturn this._typeToAcceptor?.get(type) || this.getDefault();\n\t}\n\n\tprotected static getDefault(): EShapeAcceptor {\n\t\tlet result = this._default;\n\t\tif (result == null) {\n\t\t\tresult = this.newDefault();\n\t\t\tthis._default = result;\n\t\t}\n\t\treturn result;\n\t}\n\n\tprotected static newDefault(): EShapeAcceptor {\n\t\tconst result = new EShapeAcceptorImpl();\n\t\tconst s = 1 / Math.sqrt(2);\n\t\tresult.add(\"TOP\", EShapeAcceptorEdgeType.ALL, 0, -0.5, 0, -1);\n\t\tresult.add(\"LEFT\", EShapeAcceptorEdgeType.ALL, -0.5, 0, -1, 0);\n\t\tresult.add(\"RIGHT\", EShapeAcceptorEdgeType.ALL, 0.5, 0, 1, 0);\n\t\tresult.add(\"BOTTOM\", EShapeAcceptorEdgeType.ALL, 0, 0.5, 0, 1);\n\t\tresult.add(\"CENTER\", EShapeAcceptorEdgeType.ALL, 0, 0, 0, 0);\n\t\tresult.add(\"TOP_LEFT\", EShapeAcceptorEdgeType.ALL, -0.5, -0.5, -s, -s);\n\t\tresult.add(\"TOP_RIGHT\", EShapeAcceptorEdgeType.ALL, 0.5, -0.5, s, -s);\n\t\tresult.add(\"BOTTOM_LEFT\", EShapeAcceptorEdgeType.ALL, -0.5, 0.5, -s, s);\n\t\tresult.add(\"BOTTOM_RIGHT\", EShapeAcceptorEdgeType.ALL, 0.5, 0.5, s, s);\n\t\treturn result;\n\t}\n}\n"]}
|
|
@@ -8,6 +8,7 @@ export * from "./variant";
|
|
|
8
8
|
export * from "./e-shape-acceptor-edge-normal";
|
|
9
9
|
export * from "./e-shape-acceptor-edge-side";
|
|
10
10
|
export * from "./e-shape-acceptor-edge-size";
|
|
11
|
+
export * from "./e-shape-acceptor-edge-type";
|
|
11
12
|
export * from "./e-shape-acceptor-edge";
|
|
12
13
|
export * from "./e-shape-acceptor-impl";
|
|
13
14
|
export * from "./e-shape-acceptor-type";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/main/typescript/wcardinal/ui/shape/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,gCAAgC,CAAC;AAC/C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,qCAAqC,CAAC;AACpD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,sBAAsB,CAAC;AACrC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,0BAA0B,CAAC;AACzC,cAAc,oCAAoC,CAAC;AACnD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,wCAAwC,CAAC;AACvD,cAAc,mCAAmC,CAAC;AAClD,cAAc,yCAAyC,CAAC;AACxD,cAAc,oCAAoC,CAAC;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AmC,CAAC;AAClD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mCAAmC,CAAC;AAClD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oBAAoB,CAAC;AACnC,cAAc,iDAAiD,CAAC;AAChE,cAAc,4CAA4C,CAAC;AAC3D,cAAc,0CAA0C,CAAC;AACzD,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qCAAqC,CAAC;AACpD,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iCAAiC,CAAC;AAChD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gCAAgC,CAAC;AAC/C,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wBAAwB,CAAC;AACvC,cAAc,WAAW,CAAC","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport * from \"./action\";\nexport * from \"./load\";\nexport * from \"./variant\";\nexport * from \"./e-shape-acceptor-edge-normal\";\nexport * from \"./e-shape-acceptor-edge-side\";\nexport * from \"./e-shape-acceptor-edge-size\";\nexport * from \"./e-shape-acceptor-edge\";\nexport * from \"./e-shape-acceptor-impl\";\nexport * from \"./e-shape-acceptor-type\";\nexport * from \"./e-shape-acceptor\";\nexport * from \"./e-shape-acceptors\";\nexport * from \"./e-shape-buffer-unit-builder\";\nexport * from \"./e-shape-buffer-unit\";\nexport * from \"./e-shape-buffer\";\nexport * from \"./e-shape-capabilities\";\nexport * from \"./e-shape-capability-container-impl\";\nexport * from \"./e-shape-capability-container\";\nexport * from \"./e-shape-capability\";\nexport * from \"./e-shape-connector-bodies\";\nexport * from \"./e-shape-connector-body-impl\";\nexport * from \"./e-shape-connector-body\";\nexport * from \"./e-shape-connector-container-impl\";\nexport * from \"./e-shape-connector-container\";\nexport * from \"./e-shape-connector-edge-acceptor-impl\";\nexport * from \"./e-shape-connector-edge-acceptor\";\nexport * from \"./e-shape-connector-edge-container-impl\";\nexport * from \"./e-shape-connector-edge-container\";\nexport * from \"./e-shape-connector-edge-impl\";\nexport * from \"./e-shape-connector-edge\";\nexport * from \"./e-shape-connector\";\nexport * from \"./e-shape-connectors\";\nexport * from \"./e-shape-container\";\nexport * from \"./e-shape-copy-part\";\nexport * from \"./e-shape-corner\";\nexport * from \"./e-shape-data-impl\";\nexport * from \"./e-shape-data-mapper-impl\";\nexport * from \"./e-shape-data-mapper\";\nexport * from \"./e-shape-data-mapping-impl\";\nexport * from \"./e-shape-data-mapping\";\nexport * from \"./e-shape-data-scoped-impl\";\nexport * from \"./e-shape-data-scoped\";\nexport * from \"./e-shape-data-system-impl\";\nexport * from \"./e-shape-data-system\";\nexport * from \"./e-shape-data-value-extension\";\nexport * from \"./e-shape-data-value-extensions\";\nexport * from \"./e-shape-data-value-formatter\";\nexport * from \"./e-shape-data-value-impl\";\nexport * from \"./e-shape-data-value-order\";\nexport * from \"./e-shape-data-value-range-impl\";\nexport * from \"./e-shape-data-value-range\";\nexport * from \"./e-shape-data-value-scope\";\nexport * from \"./e-shape-data-value-state\";\nexport * from \"./e-shape-data-value-type\";\nexport * from \"./e-shape-data-value\";\nexport * from \"./e-shape-data\";\nexport * from \"./e-shape-defaults\";\nexport * from \"./e-shape-deleter\";\nexport * from \"./e-shape-deserializers\";\nexport * from \"./e-shape-editor\";\nexport * from \"./e-shape-fill\";\nexport * from \"./e-shape-gradient\";\nexport * from \"./e-shape-layer-container\";\nexport * from \"./e-shape-layer-state\";\nexport * from \"./e-shape-layer\";\nexport * from \"./e-shape-layout\";\nexport * from \"./e-shape-points-formatted\";\nexport * from \"./e-shape-points-formatter-curve\";\nexport * from \"./e-shape-points-formatter\";\nexport * from \"./e-shape-points-formatters\";\nexport * from \"./e-shape-points-marker-base\";\nexport * from \"./e-shape-points-marker-container-impl-noop\";\nexport * from \"./e-shape-points-marker-container-impl\";\nexport * from \"./e-shape-points-marker-container\";\nexport * from \"./e-shape-points-marker-head\";\nexport * from \"./e-shape-points-marker-noop\";\nexport * from \"./e-shape-points-marker-tail\";\nexport * from \"./e-shape-points-marker-type\";\nexport * from \"./e-shape-points-marker\";\nexport * from \"./e-shape-points-style\";\nexport * from \"./e-shape-points-styles\";\nexport * from \"./e-shape-points\";\nexport * from \"./e-shape-renderer-iterator-datum\";\nexport * from \"./e-shape-renderer-iterator\";\nexport * from \"./e-shape-renderer\";\nexport * from \"./e-shape-resource-manager-deserialization-mode\";\nexport * from \"./e-shape-resource-manager-deserialization\";\nexport * from \"./e-shape-resource-manager-serialization\";\nexport * from \"./e-shape-runtime-impl\";\nexport * from \"./e-shape-runtime-reset\";\nexport * from \"./e-shape-runtime\";\nexport * from \"./e-shape-runtimes\";\nexport * from \"./e-shape-search\";\nexport * from \"./e-shape-state-set-impl-observable\";\nexport * from \"./e-shape-state-set\";\nexport * from \"./e-shape-state\";\nexport * from \"./e-shape-stroke-side\";\nexport * from \"./e-shape-stroke-style\";\nexport * from \"./e-shape-stroke\";\nexport * from \"./e-shape-text-align-horizontal\";\nexport * from \"./e-shape-text-align-vertical\";\nexport * from \"./e-shape-text-align\";\nexport * from \"./e-shape-text-direction\";\nexport * from \"./e-shape-text-offset\";\nexport * from \"./e-shape-text-outline\";\nexport * from \"./e-shape-text\";\nexport * from \"./e-shape-transform-parent\";\nexport * from \"./e-shape-transform\";\nexport * from \"./e-shape-transforms\";\nexport * from \"./e-shape-type\";\nexport * from \"./e-shape-uploaded-constructor\";\nexport * from \"./e-shape-uploaded\";\nexport * from \"./e-shape-uploadeds\";\nexport * from \"./e-shape-uuid-mapping-impl\";\nexport * from \"./e-shape-uuid-mapping\";\nexport * from \"./e-shape\";\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/main/typescript/wcardinal/ui/shape/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,gCAAgC,CAAC;AAC/C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,qCAAqC,CAAC;AACpD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,sBAAsB,CAAC;AACrC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,0BAA0B,CAAC;AACzC,cAAc,oCAAoC,CAAC;AACnD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,wCAAwC,CAAC;AACvD,cAAc,mCAAmC,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ation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport * from \"./action\";\nexport * from \"./load\";\nexport * from \"./variant\";\nexport * from \"./e-shape-acceptor-edge-normal\";\nexport * from \"./e-shape-acceptor-edge-side\";\nexport * from \"./e-shape-acceptor-edge-size\";\nexport * from \"./e-shape-acceptor-edge-type\";\nexport * from \"./e-shape-acceptor-edge\";\nexport * from \"./e-shape-acceptor-impl\";\nexport * from \"./e-shape-acceptor-type\";\nexport * from \"./e-shape-acceptor\";\nexport * from \"./e-shape-acceptors\";\nexport * from \"./e-shape-buffer-unit-builder\";\nexport * from \"./e-shape-buffer-unit\";\nexport * from \"./e-shape-buffer\";\nexport * from \"./e-shape-capabilities\";\nexport * from \"./e-shape-capability-container-impl\";\nexport * from \"./e-shape-capability-container\";\nexport * from \"./e-shape-capability\";\nexport * from \"./e-shape-connector-bodies\";\nexport * from \"./e-shape-connector-body-impl\";\nexport * from \"./e-shape-connector-body\";\nexport * from \"./e-shape-connector-container-impl\";\nexport * from \"./e-shape-connector-container\";\nexport * from \"./e-shape-connector-edge-acceptor-impl\";\nexport * from \"./e-shape-connector-edge-acceptor\";\nexport * from \"./e-shape-connector-edge-container-impl\";\nexport * from \"./e-shape-connector-edge-container\";\nexport * from \"./e-shape-connector-edge-impl\";\nexport * from \"./e-shape-connector-edge\";\nexport * from \"./e-shape-connector\";\nexport * from \"./e-shape-connectors\";\nexport * from \"./e-shape-container\";\nexport * from \"./e-shape-copy-part\";\nexport * from \"./e-shape-corner\";\nexport * from \"./e-shape-data-impl\";\nexport * from \"./e-shape-data-mapper-impl\";\nexport * from \"./e-shape-data-mapper\";\nexport * from \"./e-shape-data-mapping-impl\";\nexport * from \"./e-shape-data-mapping\";\nexport * from \"./e-shape-data-scoped-impl\";\nexport * from \"./e-shape-data-scoped\";\nexport * from \"./e-shape-data-system-impl\";\nexport * from \"./e-shape-data-system\";\nexport * from \"./e-shape-data-value-extension\";\nexport * from \"./e-shape-data-value-extensions\";\nexport * from \"./e-shape-data-value-formatter\";\nexport * from \"./e-shape-data-value-impl\";\nexport * from \"./e-shape-data-value-order\";\nexport * from \"./e-shape-data-value-range-impl\";\nexport * from \"./e-shape-data-value-range\";\nexport * from \"./e-shape-data-value-scope\";\nexport * from \"./e-shape-data-value-state\";\nexport * from \"./e-shape-data-value-type\";\nexport * from \"./e-shape-data-value\";\nexport * from \"./e-shape-data\";\nexport * from \"./e-shape-defaults\";\nexport * from \"./e-shape-deleter\";\nexport * from \"./e-shape-deserializers\";\nexport * from \"./e-shape-editor\";\nexport * from \"./e-shape-fill\";\nexport * from \"./e-shape-gradient\";\nexport * from \"./e-shape-layer-container\";\nexport * from \"./e-shape-layer-state\";\nexport * from \"./e-shape-layer\";\nexport * from \"./e-shape-layout\";\nexport * from \"./e-shape-points-formatted\";\nexport * from \"./e-shape-points-formatter-curve\";\nexport * from \"./e-shape-points-formatter\";\nexport * from \"./e-shape-points-formatters\";\nexport * from \"./e-shape-points-marker-base\";\nexport * from \"./e-shape-points-marker-container-impl-noop\";\nexport * from \"./e-shape-points-marker-container-impl\";\nexport * from \"./e-shape-points-marker-container\";\nexport * from \"./e-shape-points-marker-head\";\nexport * from \"./e-shape-points-marker-noop\";\nexport * from \"./e-shape-points-marker-tail\";\nexport * from \"./e-shape-points-marker-type\";\nexport * from \"./e-shape-points-marker\";\nexport * from \"./e-shape-points-style\";\nexport * from \"./e-shape-points-styles\";\nexport * from \"./e-shape-points\";\nexport * from \"./e-shape-renderer-iterator-datum\";\nexport * from \"./e-shape-renderer-iterator\";\nexport * from \"./e-shape-renderer\";\nexport * from \"./e-shape-resource-manager-deserialization-mode\";\nexport * from \"./e-shape-resource-manager-deserialization\";\nexport * from \"./e-shape-resource-manager-serialization\";\nexport * from \"./e-shape-runtime-impl\";\nexport * from \"./e-shape-runtime-reset\";\nexport * from \"./e-shape-runtime\";\nexport * from \"./e-shape-runtimes\";\nexport * from \"./e-shape-search\";\nexport * from \"./e-shape-state-set-impl-observable\";\nexport * from \"./e-shape-state-set\";\nexport * from \"./e-shape-state\";\nexport * from \"./e-shape-stroke-side\";\nexport * from \"./e-shape-stroke-style\";\nexport * from \"./e-shape-stroke\";\nexport * from \"./e-shape-text-align-horizontal\";\nexport * from \"./e-shape-text-align-vertical\";\nexport * from \"./e-shape-text-align\";\nexport * from \"./e-shape-text-direction\";\nexport * from \"./e-shape-text-offset\";\nexport * from \"./e-shape-text-outline\";\nexport * from \"./e-shape-text\";\nexport * from \"./e-shape-transform-parent\";\nexport * from \"./e-shape-transform\";\nexport * from \"./e-shape-transforms\";\nexport * from \"./e-shape-type\";\nexport * from \"./e-shape-uploaded-constructor\";\nexport * from \"./e-shape-uploaded\";\nexport * from \"./e-shape-uploadeds\";\nexport * from \"./e-shape-uuid-mapping-impl\";\nexport * from \"./e-shape-uuid-mapping\";\nexport * from \"./e-shape\";\n"]}
|
|
@@ -108,17 +108,17 @@ var EShapeConnectorElbowPointsFiller = /** @class */ (function () {
|
|
|
108
108
|
var d = null;
|
|
109
109
|
var result = 0;
|
|
110
110
|
// 0 := (0, -1)
|
|
111
|
-
// | ny,
|
|
112
|
-
// | nx,
|
|
113
|
-
if (side & this.toSide(
|
|
111
|
+
// | ny, -nx | 0 |
|
|
112
|
+
// | nx, ny | -1 |
|
|
113
|
+
if (side & this.toSide(nx, -ny)) {
|
|
114
114
|
if (d == null || d < -dy) {
|
|
115
115
|
d = -dy;
|
|
116
116
|
result = 0;
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
119
|
// 1 := (1, 0)
|
|
120
|
-
// | ny,
|
|
121
|
-
// | nx,
|
|
120
|
+
// | ny, -nx | 1 |
|
|
121
|
+
// | nx, ny | 0 |
|
|
122
122
|
if (side & this.toSide(ny, nx)) {
|
|
123
123
|
if (d == null || d < dx) {
|
|
124
124
|
d = dx;
|
|
@@ -126,17 +126,17 @@ var EShapeConnectorElbowPointsFiller = /** @class */ (function () {
|
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
128
|
// 2 := (0, 1)
|
|
129
|
-
// | ny,
|
|
130
|
-
// | nx,
|
|
131
|
-
if (side & this.toSide(nx,
|
|
129
|
+
// | ny, -nx | 0 |
|
|
130
|
+
// | nx, ny | 1 |
|
|
131
|
+
if (side & this.toSide(-nx, ny)) {
|
|
132
132
|
if (d == null || d < dy) {
|
|
133
133
|
d = dy;
|
|
134
134
|
result = 2;
|
|
135
135
|
}
|
|
136
136
|
}
|
|
137
137
|
// 3 := (-1, 0)
|
|
138
|
-
// | ny,
|
|
139
|
-
// | nx,
|
|
138
|
+
// | ny, -nx | -1 |
|
|
139
|
+
// | nx, ny | 0 |
|
|
140
140
|
if (side & this.toSide(-ny, -nx)) {
|
|
141
141
|
if (d == null || d < -dx) {
|
|
142
142
|
d = -dx;
|
|
@@ -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,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,CAA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AG,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,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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AC;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"]}
|