@wcardinal/wcardinal-ui 0.212.0 → 0.213.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.
@@ -10,8 +10,11 @@ export declare class EShapeConnectorElbowPointsFillter {
10
10
  set x(x: number);
11
11
  get y(): number;
12
12
  set y(y: number);
13
+ protected toAxis(dx: number, dy: number, nx: number, ny: number): 0 | 1 | 2 | 3;
14
+ protected toTailAxis(x: number, y: number, nx: number, ny: number): 0 | 1 | 2 | 3;
13
15
  tail(x: number, y: number, nx: number, ny: number, sxh: number, syh: number, margin: number): void;
14
16
  middle(x: number, y: number): void;
17
+ protected toHeadAxis(x: number, y: number, nx: number, ny: number): 0 | 1 | 2 | 3;
15
18
  head(x: number, y: number, nx: number, ny: number, sxh: number, syh: number, margin: number): void;
16
19
  margin(tail: number, head: number): void;
17
20
  }
@@ -33,7 +33,7 @@ var EShapeAcceptorImpl = /** @class */ (function () {
33
33
  }
34
34
  else {
35
35
  return {
36
- x: 1,
36
+ x: 0,
37
37
  y: 0
38
38
  };
39
39
  }
@@ -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;AAMH;IAGC;QACC,IAAI,CAAC,MAAM,GAAG,IAAI,GAAG,EAA8B,CAAC;IACrD,CAAC;IAWD,gCAAG,GAAH,UACC,EAAU,EACV,IAAwB,EACxB,CAAS,EACT,CAAS,EACT,EAAW,EACX,EAAW;QAEX,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,EAAE;YACnB,IAAI,MAAA;YACJ,CAAC,GAAA;YACD,CAAC,GAAA;YACD,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC;SACnC,CAAC,CAAC;QACH,OAAO,IAAI,CAAC;IACb,CAAC;IAES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,CAAC;IACb,CAAC;IAED,qCAAQ,GAAR,UAAS,EAAU;QAClB,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAC5B,CAAC;IAED,kCAAK,GAAL;QACC,IAAM,KAAK,GAAG,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,AA3FD,IA2FC","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { EShape } from \"./e-shape\";\nimport { EShapeAcceptor, EShapeAcceptorEdge, EShapeAcceptorEdgeNormal } from \"./e-shape-acceptor\";\nimport { EShapeAcceptorType } from \"./e-shape-acceptor-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(id: string, type: EShapeAcceptorType, x: number, y: number): boolean;\n\tadd(\n\t\tid: string,\n\t\ttype: EShapeAcceptorType,\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: EShapeAcceptorType,\n\t\tx: number,\n\t\ty: number,\n\t\tnx?: number,\n\t\tny?: number\n\t): boolean {\n\t\tthis._edges.set(id, {\n\t\t\ttype,\n\t\t\tx,\n\t\t\ty,\n\t\t\tnormal: this.toNormal(x, y, nx, ny)\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: 1,\n\t\t\t\t\ty: 0\n\t\t\t\t};\n\t\t\t}\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"]}
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;AAMH;IAGC;QACC,IAAI,CAAC,MAAM,GAAG,IAAI,GAAG,EAA8B,CAAC;IACrD,CAAC;IAWD,gCAAG,GAAH,UACC,EAAU,EACV,IAAwB,EACxB,CAAS,EACT,CAAS,EACT,EAAW,EACX,EAAW;QAEX,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,EAAE;YACnB,IAAI,MAAA;YACJ,CAAC,GAAA;YACD,CAAC,GAAA;YACD,MAAM,EAAE,IAAI,CAAC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AAI,GAAJ,UAAK,KAAa,EAAE,QAAwD;QAC3E,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QAC9B,OAAO,IAAI,CAAC;IACb,CAAC;IAED,qCAAQ,GAAR,UAAS,EAAU;QAClB,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAC5B,CAAC;IAED,kCAAK,GAAL;QACC,IAAM,KAAK,GAAG,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,AA3FD,IA2FC","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { EShape } from \"./e-shape\";\nimport { EShapeAcceptor, EShapeAcceptorEdge, EShapeAcceptorEdgeNormal } from \"./e-shape-acceptor\";\nimport { EShapeAcceptorType } from \"./e-shape-acceptor-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(id: string, type: EShapeAcceptorType, x: number, y: number): boolean;\n\tadd(\n\t\tid: string,\n\t\ttype: EShapeAcceptorType,\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: EShapeAcceptorType,\n\t\tx: number,\n\t\ty: number,\n\t\tnx?: number,\n\t\tny?: number\n\t): boolean {\n\t\tthis._edges.set(id, {\n\t\t\ttype,\n\t\t\tx,\n\t\t\ty,\n\t\t\tnormal: this.toNormal(x, y, nx, ny)\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\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"]}
@@ -29,15 +29,16 @@ var EShapeAcceptors = /** @class */ (function () {
29
29
  };
30
30
  EShapeAcceptors.newDefault = function () {
31
31
  var result = new EShapeAcceptorImpl();
32
+ var s = 1 / Math.sqrt(2);
32
33
  result.add("TOP", EShapeAcceptorType.ALL, 0, -0.5, 0, -1);
33
34
  result.add("LEFT", EShapeAcceptorType.ALL, -0.5, 0, -1, 0);
34
35
  result.add("RIGHT", EShapeAcceptorType.ALL, 0.5, 0, 1, 0);
35
36
  result.add("BOTTOM", EShapeAcceptorType.ALL, 0, 0.5, 0, 1);
36
- result.add("CENTER", EShapeAcceptorType.ALL, 0, 0, -1, 0);
37
- result.add("TOP_LEFT", EShapeAcceptorType.ALL, -0.5, -0.5, -1, 0);
38
- result.add("TOP_RIGHT", EShapeAcceptorType.ALL, 0.5, -0.5, 1, 0);
39
- result.add("BOTTOM_LEFT", EShapeAcceptorType.ALL, -0.5, 0.5, -1, 0);
40
- result.add("BOTTOM_RIGHT", EShapeAcceptorType.ALL, 0.5, 0.5, 1, 0);
37
+ result.add("CENTER", EShapeAcceptorType.ALL, 0, 0, 0, 0);
38
+ result.add("TOP_LEFT", EShapeAcceptorType.ALL, -0.5, -0.5, -s, -s);
39
+ result.add("TOP_RIGHT", EShapeAcceptorType.ALL, 0.5, -0.5, s, -s);
40
+ result.add("BOTTOM_LEFT", EShapeAcceptorType.ALL, -0.5, 0.5, -s, s);
41
+ result.add("BOTTOM_RIGHT", EShapeAcceptorType.ALL, 0.5, 0.5, s, s);
41
42
  return result;
42
43
  };
43
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,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAG7D;IAAA;IAuCA,CAAC;IAnCO,mBAAG,GAAV,UAAW,IAAgB,EAAE,QAAwB;QACpD,IAAI,cAAc,GAAG,IAAI,CAAC,eAAe,CAAC;QAC1C,IAAI,cAAc,IAAI,IAAI,EAAE;YAC3B,cAAc,GAAG,IAAI,GAAG,EAA8B,CAAC;YACvD,IAAI,CAAC,eAAe,GAAG,cAAc,CAAC;SACtC;QACD,cAAc,CAAC,GAAG,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IACpC,CAAC;IAEM,m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AE,CAAC,CAAC,CAAC;QAClE,MAAM,CAAC,GAAG,CAAC,WAAW,EAAE,kBAAkB,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QACjE,MAAM,CAAC,GAAG,CAAC,aAAa,EAAE,kBAAkB,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACpE,MAAM,CAAC,GAAG,CAAC,cAAc,EAAE,kBAAkB,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QACnE,OAAO,MAAM,CAAC;IACf,CAAC;IACF,sBAAC;AAAD,CAAC,AAvCD,IAuCC","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { EShapeAcceptor } from \"./e-shape-acceptor\";\nimport { EShapeAcceptorImpl } from \"./e-shape-acceptor-impl\";\nimport { EShapeAcceptorType } from \"./e-shape-acceptor-type\";\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\tresult.add(\"TOP\", EShapeAcceptorType.ALL, 0, -0.5, 0, -1);\n\t\tresult.add(\"LEFT\", EShapeAcceptorType.ALL, -0.5, 0, -1, 0);\n\t\tresult.add(\"RIGHT\", EShapeAcceptorType.ALL, 0.5, 0, 1, 0);\n\t\tresult.add(\"BOTTOM\", EShapeAcceptorType.ALL, 0, 0.5, 0, 1);\n\t\tresult.add(\"CENTER\", EShapeAcceptorType.ALL, 0, 0, -1, 0);\n\t\tresult.add(\"TOP_LEFT\", EShapeAcceptorType.ALL, -0.5, -0.5, -1, 0);\n\t\tresult.add(\"TOP_RIGHT\", EShapeAcceptorType.ALL, 0.5, -0.5, 1, 0);\n\t\tresult.add(\"BOTTOM_LEFT\", EShapeAcceptorType.ALL, -0.5, 0.5, -1, 0);\n\t\tresult.add(\"BOTTOM_RIGHT\", EShapeAcceptorType.ALL, 0.5, 0.5, 1, 0);\n\t\treturn result;\n\t}\n}\n"]}
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,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAG7D;IAAA;IAwCA,CAAC;IApCO,mBAAG,GAAV,UAAW,IAAgB,EAAE,QAAwB;QACpD,IAAI,cAAc,GAAG,IAAI,CAAC,eAAe,CAAC;QAC1C,IAAI,cAAc,IAAI,IAAI,EAAE;YAC3B,cAAc,GAAG,IAAI,GAAG,EAA8B,CAAC;YACvD,IAAI,CAAC,eAAe,GAAG,cAAc,CAAC;SACtC;QACD,cAAc,CAAC,GAAG,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IACpC,CAAC;IAEM,mBAAG,GAAV,UAAW,IAAgB;;QA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AAG,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QACnE,MAAM,CAAC,GAAG,CAAC,WAAW,EAAE,kBAAkB,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAClE,MAAM,CAAC,GAAG,CAAC,aAAa,EAAE,kBAAkB,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACpE,MAAM,CAAC,GAAG,CAAC,cAAc,EAAE,kBAAkB,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QACnE,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 { EShapeAcceptorImpl } from \"./e-shape-acceptor-impl\";\nimport { EShapeAcceptorType } from \"./e-shape-acceptor-type\";\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\", EShapeAcceptorType.ALL, 0, -0.5, 0, -1);\n\t\tresult.add(\"LEFT\", EShapeAcceptorType.ALL, -0.5, 0, -1, 0);\n\t\tresult.add(\"RIGHT\", EShapeAcceptorType.ALL, 0.5, 0, 1, 0);\n\t\tresult.add(\"BOTTOM\", EShapeAcceptorType.ALL, 0, 0.5, 0, 1);\n\t\tresult.add(\"CENTER\", EShapeAcceptorType.ALL, 0, 0, 0, 0);\n\t\tresult.add(\"TOP_LEFT\", EShapeAcceptorType.ALL, -0.5, -0.5, -s, -s);\n\t\tresult.add(\"TOP_RIGHT\", EShapeAcceptorType.ALL, 0.5, -0.5, s, -s);\n\t\tresult.add(\"BOTTOM_LEFT\", EShapeAcceptorType.ALL, -0.5, 0.5, -s, s);\n\t\tresult.add(\"BOTTOM_RIGHT\", EShapeAcceptorType.ALL, 0.5, 0.5, s, s);\n\t\treturn result;\n\t}\n}\n"]}
@@ -242,7 +242,17 @@ var EShapeConnectorEdgeImpl = /** @class */ (function () {
242
242
  var edgeNormal = edge.normal;
243
243
  var nx = edgeNormal.x;
244
244
  var ny = edgeNormal.y;
245
- this._normal.set(a * nx + c * ny, b * nx + d * ny);
245
+ var x = a * nx + c * ny;
246
+ var y = b * nx + d * ny;
247
+ var l = x * x + y * y;
248
+ var normal = this._normal;
249
+ if (0.000001 < l) {
250
+ var f = 1 / Math.sqrt(l);
251
+ normal.set(x * f, y * f);
252
+ }
253
+ else {
254
+ normal.set(nx, ny);
255
+ }
246
256
  }
247
257
  var result = this._isLocalChanged || this._isNormalChanged;
248
258
  this.unlock();
@@ -1 +1 @@
1
- {"version":3,"file":"e-shape-connector-edge-impl.js","sourceRoot":"","sources":["../../../../src/main/typescript/wcardinal/ui/shape/e-shape-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AAC;QACnC,IAAI,KAAK,EAAE;YACV,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;SAC7B;QACD,OAAO,IAAI,CAAC;IACb,CAAC;IACF,8BAAC;AAAD,CAAC,AA/VD,IA+VC","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { IPoint, Matrix, ObservablePoint } from \"pixi.js\";\nimport { EShape } from \"./e-shape\";\nimport { EShapeAcceptors } from \"./e-shape-acceptors\";\nimport { EShapeConnector } from \"./e-shape-connector\";\nimport { EShapeConnectorEdge, EShapeConnectorEdgeSerialized } from \"./e-shape-connector-edge\";\nimport { EShapeConnectorEdgeAcceptor } from \"./e-shape-connector-edge-acceptor\";\nimport { EShapeConnectorEdgeAcceptorImpl } from \"./e-shape-connector-edge-acceptor-impl\";\nimport { EShapeResourceManagerDeserialization } from \"./e-shape-resource-manager-deserialization\";\nimport { EShapeResourceManagerSerialization } from \"./e-shape-resource-manager-serialization\";\nimport { EShapeUuidMapping } from \"./e-shape-uuid-mapping\";\n\nexport class EShapeConnectorEdgeImpl implements EShapeConnectorEdge {\n\tprotected static WORK_MATRIX?: Matrix;\n\n\tprotected _parent: EShapeConnector;\n\tprotected _onChange: () => void;\n\tprotected _acceptor: EShapeConnectorEdgeAcceptor;\n\tprotected _localIdRequired: number;\n\tprotected _localId: number;\n\tprotected _local: IPoint;\n\tprotected _normalIdRequired: number;\n\tprotected _normalId: number;\n\tprotected _normal: IPoint;\n\tprotected _margin: number;\n\tprotected _lockCount: number;\n\tprotected _isAcceptorChanged: boolean;\n\tprotected _isLocalChanged: boolean;\n\tprotected _isNormalChanged: boolean;\n\tprotected _isOtherChanged: boolean;\n\n\tconstructor(parent: EShapeConnector, onChange: () => void) {\n\t\tthis._parent = parent;\n\t\tthis._onChange = onChange;\n\t\tthis._acceptor = new EShapeConnectorEdgeAcceptorImpl(this);\n\n\t\tthis._local = new ObservablePoint((): void => {\n\t\t\tthis.onLocalChange();\n\t\t}, undefined);\n\t\tthis._localIdRequired = 0;\n\t\tthis._localId = 0;\n\n\t\tthis._normal = new ObservablePoint((): void => {\n\t\t\tthis.onNormalChange();\n\t\t}, undefined);\n\t\tthis._normalIdRequired = 0;\n\t\tthis._normalId = 0;\n\n\t\tthis._margin = 0;\n\n\t\tthis._lockCount = 0;\n\t\tthis._isAcceptorChanged = false;\n\t\tthis._isLocalChanged = false;\n\t\tthis._isNormalChanged = false;\n\t\tthis._isOtherChanged = false;\n\t}\n\n\tlock(): void {\n\t\tthis._lockCount += 1;\n\t\tif (this._lockCount === 1) {\n\t\t\tthis._isAcceptorChanged = false;\n\t\t\tthis._isLocalChanged = false;\n\t\t\tthis._isNormalChanged = false;\n\t\t\tthis._isOtherChanged = false;\n\t\t}\n\t}\n\n\tunlock(): void {\n\t\tthis._lockCount -= 1;\n\t\tif (this._lockCount === 0) {\n\t\t\tlet isChanged = false;\n\n\t\t\tif (this._isLocalChanged) {\n\t\t\t\tthis._localIdRequired += 1;\n\t\t\t\tthis._localId = this._localIdRequired;\n\t\t\t\tisChanged = true;\n\t\t\t}\n\n\t\t\tif (this._isNormalChanged) {\n\t\t\t\tthis._normalIdRequired += 1;\n\t\t\t\tthis._normalId = this._normalIdRequired;\n\t\t\t\tisChanged = true;\n\t\t\t}\n\n\t\t\tif (this._isOtherChanged) {\n\t\t\t\tisChanged = true;\n\t\t\t}\n\n\t\t\tif (this._isAcceptorChanged) {\n\t\t\t\tif (!this._isLocalChanged) {\n\t\t\t\t\tthis._localIdRequired += 1;\n\t\t\t\t}\n\t\t\t\tif (!this._isNormalChanged) {\n\t\t\t\t\tthis._normalIdRequired += 1;\n\t\t\t\t}\n\t\t\t\tif (this.doFit()) {\n\t\t\t\t\tisChanged = false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (isChanged) {\n\t\t\t\tthis._onChange();\n\t\t\t}\n\t\t}\n\t}\n\n\tget acceptor(): EShapeConnectorEdgeAcceptor {\n\t\treturn this._acceptor;\n\t}\n\n\tget local(): IPoint {\n\t\treturn this._local;\n\t}\n\n\tget localId(): number {\n\t\treturn this._localId;\n\t}\n\n\tget normal(): IPoint {\n\t\treturn this._normal;\n\t}\n\n\tget normalId(): number {\n\t\treturn this._normalId;\n\t}\n\n\tget margin(): number {\n\t\treturn this._margin;\n\t}\n\n\tset margin(margin: number) {\n\t\tif (this._margin !== margin) {\n\t\t\tthis._margin = margin;\n\t\t\tthis.onOtherChange();\n\t\t}\n\t}\n\n\tset(\n\t\tshape?: EShape | null,\n\t\tedge?: string | null,\n\t\tmargin?: number,\n\t\tx?: number,\n\t\ty?: number,\n\t\tnx?: number,\n\t\tny?: number\n\t): this {\n\t\tthis.lock();\n\t\tthis._acceptor.set(shape, edge);\n\n\t\tconst local = this._local;\n\t\tif (x != null && y != null) {\n\t\t\tlocal.set(x, y);\n\t\t} else if (x != null) {\n\t\t\tlocal.x = x;\n\t\t} else if (y != null) {\n\t\t\tlocal.y = y;\n\t\t}\n\n\t\tconst normal = this._normal;\n\t\tif (nx != null && ny != null) {\n\t\t\tnormal.set(nx, ny);\n\t\t} else if (nx != null) {\n\t\t\tnormal.x = nx;\n\t\t} else if (ny != null) {\n\t\t\tnormal.y = ny;\n\t\t}\n\n\t\tif (margin != null) {\n\t\t\tthis.margin = margin;\n\t\t}\n\n\t\tthis.unlock();\n\t\treturn this;\n\t}\n\n\tcopy(source: EShapeConnectorEdge): this {\n\t\tthis.lock();\n\t\tthis._acceptor.copy(source.acceptor);\n\t\tthis._local.copyFrom(source.local);\n\t\tthis._normal.copyFrom(source.normal);\n\t\tthis.margin = source.margin;\n\t\tthis.unlock();\n\t\treturn this;\n\t}\n\n\tserialize(manager: EShapeResourceManagerSerialization): number {\n\t\tconst acceptor = this._acceptor;\n\t\tconst shape = acceptor.shape;\n\t\tconst shapeUuid = shape ? shape.uuid : null;\n\t\tconst edge = acceptor.edge;\n\t\tconst edgeId = edge != null ? manager.addResource(edge) : -1;\n\t\tconst local = this._local;\n\t\tconst normal = this._normal;\n\t\treturn manager.addResource(\n\t\t\t`[${shapeUuid},${edgeId},${local.x},${local.y},${this._margin},${normal.x},${normal.y}]`\n\t\t);\n\t}\n\n\tdeserialize(\n\t\tresourceId: number,\n\t\tmapping: EShapeUuidMapping,\n\t\tmanager: EShapeResourceManagerDeserialization\n\t): void {\n\t\tconst resources = manager.resources;\n\t\tif (0 <= resourceId && resourceId < resources.length) {\n\t\t\tlet parsed = manager.getExtension<EShapeConnectorEdgeSerialized>(resourceId);\n\t\t\tif (parsed == null) {\n\t\t\t\tparsed = JSON.parse(resources[resourceId]) as EShapeConnectorEdgeSerialized;\n\t\t\t\tmanager.setExtension(resourceId, parsed);\n\t\t\t}\n\t\t\tlet shape: EShape | null = null;\n\t\t\tconst shapeUuid = parsed[0];\n\t\t\tif (shapeUuid != null) {\n\t\t\t\tshape = mapping.find(shapeUuid) || null;\n\t\t\t}\n\t\t\tthis.lock();\n\t\t\tconst acceptor = this._acceptor;\n\t\t\tacceptor.shape = shape;\n\t\t\tconst edgeId = parsed[1];\n\t\t\tacceptor.edge = 0 <= edgeId && edgeId < resources.length ? resources[edgeId] : null;\n\t\t\tthis._local.set(parsed[2], parsed[3]);\n\t\t\tconst normalX = parsed[5];\n\t\t\tconst normalY = parsed[6];\n\t\t\tconst normal = this._normal;\n\t\t\tif (normalX != null && normalY != null) {\n\t\t\t\tnormal.set(normalX, normalY);\n\t\t\t} else {\n\t\t\t\tnormal.set(1, 0);\n\t\t\t}\n\t\t\tthis.margin = parsed[4] || 0;\n\t\t\tthis.unlock();\n\t\t\tif (shape) {\n\t\t\t\tshape.connector.add(this);\n\t\t\t}\n\t\t}\n\t}\n\n\tfit(forcibly?: boolean): this {\n\t\tif (forcibly) {\n\t\t\tthis._localIdRequired += 1;\n\t\t\tthis._normalIdRequired += 1;\n\t\t}\n\t\tthis.doFit();\n\t\treturn this;\n\t}\n\n\tprotected doFit(): boolean {\n\t\tconst localIdRequired = this._localIdRequired;\n\t\tconst isLocalDirty = this._localId !== localIdRequired;\n\t\tconst normalIdRequired = this._normalIdRequired;\n\t\tconst isNormalDirty = this._normalId !== normalIdRequired;\n\t\tif (isLocalDirty || isNormalDirty) {\n\t\t\tthis._localId = localIdRequired;\n\t\t\tthis._normalId = normalIdRequired;\n\n\t\t\tconst acceptor = this._acceptor;\n\t\t\tconst acceptorShape = acceptor.shape;\n\t\t\tconst acceptorEdge = acceptor.edge;\n\t\t\tif (acceptorShape != null && acceptorEdge != null) {\n\t\t\t\tconst edge = EShapeAcceptors.get(acceptorShape.type).get(\n\t\t\t\t\tacceptorShape,\n\t\t\t\t\tacceptorEdge\n\t\t\t\t);\n\t\t\t\tif (edge) {\n\t\t\t\t\tconst transform = this.toAcceptorTransform(acceptorShape);\n\t\t\t\t\tconst a = transform.a;\n\t\t\t\t\tconst b = transform.b;\n\t\t\t\t\tconst c = transform.c;\n\t\t\t\t\tconst d = transform.d;\n\t\t\t\t\tconst tx = transform.tx;\n\t\t\t\t\tconst ty = transform.ty;\n\n\t\t\t\t\tthis.lock();\n\t\t\t\t\tif (isLocalDirty) {\n\t\t\t\t\t\tconst size = acceptorShape.size;\n\t\t\t\t\t\tconst pivot = acceptorShape.transform.pivot;\n\t\t\t\t\t\tconst lx = pivot.x + size.x * edge.x;\n\t\t\t\t\t\tconst ly = pivot.y + size.y * edge.y;\n\t\t\t\t\t\tthis._local.set(a * lx + c * ly + tx, b * lx + d * ly + ty);\n\t\t\t\t\t}\n\t\t\t\t\tif (isNormalDirty) {\n\t\t\t\t\t\tconst edgeNormal = edge.normal;\n\t\t\t\t\t\tconst nx = edgeNormal.x;\n\t\t\t\t\t\tconst ny = edgeNormal.y;\n\t\t\t\t\t\tthis._normal.set(a * nx + c * ny, b * nx + d * ny);\n\t\t\t\t\t}\n\t\t\t\t\tconst result = this._isLocalChanged || this._isNormalChanged;\n\t\t\t\t\tthis.unlock();\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n\tprotected toAcceptorTransform(shape: EShape): Matrix {\n\t\tshape.updateTransform();\n\t\tconst parent = this._parent;\n\t\tconst parentParent = parent.parent;\n\t\tif (parentParent) {\n\t\t\tparent.updateTransform();\n\t\t\treturn (EShapeConnectorEdgeImpl.WORK_MATRIX ??= new Matrix())\n\t\t\t\t.copyFrom(parentParent.transform.worldTransform)\n\t\t\t\t.invert()\n\t\t\t\t.append(shape.transform.worldTransform);\n\t\t} else {\n\t\t\treturn shape.transform.worldTransform;\n\t\t}\n\t}\n\n\tonAcceptorChange(): void {\n\t\tif (0 < this._lockCount) {\n\t\t\tthis._isLocalChanged = false;\n\t\t\tthis._isNormalChanged = false;\n\t\t\tthis._isAcceptorChanged = true;\n\t\t\treturn;\n\t\t}\n\t\tthis.fit(true);\n\t}\n\n\tprotected onLocalChange(): void {\n\t\tif (0 < this._lockCount) {\n\t\t\tthis._isLocalChanged = true;\n\t\t\treturn;\n\t\t}\n\t\tthis._localIdRequired += 1;\n\t\tthis._localId = this._localIdRequired;\n\t\tthis._onChange();\n\t}\n\n\tprotected onNormalChange(): void {\n\t\tif (0 < this._lockCount) {\n\t\t\tthis._isNormalChanged = true;\n\t\t\treturn;\n\t\t}\n\t\tthis._normalIdRequired += 1;\n\t\tthis._normalId = this._normalIdRequired;\n\t\tthis._onChange();\n\t}\n\n\tprotected onOtherChange(): void {\n\t\tif (0 < this._lockCount) {\n\t\t\tthis._isOtherChanged = true;\n\t\t\treturn;\n\t\t}\n\t\tthis._onChange();\n\t}\n\n\tattach(): this {\n\t\tconst shape = this._acceptor.shape;\n\t\tif (shape) {\n\t\t\tshape.connector.add(this);\n\t\t}\n\t\treturn this;\n\t}\n\n\tdetach(): this {\n\t\tconst shape = this._acceptor.shape;\n\t\tif (shape) {\n\t\t\tshape.connector.remove(this);\n\t\t}\n\t\treturn this;\n\t}\n}\n"]}
1
+ {"version":3,"file":"e-shape-connector-edge-impl.js","sourceRoot":"","sources":["../../../../src/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CAAa,GAAvB;QACC,IAAI,CAAC,GAAG,IAAI,CAAC,UAAU,EAAE;YACxB,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC;YAC5B,OAAO;SACP;QACD,IAAI,CAAC,SAAS,EAAE,CAAC;IAClB,CAAC;IAED,wCAAM,GAAN;QACC,IAAM,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC;QACnC,IAAI,KAAK,EAAE;YACV,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;SAC1B;QACD,OAAO,IAAI,CAAC;IACb,CAAC;IAED,wCAAM,GAAN;QACC,IAAM,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC;QACnC,IAAI,KAAK,EAAE;YACV,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;SAC7B;QACD,OAAO,IAAI,CAAC;IACb,CAAC;IACF,8BAAC;AAAD,CAAC,AAxWD,IAwWC","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { IPoint, Matrix, ObservablePoint } from \"pixi.js\";\nimport { EShape } from \"./e-shape\";\nimport { EShapeAcceptors } from \"./e-shape-acceptors\";\nimport { EShapeConnector } from \"./e-shape-connector\";\nimport { EShapeConnectorEdge, EShapeConnectorEdgeSerialized } from \"./e-shape-connector-edge\";\nimport { EShapeConnectorEdgeAcceptor } from \"./e-shape-connector-edge-acceptor\";\nimport { EShapeConnectorEdgeAcceptorImpl } from \"./e-shape-connector-edge-acceptor-impl\";\nimport { EShapeResourceManagerDeserialization } from \"./e-shape-resource-manager-deserialization\";\nimport { EShapeResourceManagerSerialization } from \"./e-shape-resource-manager-serialization\";\nimport { EShapeUuidMapping } from \"./e-shape-uuid-mapping\";\n\nexport class EShapeConnectorEdgeImpl implements EShapeConnectorEdge {\n\tprotected static WORK_MATRIX?: Matrix;\n\n\tprotected _parent: EShapeConnector;\n\tprotected _onChange: () => void;\n\tprotected _acceptor: EShapeConnectorEdgeAcceptor;\n\tprotected _localIdRequired: number;\n\tprotected _localId: number;\n\tprotected _local: IPoint;\n\tprotected _normalIdRequired: number;\n\tprotected _normalId: number;\n\tprotected _normal: IPoint;\n\tprotected _margin: number;\n\tprotected _lockCount: number;\n\tprotected _isAcceptorChanged: boolean;\n\tprotected _isLocalChanged: boolean;\n\tprotected _isNormalChanged: boolean;\n\tprotected _isOtherChanged: boolean;\n\n\tconstructor(parent: EShapeConnector, onChange: () => void) {\n\t\tthis._parent = parent;\n\t\tthis._onChange = onChange;\n\t\tthis._acceptor = new EShapeConnectorEdgeAcceptorImpl(this);\n\n\t\tthis._local = new ObservablePoint((): void => {\n\t\t\tthis.onLocalChange();\n\t\t}, undefined);\n\t\tthis._localIdRequired = 0;\n\t\tthis._localId = 0;\n\n\t\tthis._normal = new ObservablePoint((): void => {\n\t\t\tthis.onNormalChange();\n\t\t}, undefined);\n\t\tthis._normalIdRequired = 0;\n\t\tthis._normalId = 0;\n\n\t\tthis._margin = 0;\n\n\t\tthis._lockCount = 0;\n\t\tthis._isAcceptorChanged = false;\n\t\tthis._isLocalChanged = false;\n\t\tthis._isNormalChanged = false;\n\t\tthis._isOtherChanged = false;\n\t}\n\n\tlock(): void {\n\t\tthis._lockCount += 1;\n\t\tif (this._lockCount === 1) {\n\t\t\tthis._isAcceptorChanged = false;\n\t\t\tthis._isLocalChanged = false;\n\t\t\tthis._isNormalChanged = false;\n\t\t\tthis._isOtherChanged = false;\n\t\t}\n\t}\n\n\tunlock(): void {\n\t\tthis._lockCount -= 1;\n\t\tif (this._lockCount === 0) {\n\t\t\tlet isChanged = false;\n\n\t\t\tif (this._isLocalChanged) {\n\t\t\t\tthis._localIdRequired += 1;\n\t\t\t\tthis._localId = this._localIdRequired;\n\t\t\t\tisChanged = true;\n\t\t\t}\n\n\t\t\tif (this._isNormalChanged) {\n\t\t\t\tthis._normalIdRequired += 1;\n\t\t\t\tthis._normalId = this._normalIdRequired;\n\t\t\t\tisChanged = true;\n\t\t\t}\n\n\t\t\tif (this._isOtherChanged) {\n\t\t\t\tisChanged = true;\n\t\t\t}\n\n\t\t\tif (this._isAcceptorChanged) {\n\t\t\t\tif (!this._isLocalChanged) {\n\t\t\t\t\tthis._localIdRequired += 1;\n\t\t\t\t}\n\t\t\t\tif (!this._isNormalChanged) {\n\t\t\t\t\tthis._normalIdRequired += 1;\n\t\t\t\t}\n\t\t\t\tif (this.doFit()) {\n\t\t\t\t\tisChanged = false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (isChanged) {\n\t\t\t\tthis._onChange();\n\t\t\t}\n\t\t}\n\t}\n\n\tget acceptor(): EShapeConnectorEdgeAcceptor {\n\t\treturn this._acceptor;\n\t}\n\n\tget local(): IPoint {\n\t\treturn this._local;\n\t}\n\n\tget localId(): number {\n\t\treturn this._localId;\n\t}\n\n\tget normal(): IPoint {\n\t\treturn this._normal;\n\t}\n\n\tget normalId(): number {\n\t\treturn this._normalId;\n\t}\n\n\tget margin(): number {\n\t\treturn this._margin;\n\t}\n\n\tset margin(margin: number) {\n\t\tif (this._margin !== margin) {\n\t\t\tthis._margin = margin;\n\t\t\tthis.onOtherChange();\n\t\t}\n\t}\n\n\tset(\n\t\tshape?: EShape | null,\n\t\tedge?: string | null,\n\t\tmargin?: number,\n\t\tx?: number,\n\t\ty?: number,\n\t\tnx?: number,\n\t\tny?: number\n\t): this {\n\t\tthis.lock();\n\t\tthis._acceptor.set(shape, edge);\n\n\t\tconst local = this._local;\n\t\tif (x != null && y != null) {\n\t\t\tlocal.set(x, y);\n\t\t} else if (x != null) {\n\t\t\tlocal.x = x;\n\t\t} else if (y != null) {\n\t\t\tlocal.y = y;\n\t\t}\n\n\t\tconst normal = this._normal;\n\t\tif (nx != null && ny != null) {\n\t\t\tnormal.set(nx, ny);\n\t\t} else if (nx != null) {\n\t\t\tnormal.x = nx;\n\t\t} else if (ny != null) {\n\t\t\tnormal.y = ny;\n\t\t}\n\n\t\tif (margin != null) {\n\t\t\tthis.margin = margin;\n\t\t}\n\n\t\tthis.unlock();\n\t\treturn this;\n\t}\n\n\tcopy(source: EShapeConnectorEdge): this {\n\t\tthis.lock();\n\t\tthis._acceptor.copy(source.acceptor);\n\t\tthis._local.copyFrom(source.local);\n\t\tthis._normal.copyFrom(source.normal);\n\t\tthis.margin = source.margin;\n\t\tthis.unlock();\n\t\treturn this;\n\t}\n\n\tserialize(manager: EShapeResourceManagerSerialization): number {\n\t\tconst acceptor = this._acceptor;\n\t\tconst shape = acceptor.shape;\n\t\tconst shapeUuid = shape ? shape.uuid : null;\n\t\tconst edge = acceptor.edge;\n\t\tconst edgeId = edge != null ? manager.addResource(edge) : -1;\n\t\tconst local = this._local;\n\t\tconst normal = this._normal;\n\t\treturn manager.addResource(\n\t\t\t`[${shapeUuid},${edgeId},${local.x},${local.y},${this._margin},${normal.x},${normal.y}]`\n\t\t);\n\t}\n\n\tdeserialize(\n\t\tresourceId: number,\n\t\tmapping: EShapeUuidMapping,\n\t\tmanager: EShapeResourceManagerDeserialization\n\t): void {\n\t\tconst resources = manager.resources;\n\t\tif (0 <= resourceId && resourceId < resources.length) {\n\t\t\tlet parsed = manager.getExtension<EShapeConnectorEdgeSerialized>(resourceId);\n\t\t\tif (parsed == null) {\n\t\t\t\tparsed = JSON.parse(resources[resourceId]) as EShapeConnectorEdgeSerialized;\n\t\t\t\tmanager.setExtension(resourceId, parsed);\n\t\t\t}\n\t\t\tlet shape: EShape | null = null;\n\t\t\tconst shapeUuid = parsed[0];\n\t\t\tif (shapeUuid != null) {\n\t\t\t\tshape = mapping.find(shapeUuid) || null;\n\t\t\t}\n\t\t\tthis.lock();\n\t\t\tconst acceptor = this._acceptor;\n\t\t\tacceptor.shape = shape;\n\t\t\tconst edgeId = parsed[1];\n\t\t\tacceptor.edge = 0 <= edgeId && edgeId < resources.length ? resources[edgeId] : null;\n\t\t\tthis._local.set(parsed[2], parsed[3]);\n\t\t\tconst normalX = parsed[5];\n\t\t\tconst normalY = parsed[6];\n\t\t\tconst normal = this._normal;\n\t\t\tif (normalX != null && normalY != null) {\n\t\t\t\tnormal.set(normalX, normalY);\n\t\t\t} else {\n\t\t\t\tnormal.set(1, 0);\n\t\t\t}\n\t\t\tthis.margin = parsed[4] || 0;\n\t\t\tthis.unlock();\n\t\t\tif (shape) {\n\t\t\t\tshape.connector.add(this);\n\t\t\t}\n\t\t}\n\t}\n\n\tfit(forcibly?: boolean): this {\n\t\tif (forcibly) {\n\t\t\tthis._localIdRequired += 1;\n\t\t\tthis._normalIdRequired += 1;\n\t\t}\n\t\tthis.doFit();\n\t\treturn this;\n\t}\n\n\tprotected doFit(): boolean {\n\t\tconst localIdRequired = this._localIdRequired;\n\t\tconst isLocalDirty = this._localId !== localIdRequired;\n\t\tconst normalIdRequired = this._normalIdRequired;\n\t\tconst isNormalDirty = this._normalId !== normalIdRequired;\n\t\tif (isLocalDirty || isNormalDirty) {\n\t\t\tthis._localId = localIdRequired;\n\t\t\tthis._normalId = normalIdRequired;\n\n\t\t\tconst acceptor = this._acceptor;\n\t\t\tconst acceptorShape = acceptor.shape;\n\t\t\tconst acceptorEdge = acceptor.edge;\n\t\t\tif (acceptorShape != null && acceptorEdge != null) {\n\t\t\t\tconst edge = EShapeAcceptors.get(acceptorShape.type).get(\n\t\t\t\t\tacceptorShape,\n\t\t\t\t\tacceptorEdge\n\t\t\t\t);\n\t\t\t\tif (edge) {\n\t\t\t\t\tconst transform = this.toAcceptorTransform(acceptorShape);\n\t\t\t\t\tconst a = transform.a;\n\t\t\t\t\tconst b = transform.b;\n\t\t\t\t\tconst c = transform.c;\n\t\t\t\t\tconst d = transform.d;\n\t\t\t\t\tconst tx = transform.tx;\n\t\t\t\t\tconst ty = transform.ty;\n\n\t\t\t\t\tthis.lock();\n\t\t\t\t\tif (isLocalDirty) {\n\t\t\t\t\t\tconst size = acceptorShape.size;\n\t\t\t\t\t\tconst pivot = acceptorShape.transform.pivot;\n\t\t\t\t\t\tconst lx = pivot.x + size.x * edge.x;\n\t\t\t\t\t\tconst ly = pivot.y + size.y * edge.y;\n\t\t\t\t\t\tthis._local.set(a * lx + c * ly + tx, b * lx + d * ly + ty);\n\t\t\t\t\t}\n\t\t\t\t\tif (isNormalDirty) {\n\t\t\t\t\t\tconst edgeNormal = edge.normal;\n\t\t\t\t\t\tconst nx = edgeNormal.x;\n\t\t\t\t\t\tconst ny = edgeNormal.y;\n\t\t\t\t\t\tconst x = a * nx + c * ny;\n\t\t\t\t\t\tconst y = b * nx + d * ny;\n\t\t\t\t\t\tconst l = x * x + y * y;\n\t\t\t\t\t\tconst normal = this._normal;\n\t\t\t\t\t\tif (0.000001 < l) {\n\t\t\t\t\t\t\tconst f = 1 / Math.sqrt(l);\n\t\t\t\t\t\t\tnormal.set(x * f, y * f);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tnormal.set(nx, ny);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tconst result = this._isLocalChanged || this._isNormalChanged;\n\t\t\t\t\tthis.unlock();\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n\tprotected toAcceptorTransform(shape: EShape): Matrix {\n\t\tshape.updateTransform();\n\t\tconst parent = this._parent;\n\t\tconst parentParent = parent.parent;\n\t\tif (parentParent) {\n\t\t\tparent.updateTransform();\n\t\t\treturn (EShapeConnectorEdgeImpl.WORK_MATRIX ??= new Matrix())\n\t\t\t\t.copyFrom(parentParent.transform.worldTransform)\n\t\t\t\t.invert()\n\t\t\t\t.append(shape.transform.worldTransform);\n\t\t} else {\n\t\t\treturn shape.transform.worldTransform;\n\t\t}\n\t}\n\n\tonAcceptorChange(): void {\n\t\tif (0 < this._lockCount) {\n\t\t\tthis._isLocalChanged = false;\n\t\t\tthis._isNormalChanged = false;\n\t\t\tthis._isAcceptorChanged = true;\n\t\t\treturn;\n\t\t}\n\t\tthis.fit(true);\n\t}\n\n\tprotected onLocalChange(): void {\n\t\tif (0 < this._lockCount) {\n\t\t\tthis._isLocalChanged = true;\n\t\t\treturn;\n\t\t}\n\t\tthis._localIdRequired += 1;\n\t\tthis._localId = this._localIdRequired;\n\t\tthis._onChange();\n\t}\n\n\tprotected onNormalChange(): void {\n\t\tif (0 < this._lockCount) {\n\t\t\tthis._isNormalChanged = true;\n\t\t\treturn;\n\t\t}\n\t\tthis._normalIdRequired += 1;\n\t\tthis._normalId = this._normalIdRequired;\n\t\tthis._onChange();\n\t}\n\n\tprotected onOtherChange(): void {\n\t\tif (0 < this._lockCount) {\n\t\t\tthis._isOtherChanged = true;\n\t\t\treturn;\n\t\t}\n\t\tthis._onChange();\n\t}\n\n\tattach(): this {\n\t\tconst shape = this._acceptor.shape;\n\t\tif (shape) {\n\t\t\tshape.connector.add(this);\n\t\t}\n\t\treturn this;\n\t}\n\n\tdetach(): this {\n\t\tconst shape = this._acceptor.shape;\n\t\tif (shape) {\n\t\t\tshape.connector.remove(this);\n\t\t}\n\t\treturn this;\n\t}\n}\n"]}
@@ -27,7 +27,7 @@ var EShapeUuidMappingImpl = /** @class */ (function () {
27
27
  for (var i = 0, imax = shapes.length; i < imax; ++i) {
28
28
  var shape = shapes[i];
29
29
  result.set(shape.uuid, shape);
30
- if (shape instanceof EShapeEmbedded) {
30
+ if (!(shape instanceof EShapeEmbedded)) {
31
31
  var children = shape.children;
32
32
  if (0 < children.length) {
33
33
  this.fillUuidToShape(children, result);
@@ -1 +1 @@
1
- {"version":3,"file":"e-shape-uuid-mapping-impl.js","sourceRoot":"","sources":["../../../../src/main/typescript/wcardinal/ui/shape/e-shape-uuid-mapping-impl.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE5D;IAIC,+BAAY,MAAgB;QAC3B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACvB,CAAC;IAED,oCAAI,GAAJ,UAAK,IAAY;QAChB,OAAO,IAAI,CAAC,cAAc,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACxC,CAAC;IAES,8CAAc,GAAxB;QACC,IAAI,MAAM,GAAG,IAAI,CAAC,YAAY,CAAC;QAC/B,IAAI,MAAM,IAAI,IAAI,EAAE;YACnB,MAAM,GAAG,IAAI,CAAC,cAAc,EAAE,CAAC;YAC/B,IAAI,CAAC,YAAY,GAAG,MAAM,CAAC;SAC3B;QACD,OAAO,MAAM,CAAC;IACf,CAAC;IAES,8CAAc,GAAxB;QACC,IAAM,MAAM,GAAG,IAAI,GAAG,EAAkB,CAAC;QACzC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QAC3C,OAAO,MAAM,CAAC;IACf,CAAC;IAES,+CAAe,GAAzB,UAA0B,MAAgB,EAAE,MAA2B;QACtE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,IAAI,EAAE,EAAE,CAAC,EAAE;YACpD,IAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;YACxB,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;YAE9B,IAAI,KAAK,YAAY,cAAc,EAAE;gBACpC,IAAM,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC;gBAChC,IAAI,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE;oBACxB,IAAI,CAAC,eAAe,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;iBACvC;aACD;SACD;IACF,CAAC;IACF,4BAAC;AAAD,CAAC,AAxCD,IAwCC","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { EShape } from \"./e-shape\";\nimport { EShapeUuidMapping } from \"./e-shape-uuid-mapping\";\nimport { EShapeEmbedded } from \"./variant/e-shape-embedded\";\n\nexport class EShapeUuidMappingImpl implements EShapeUuidMapping {\n\tprotected _shapes: EShape[];\n\tprotected _uuidToShape?: Map<number, EShape>;\n\n\tconstructor(shapes: EShape[]) {\n\t\tthis._shapes = shapes;\n\t}\n\n\tfind(uuid: number): EShape | undefined {\n\t\treturn this.getUuidToShape().get(uuid);\n\t}\n\n\tprotected getUuidToShape(): Map<number, EShape> {\n\t\tlet result = this._uuidToShape;\n\t\tif (result == null) {\n\t\t\tresult = this.newUuidToShape();\n\t\t\tthis._uuidToShape = result;\n\t\t}\n\t\treturn result;\n\t}\n\n\tprotected newUuidToShape(): Map<number, EShape> {\n\t\tconst result = new Map<number, EShape>();\n\t\tthis.fillUuidToShape(this._shapes, result);\n\t\treturn result;\n\t}\n\n\tprotected fillUuidToShape(shapes: EShape[], result: Map<number, EShape>): void {\n\t\tfor (let i = 0, imax = shapes.length; i < imax; ++i) {\n\t\t\tconst shape = shapes[i];\n\t\t\tresult.set(shape.uuid, shape);\n\n\t\t\tif (shape instanceof EShapeEmbedded) {\n\t\t\t\tconst children = shape.children;\n\t\t\t\tif (0 < children.length) {\n\t\t\t\t\tthis.fillUuidToShape(children, result);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n"]}
1
+ {"version":3,"file":"e-shape-uuid-mapping-impl.js","sourceRoot":"","sources":["../../../../src/main/typescript/wcardinal/ui/shape/e-shape-uuid-mapping-impl.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE5D;IAIC,+BAAY,MAAgB;QAC3B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACvB,CAAC;IAED,oCAAI,GAAJ,UAAK,IAAY;QAChB,OAAO,IAAI,CAAC,cAAc,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACxC,CAAC;IAES,8CAAc,GAAxB;QACC,IAAI,MAAM,GAAG,IAAI,CAAC,YAAY,CAAC;QAC/B,IAAI,MAAM,IAAI,IAAI,EAAE;YACnB,MAAM,GAAG,IAAI,CAAC,cAAc,EAAE,CAAC;YAC/B,IAAI,CAAC,YAAY,GAAG,MAAM,CAAC;SAC3B;QACD,OAAO,MAAM,CAAC;IACf,CAAC;IAES,8CAAc,GAAxB;QACC,IAAM,MAAM,GAAG,IAAI,GAAG,EAAkB,CAAC;QACzC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QAC3C,OAAO,MAAM,CAAC;IACf,CAAC;IAES,+CAAe,GAAzB,UAA0B,MAAgB,EAAE,MAA2B;QACtE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,IAAI,EAAE,EAAE,CAAC,EAAE;YACpD,IAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;YACxB,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;YAE9B,IAAI,CAAC,CAAC,KAAK,YAAY,cAAc,CAAC,EAAE;gBACvC,IAAM,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC;gBAChC,IAAI,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE;oBACxB,IAAI,CAAC,eAAe,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;iBACvC;aACD;SACD;IACF,CAAC;IACF,4BAAC;AAAD,CAAC,AAxCD,IAwCC","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { EShape } from \"./e-shape\";\nimport { EShapeUuidMapping } from \"./e-shape-uuid-mapping\";\nimport { EShapeEmbedded } from \"./variant/e-shape-embedded\";\n\nexport class EShapeUuidMappingImpl implements EShapeUuidMapping {\n\tprotected _shapes: EShape[];\n\tprotected _uuidToShape?: Map<number, EShape>;\n\n\tconstructor(shapes: EShape[]) {\n\t\tthis._shapes = shapes;\n\t}\n\n\tfind(uuid: number): EShape | undefined {\n\t\treturn this.getUuidToShape().get(uuid);\n\t}\n\n\tprotected getUuidToShape(): Map<number, EShape> {\n\t\tlet result = this._uuidToShape;\n\t\tif (result == null) {\n\t\t\tresult = this.newUuidToShape();\n\t\t\tthis._uuidToShape = result;\n\t\t}\n\t\treturn result;\n\t}\n\n\tprotected newUuidToShape(): Map<number, EShape> {\n\t\tconst result = new Map<number, EShape>();\n\t\tthis.fillUuidToShape(this._shapes, result);\n\t\treturn result;\n\t}\n\n\tprotected fillUuidToShape(shapes: EShape[], result: Map<number, EShape>): void {\n\t\tfor (let i = 0, imax = shapes.length; i < imax; ++i) {\n\t\t\tconst shape = shapes[i];\n\t\t\tresult.set(shape.uuid, shape);\n\n\t\t\tif (!(shape instanceof EShapeEmbedded)) {\n\t\t\t\tconst children = shape.children;\n\t\t\t\tif (0 < children.length) {\n\t\t\t\t\tthis.fillUuidToShape(children, result);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n"]}
@@ -61,18 +61,104 @@ var EShapeConnectorElbowPointsFillter = /** @class */ (function () {
61
61
  enumerable: false,
62
62
  configurable: true
63
63
  });
64
- EShapeConnectorElbowPointsFillter.prototype.tail = function (x, y, nx, ny, sxh, syh, margin) {
65
- if (Math.abs(nx) < Math.abs(ny)) {
66
- if (0 < ny) {
67
- if (y <= this.y + margin) {
68
- this.y += Math.max(margin, sxh);
69
- this.x = x;
64
+ EShapeConnectorElbowPointsFillter.prototype.toAxis = function (dx, dy, nx, ny) {
65
+ var anx = Math.abs(nx);
66
+ var any = Math.abs(ny);
67
+ var threshold = this._threshold;
68
+ if (anx < threshold && any < threshold) {
69
+ if (Math.abs(dx) < Math.abs(dy)) {
70
+ if (0 <= dy) {
71
+ return 2;
70
72
  }
71
73
  else {
72
- this.y = y;
74
+ return 0;
75
+ }
76
+ }
77
+ else {
78
+ if (0 <= dx) {
79
+ return 1;
80
+ }
81
+ else {
82
+ return 3;
83
+ }
84
+ }
85
+ }
86
+ var s = 0.2;
87
+ if (0 <= nx) {
88
+ if (0 <= ny) {
89
+ if (s < anx && s < any) {
90
+ if (dx < dy) {
91
+ return 2;
92
+ }
93
+ else {
94
+ return 1;
95
+ }
96
+ }
97
+ else if (s < anx) {
98
+ return 1;
99
+ }
100
+ else {
101
+ return 2;
73
102
  }
74
103
  }
75
104
  else {
105
+ if (s < anx && s < any) {
106
+ if (dx < -dy) {
107
+ return 0;
108
+ }
109
+ else {
110
+ return 2;
111
+ }
112
+ }
113
+ else if (s < anx) {
114
+ return 2;
115
+ }
116
+ else {
117
+ return 0;
118
+ }
119
+ }
120
+ }
121
+ else {
122
+ if (0 <= ny) {
123
+ if (s < anx && s < any) {
124
+ if (-dx < dy) {
125
+ return 2;
126
+ }
127
+ else {
128
+ return 3;
129
+ }
130
+ }
131
+ else if (s < anx) {
132
+ return 3;
133
+ }
134
+ else {
135
+ return 2;
136
+ }
137
+ }
138
+ else {
139
+ if (s < anx && s < any) {
140
+ if (dy < dx) {
141
+ return 0;
142
+ }
143
+ else {
144
+ return 3;
145
+ }
146
+ }
147
+ else if (s < anx) {
148
+ return 3;
149
+ }
150
+ else {
151
+ return 0;
152
+ }
153
+ }
154
+ }
155
+ };
156
+ EShapeConnectorElbowPointsFillter.prototype.toTailAxis = function (x, y, nx, ny) {
157
+ return this.toAxis(x - this.x, y - this.y, nx, ny);
158
+ };
159
+ EShapeConnectorElbowPointsFillter.prototype.tail = function (x, y, nx, ny, sxh, syh, margin) {
160
+ switch (this.toTailAxis(x, y, nx, ny)) {
161
+ case 0:
76
162
  if (this.y - margin <= y) {
77
163
  this.y -= Math.max(margin, syh);
78
164
  this.x = x;
@@ -80,10 +166,8 @@ var EShapeConnectorElbowPointsFillter = /** @class */ (function () {
80
166
  else {
81
167
  this.y = y;
82
168
  }
83
- }
84
- }
85
- else {
86
- if (0 < nx) {
169
+ break;
170
+ case 1:
87
171
  if (x <= this.x + margin) {
88
172
  this.x += Math.max(margin, sxh);
89
173
  this.y = y;
@@ -91,8 +175,17 @@ var EShapeConnectorElbowPointsFillter = /** @class */ (function () {
91
175
  else {
92
176
  this.x = x;
93
177
  }
94
- }
95
- else {
178
+ break;
179
+ case 2:
180
+ if (y <= this.y + margin) {
181
+ this.y += Math.max(margin, sxh);
182
+ this.x = x;
183
+ }
184
+ else {
185
+ this.y = y;
186
+ }
187
+ break;
188
+ case 3:
96
189
  if (this.x - margin <= x) {
97
190
  this.x -= Math.max(margin, sxh);
98
191
  this.y = y;
@@ -100,7 +193,7 @@ var EShapeConnectorElbowPointsFillter = /** @class */ (function () {
100
193
  else {
101
194
  this.x = x;
102
195
  }
103
- }
196
+ break;
104
197
  }
105
198
  };
106
199
  EShapeConnectorElbowPointsFillter.prototype.middle = function (x, y) {
@@ -113,34 +206,39 @@ var EShapeConnectorElbowPointsFillter = /** @class */ (function () {
113
206
  this.x = x;
114
207
  }
115
208
  };
209
+ EShapeConnectorElbowPointsFillter.prototype.toHeadAxis = function (x, y, nx, ny) {
210
+ return this.toAxis(this.x - x, this.y - y, nx, ny);
211
+ };
116
212
  EShapeConnectorElbowPointsFillter.prototype.head = function (x, y, nx, ny, sxh, syh, margin) {
117
- if (Math.abs(nx) < Math.abs(ny)) {
118
- if (0 < ny) {
119
- if (this.y <= y + margin) {
120
- this.y = y + Math.max(margin, syh);
121
- }
122
- }
123
- else {
213
+ switch (this.toHeadAxis(x, y, nx, ny)) {
214
+ case 0:
124
215
  if (y - margin <= this.y) {
125
216
  this.y = y - Math.max(margin, syh);
126
217
  }
127
- }
128
- this.x = x;
129
- this.y = y;
130
- }
131
- else {
132
- if (0 < nx) {
218
+ this.x = x;
219
+ this.y = y;
220
+ break;
221
+ case 1:
133
222
  if (this.x <= x + margin) {
134
223
  this.x = x + Math.max(margin, sxh);
135
224
  }
136
- }
137
- else {
225
+ this.y = y;
226
+ this.x = x;
227
+ break;
228
+ case 2:
229
+ if (this.y <= y + margin) {
230
+ this.y = y + Math.max(margin, syh);
231
+ }
232
+ this.x = x;
233
+ this.y = y;
234
+ break;
235
+ case 3:
138
236
  if (x - margin <= this.x) {
139
237
  this.x = x - Math.max(margin, sxh);
140
238
  }
141
- }
142
- this.y = y;
143
- this.x = x;
239
+ this.y = y;
240
+ this.x = x;
241
+ break;
144
242
  }
145
243
  };
146
244
  EShapeConnectorElbowPointsFillter.prototype.margin = function (tail, head) {
@@ -1 +1 @@
1
- {"version":3,"file":"e-shape-connector-elbow-points-fillter.js","sourceRoot":"","sources":["../../../../../src/main/typescript/wcardinal/ui/shape/variant/e-shape-connector-elbow-points-fillter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;IAQC,2CAAY,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,gDAAC;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,KAAK,GAAG,CAAC,CAAC,GAAG,IAAI,CAA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AG,CAAC,CAAC;IAChC,CAAC;IACF,wCAAC;AAAD,CAAC,AApMD,IAoMC","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport class EShapeConnectorElbowPointsFillter {\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\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): void {\n\t\tif (Math.abs(nx) < Math.abs(ny)) {\n\t\t\tif (0 < ny) {\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} else {\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}\n\t\t} else {\n\t\t\tif (0 < nx) {\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} else {\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}\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\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): void {\n\t\tif (Math.abs(nx) < Math.abs(ny)) {\n\t\t\tif (0 < ny) {\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} else {\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}\n\t\t\tthis.x = x;\n\t\t\tthis.y = y;\n\t\t} else {\n\t\t\tif (0 < nx) {\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} else {\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}\n\t\t\tthis.y = y;\n\t\t\tthis.x = x;\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-fillter.js","sourceRoot":"","sources":["../../../../../src/main/typescript/wcardinal/ui/shape/variant/e-shape-connector-elbow-points-fillter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;IAQC,2CAAY,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,gDAAC;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,KAAK,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC;oBAC5B,MAAM,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC;iBAC5B;qBAAM;oBACN,MAAM,CAAC,KAAK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;IACF,wCAAC;AAAD,CAAC,AA7RD,IA6RC","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport class EShapeConnectorElbowPointsFillter {\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 toAxis(dx: number, dy: number, nx: number, ny: number): 0 | 1 | 2 | 3 {\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;\n\t\t\t\t} else {\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (0 <= dx) {\n\t\t\t\t\treturn 1;\n\t\t\t\t} else {\n\t\t\t\t\treturn 3;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tconst s = 0.2;\n\t\tif (0 <= nx) {\n\t\t\tif (0 <= ny) {\n\t\t\t\tif (s < anx && s < any) {\n\t\t\t\t\tif (dx < dy) {\n\t\t\t\t\t\treturn 2;\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn 1;\n\t\t\t\t\t}\n\t\t\t\t} else if (s < anx) {\n\t\t\t\t\treturn 1;\n\t\t\t\t} else {\n\t\t\t\t\treturn 2;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (s < anx && s < any) {\n\t\t\t\t\tif (dx < -dy) {\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn 2;\n\t\t\t\t\t}\n\t\t\t\t} else if (s < anx) {\n\t\t\t\t\treturn 2;\n\t\t\t\t} else {\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tif (0 <= ny) {\n\t\t\t\tif (s < anx && s < any) {\n\t\t\t\t\tif (-dx < dy) {\n\t\t\t\t\t\treturn 2;\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn 3;\n\t\t\t\t\t}\n\t\t\t\t} else if (s < anx) {\n\t\t\t\t\treturn 3;\n\t\t\t\t} else {\n\t\t\t\t\treturn 2;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (s < anx && s < any) {\n\t\t\t\t\tif (dy < dx) {\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn 3;\n\t\t\t\t\t}\n\t\t\t\t} else if (s < anx) {\n\t\t\t\t\treturn 3;\n\t\t\t\t} else {\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected toTailAxis(x: number, y: number, nx: number, ny: number): 0 | 1 | 2 | 3 {\n\t\treturn this.toAxis(x - this.x, y - this.y, nx, ny);\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): void {\n\t\tswitch (this.toTailAxis(x, y, nx, ny)) {\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(x: number, y: number, nx: number, ny: number): 0 | 1 | 2 | 3 {\n\t\treturn this.toAxis(this.x - x, this.y - y, nx, ny);\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): void {\n\t\tswitch (this.toHeadAxis(x, y, nx, ny)) {\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,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.212.0
2
+ Winter Cardinal UI v0.213.0
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.212.0
2
+ Winter Cardinal UI v0.213.0
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.212.0
2
+ Winter Cardinal UI v0.213.0
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.212.0
2
+ Winter Cardinal UI v0.213.0
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5