@wcardinal/wcardinal-ui 0.376.1 → 0.376.3

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.
@@ -78,7 +78,9 @@ export declare abstract class EShapeBase extends utils.EventEmitter implements E
78
78
  protected newTransform(): EShapeTransform;
79
79
  onSizeChange(): void;
80
80
  onTransformChange(): void;
81
+ protected callChildTransformChange(): void;
81
82
  protected onThisTransformChange(): void;
83
+ protected callParentTransformChange(): void;
82
84
  onParentTransformChange(): void;
83
85
  lock(part: EShapeLockPart): this;
84
86
  unlock(part: EShapeLockPart, invoke: boolean): this;
@@ -6,6 +6,7 @@ import { Matrix, ObservablePoint } from "pixi.js";
6
6
  import { EShapeAcceptors } from "./e-shape-acceptors";
7
7
  import { EShapeConnectorEdgeAcceptorImpl } from "./e-shape-connector-edge-acceptor-impl";
8
8
  import { EShapeAcceptorEdgeSide } from "./e-shape-acceptor-edge-side";
9
+ import { EShapeBase } from "./variant/e-shape-base";
9
10
  var EShapeConnectorEdgeImpl = /** @class */ (function () {
10
11
  function EShapeConnectorEdgeImpl(parent, onChange) {
11
12
  var _this = this;
@@ -360,15 +361,15 @@ var EShapeConnectorEdgeImpl = /** @class */ (function () {
360
361
  shape.updateTransform();
361
362
  var parent = this._parent;
362
363
  var parentParent = parent.parent;
363
- if (parentParent) {
364
+ if (parentParent instanceof EShapeBase) {
364
365
  parent.updateTransform();
365
366
  return result
366
- .copyFrom(parentParent.transform.worldTransform)
367
+ .copyFrom(parentParent.transform.internalTransform)
367
368
  .invert()
368
- .append(shape.transform.worldTransform);
369
+ .append(shape.transform.internalTransform);
369
370
  }
370
371
  else {
371
- return result.copyFrom(shape.transform.worldTransform);
372
+ return result.copyFrom(shape.transform.internalTransform);
372
373
  }
373
374
  };
374
375
  EShapeConnectorEdgeImpl.prototype.onAcceptorChange = function () {
@@ -1 +1 @@
1
- {"version":3,"file":"e-shape-connector-edge-impl.js","sourceRoot":"","sources":["../../../../src/main/typ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oint } 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\";\nimport { EShapeAcceptorEdgeSide } from \"./e-shape-acceptor-edge-side\";\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 _acceptorTransformNew: Matrix;\n\tprotected _acceptorTransformOld: Matrix;\n\tprotected _hasAcceptorTransformOld: boolean;\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 _side: EShapeAcceptorEdgeSide;\n\tprotected _margin: number;\n\tprotected _other: EShapeConnectorEdge | null;\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\t\tthis._acceptorTransformNew = new Matrix();\n\t\tthis._acceptorTransformOld = new Matrix();\n\t\tthis._hasAcceptorTransformOld = false;\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._side = EShapeAcceptorEdgeSide.TOP;\n\n\t\tthis._margin = 0;\n\n\t\tthis._other = null;\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\tthis._hasAcceptorTransformOld = false;\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 parent(): EShapeConnector {\n\t\treturn this._parent;\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 side(): EShapeAcceptorEdgeSide {\n\t\treturn this._side;\n\t}\n\n\tset side(side: EShapeAcceptorEdgeSide) {\n\t\tif (this._side !== side) {\n\t\t\tthis._side = side;\n\t\t\tthis.onOtherChange();\n\t\t}\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\tget other(): EShapeConnectorEdge | null {\n\t\treturn this._other;\n\t}\n\n\tset other(other: EShapeConnectorEdge | null) {\n\t\tthis._other = other;\n\t}\n\n\tset(\n\t\tacceptorShape?: EShape | null,\n\t\tacceptorEdge?: string | null,\n\t\tacceptorX?: number | null,\n\t\tacceptorY?: number | null,\n\t\tmargin?: number,\n\t\tx?: number,\n\t\ty?: number,\n\t\tnx?: number,\n\t\tny?: number,\n\t\tside?: EShapeAcceptorEdgeSide\n\t): this {\n\t\tthis.lock();\n\t\tthis._acceptor.set(acceptorShape, acceptorEdge, acceptorX, acceptorY);\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 (side != null) {\n\t\t\tthis.side = side;\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.side = source.side;\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\tconst side = this._side;\n\t\treturn manager.addResource(\n\t\t\t`[${shapeUuid},${edgeId},${local.x},${local.y},${this._margin},${normal.x},${normal.y},${acceptor.x},${acceptor.y},${side}]`\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\tacceptor.x = parsed[7] ?? null;\n\t\t\tacceptor.y = parsed[8] ?? 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.side = parsed[9] ?? EShapeAcceptorEdgeSide.TOP;\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 oat = this._acceptorTransformOld;\n\t\t\t\t\tconst nat = this._acceptorTransformNew;\n\t\t\t\t\tthis.toAcceptorTransform(acceptorShape, nat);\n\n\t\t\t\t\tconst other = this._other;\n\t\t\t\t\tconst isOtherDangling =\n\t\t\t\t\t\tthis._hasAcceptorTransformOld &&\n\t\t\t\t\t\tother != null &&\n\t\t\t\t\t\tother.acceptor.shape == null;\n\t\t\t\t\tconst work = (EShapeConnectorEdgeImpl.WORK_MATRIX ??= new Matrix());\n\t\t\t\t\tif (isOtherDangling) {\n\t\t\t\t\t\toat.copyTo(work).invert().prepend(nat);\n\t\t\t\t\t}\n\t\t\t\t\tthis._acceptorTransformNew = oat;\n\t\t\t\t\tthis._acceptorTransformOld = nat;\n\t\t\t\t\tthis._hasAcceptorTransformOld = true;\n\n\t\t\t\t\tthis.lock();\n\t\t\t\t\tif (isLocalDirty) {\n\t\t\t\t\t\tconst l = this._local;\n\t\t\t\t\t\tconst olx = l.x;\n\t\t\t\t\t\tconst oly = l.y;\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 x = pivot.x + size.x * (acceptor.x ?? edge.x);\n\t\t\t\t\t\tconst y = pivot.y + size.y * (acceptor.y ?? edge.y);\n\t\t\t\t\t\tconst nlx = nat.a * x + nat.c * y + nat.tx;\n\t\t\t\t\t\tconst nly = nat.b * x + nat.d * y + nat.ty;\n\t\t\t\t\t\tl.set(nlx, nly);\n\n\t\t\t\t\t\tif (isOtherDangling) {\n\t\t\t\t\t\t\tconst ol = other.local;\n\t\t\t\t\t\t\tconst oolx = ol.x;\n\t\t\t\t\t\t\tconst ooly = ol.y;\n\t\t\t\t\t\t\tconst nolx = work.a * oolx + work.c * ooly + work.tx;\n\t\t\t\t\t\t\tconst noly = work.b * oolx + work.d * ooly + work.ty;\n\t\t\t\t\t\t\tconst odx = oolx - olx;\n\t\t\t\t\t\t\tconst ody = ooly - oly;\n\t\t\t\t\t\t\tconst ndx = nolx - nlx;\n\t\t\t\t\t\t\tconst ndy = noly - nly;\n\t\t\t\t\t\t\tconst od = odx * odx + ody * ody;\n\t\t\t\t\t\t\tconst nd = ndx * ndx + ndy * ndy;\n\t\t\t\t\t\t\tif (0.000001 < nd) {\n\t\t\t\t\t\t\t\tconst f = Math.sqrt(od / nd);\n\t\t\t\t\t\t\t\tol.set(nlx + ndx * f, nly + ndy * f);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tol.set(nolx, noly);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (isNormalDirty) {\n\t\t\t\t\t\tconst en = edge.normal;\n\t\t\t\t\t\tconst enx = en.x;\n\t\t\t\t\t\tconst eny = en.y;\n\t\t\t\t\t\tconst nx = nat.a * enx + nat.c * eny;\n\t\t\t\t\t\tconst ny = nat.b * enx + nat.d * eny;\n\t\t\t\t\t\tconst sd = nx * nx + ny * ny;\n\t\t\t\t\t\tconst n = this._normal;\n\t\t\t\t\t\tif (0.000001 < sd) {\n\t\t\t\t\t\t\tconst f = 1 / Math.sqrt(sd);\n\t\t\t\t\t\t\tn.set(nx * f, ny * f);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tn.set(enx, eny);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (isOtherDangling) {\n\t\t\t\t\t\t\tconst on = other.normal;\n\t\t\t\t\t\t\tconst oonx = on.x;\n\t\t\t\t\t\t\tconst oony = on.y;\n\t\t\t\t\t\t\tconst nonx = work.a * oonx + work.c * oony;\n\t\t\t\t\t\t\tconst nony = work.b * oonx + work.d * oony;\n\t\t\t\t\t\t\tconst osd = nonx * nonx + nony * nony;\n\t\t\t\t\t\t\tif (0.000001 < osd) {\n\t\t\t\t\t\t\t\tconst f = 1 / Math.sqrt(osd);\n\t\t\t\t\t\t\t\ton.set(nonx * f, nony * f);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ton.set(oonx, oony);\n\t\t\t\t\t\t\t}\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, result: Matrix): 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 result\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 result.copyFrom(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._hasAcceptorTransformOld = false;\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\tif (shape.connector.add(this)) {\n\t\t\t\tthis.onAcceptorChange();\n\t\t\t}\n\t\t}\n\t\treturn this;\n\t}\n\n\tdetach(exceptions?: Set<EShape>): this {\n\t\tconst shape = this._acceptor.shape;\n\t\tif (shape != null && (exceptions == null || !exceptions.has(shape))) {\n\t\t\tif (shape.connector.remove(this)) {\n\t\t\t\tthis.onAcceptorChange();\n\t\t\t}\n\t\t}\n\t\treturn this;\n\t}\n}\n"]}
1
+ {"version":3,"file":"e-shape-connector-edge-impl.js","sourceRoot":"","sources":["../../../../src/main/typescript/wcardinal/ui/shape/e-shape-connector-edge-impl.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAU,MAAM,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE1D,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAItD,OAAO,EAAE,+BAA+B,EAAE,MAAM,wCAAwC,CAAC;AAIzF,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AACtE,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEpD;IAwBC,iCAAY,MAAuB,EAAE,QAAoB;QAAzD,iBA+BC;QA9BA,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAI,CAAC,SAAS,GAAG,IAAI,+BAA+B,CAAC,IAAI,CAAC,CAAC;QAC3D,IAAI,CAAC,qBAAqB,GAAG,IAAI,MAAM,EAAE,CAAC;QAC1C,IAAI,CAAC,qBAAqB,GAAG,IAAI,MAAM,EAAE,CAAC;QAC1C,IAAI,CAAC,wBAAwB,GAAG,KAAK,CAAC;QAEtC,IAAI,CAAC,MAAM,GAAG,IAAI,eAAe,CAAC;YACjC,KAAI,CAAC,aAAa,EAAE,CAAC;QACtB,CAAC,EAAE,SAAS,CAAC,CAAC;QACd,IAAI,CAAC,gBAAgB,GAAG,CAAC,CAAC;QAC1B,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC;QAElB,IAAI,CAAC,OAAO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,IAAI,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE;YACpE,IAAI,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE;gBACjC,IAAI,CAAC,gBAAgB,EAAE,CAAC;aACxB;SACD;QACD,OAAO,IAAI,CAAC;IACb,CAAC;IACF,8BAAC;AAAD,CAAC,AA9cD,IA8cC","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\";\nimport { EShapeAcceptorEdgeSide } from \"./e-shape-acceptor-edge-side\";\nimport { EShapeBase } from \"./variant/e-shape-base\";\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 _acceptorTransformNew: Matrix;\n\tprotected _acceptorTransformOld: Matrix;\n\tprotected _hasAcceptorTransformOld: boolean;\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 _side: EShapeAcceptorEdgeSide;\n\tprotected _margin: number;\n\tprotected _other: EShapeConnectorEdge | null;\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\t\tthis._acceptorTransformNew = new Matrix();\n\t\tthis._acceptorTransformOld = new Matrix();\n\t\tthis._hasAcceptorTransformOld = false;\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._side = EShapeAcceptorEdgeSide.TOP;\n\n\t\tthis._margin = 0;\n\n\t\tthis._other = null;\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\tthis._hasAcceptorTransformOld = false;\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 parent(): EShapeConnector {\n\t\treturn this._parent;\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 side(): EShapeAcceptorEdgeSide {\n\t\treturn this._side;\n\t}\n\n\tset side(side: EShapeAcceptorEdgeSide) {\n\t\tif (this._side !== side) {\n\t\t\tthis._side = side;\n\t\t\tthis.onOtherChange();\n\t\t}\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\tget other(): EShapeConnectorEdge | null {\n\t\treturn this._other;\n\t}\n\n\tset other(other: EShapeConnectorEdge | null) {\n\t\tthis._other = other;\n\t}\n\n\tset(\n\t\tacceptorShape?: EShape | null,\n\t\tacceptorEdge?: string | null,\n\t\tacceptorX?: number | null,\n\t\tacceptorY?: number | null,\n\t\tmargin?: number,\n\t\tx?: number,\n\t\ty?: number,\n\t\tnx?: number,\n\t\tny?: number,\n\t\tside?: EShapeAcceptorEdgeSide\n\t): this {\n\t\tthis.lock();\n\t\tthis._acceptor.set(acceptorShape, acceptorEdge, acceptorX, acceptorY);\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 (side != null) {\n\t\t\tthis.side = side;\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.side = source.side;\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\tconst side = this._side;\n\t\treturn manager.addResource(\n\t\t\t`[${shapeUuid},${edgeId},${local.x},${local.y},${this._margin},${normal.x},${normal.y},${acceptor.x},${acceptor.y},${side}]`\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\tacceptor.x = parsed[7] ?? null;\n\t\t\tacceptor.y = parsed[8] ?? 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.side = parsed[9] ?? EShapeAcceptorEdgeSide.TOP;\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 oat = this._acceptorTransformOld;\n\t\t\t\t\tconst nat = this._acceptorTransformNew;\n\t\t\t\t\tthis.toAcceptorTransform(acceptorShape, nat);\n\n\t\t\t\t\tconst other = this._other;\n\t\t\t\t\tconst isOtherDangling =\n\t\t\t\t\t\tthis._hasAcceptorTransformOld &&\n\t\t\t\t\t\tother != null &&\n\t\t\t\t\t\tother.acceptor.shape == null;\n\t\t\t\t\tconst work = (EShapeConnectorEdgeImpl.WORK_MATRIX ??= new Matrix());\n\t\t\t\t\tif (isOtherDangling) {\n\t\t\t\t\t\toat.copyTo(work).invert().prepend(nat);\n\t\t\t\t\t}\n\t\t\t\t\tthis._acceptorTransformNew = oat;\n\t\t\t\t\tthis._acceptorTransformOld = nat;\n\t\t\t\t\tthis._hasAcceptorTransformOld = true;\n\n\t\t\t\t\tthis.lock();\n\t\t\t\t\tif (isLocalDirty) {\n\t\t\t\t\t\tconst l = this._local;\n\t\t\t\t\t\tconst olx = l.x;\n\t\t\t\t\t\tconst oly = l.y;\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 x = pivot.x + size.x * (acceptor.x ?? edge.x);\n\t\t\t\t\t\tconst y = pivot.y + size.y * (acceptor.y ?? edge.y);\n\t\t\t\t\t\tconst nlx = nat.a * x + nat.c * y + nat.tx;\n\t\t\t\t\t\tconst nly = nat.b * x + nat.d * y + nat.ty;\n\t\t\t\t\t\tl.set(nlx, nly);\n\n\t\t\t\t\t\tif (isOtherDangling) {\n\t\t\t\t\t\t\tconst ol = other.local;\n\t\t\t\t\t\t\tconst oolx = ol.x;\n\t\t\t\t\t\t\tconst ooly = ol.y;\n\t\t\t\t\t\t\tconst nolx = work.a * oolx + work.c * ooly + work.tx;\n\t\t\t\t\t\t\tconst noly = work.b * oolx + work.d * ooly + work.ty;\n\t\t\t\t\t\t\tconst odx = oolx - olx;\n\t\t\t\t\t\t\tconst ody = ooly - oly;\n\t\t\t\t\t\t\tconst ndx = nolx - nlx;\n\t\t\t\t\t\t\tconst ndy = noly - nly;\n\t\t\t\t\t\t\tconst od = odx * odx + ody * ody;\n\t\t\t\t\t\t\tconst nd = ndx * ndx + ndy * ndy;\n\t\t\t\t\t\t\tif (0.000001 < nd) {\n\t\t\t\t\t\t\t\tconst f = Math.sqrt(od / nd);\n\t\t\t\t\t\t\t\tol.set(nlx + ndx * f, nly + ndy * f);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tol.set(nolx, noly);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (isNormalDirty) {\n\t\t\t\t\t\tconst en = edge.normal;\n\t\t\t\t\t\tconst enx = en.x;\n\t\t\t\t\t\tconst eny = en.y;\n\t\t\t\t\t\tconst nx = nat.a * enx + nat.c * eny;\n\t\t\t\t\t\tconst ny = nat.b * enx + nat.d * eny;\n\t\t\t\t\t\tconst sd = nx * nx + ny * ny;\n\t\t\t\t\t\tconst n = this._normal;\n\t\t\t\t\t\tif (0.000001 < sd) {\n\t\t\t\t\t\t\tconst f = 1 / Math.sqrt(sd);\n\t\t\t\t\t\t\tn.set(nx * f, ny * f);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tn.set(enx, eny);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (isOtherDangling) {\n\t\t\t\t\t\t\tconst on = other.normal;\n\t\t\t\t\t\t\tconst oonx = on.x;\n\t\t\t\t\t\t\tconst oony = on.y;\n\t\t\t\t\t\t\tconst nonx = work.a * oonx + work.c * oony;\n\t\t\t\t\t\t\tconst nony = work.b * oonx + work.d * oony;\n\t\t\t\t\t\t\tconst osd = nonx * nonx + nony * nony;\n\t\t\t\t\t\t\tif (0.000001 < osd) {\n\t\t\t\t\t\t\t\tconst f = 1 / Math.sqrt(osd);\n\t\t\t\t\t\t\t\ton.set(nonx * f, nony * f);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ton.set(oonx, oony);\n\t\t\t\t\t\t\t}\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, result: Matrix): Matrix {\n\t\tshape.updateTransform();\n\t\tconst parent = this._parent;\n\t\tconst parentParent = parent.parent;\n\t\tif (parentParent instanceof EShapeBase) {\n\t\t\tparent.updateTransform();\n\t\t\treturn result\n\t\t\t\t.copyFrom(parentParent.transform.internalTransform)\n\t\t\t\t.invert()\n\t\t\t\t.append(shape.transform.internalTransform);\n\t\t} else {\n\t\t\treturn result.copyFrom(shape.transform.internalTransform);\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._hasAcceptorTransformOld = false;\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\tif (shape.connector.add(this)) {\n\t\t\t\tthis.onAcceptorChange();\n\t\t\t}\n\t\t}\n\t\treturn this;\n\t}\n\n\tdetach(exceptions?: Set<EShape>): this {\n\t\tconst shape = this._acceptor.shape;\n\t\tif (shape != null && (exceptions == null || !exceptions.has(shape))) {\n\t\t\tif (shape.connector.remove(this)) {\n\t\t\t\tthis.onAcceptorChange();\n\t\t\t}\n\t\t}\n\t\treturn this;\n\t}\n}\n"]}
@@ -53,10 +53,7 @@ var EShapeBase = /** @class */ (function (_super) {
53
53
  this._boundsInternalTransformId = NaN;
54
54
  this._boundsLocalTransformId = NaN;
55
55
  if (!this._lockTransformChild.isLocked()) {
56
- var parent_1 = this.parent;
57
- if (parent_1 != null) {
58
- parent_1.onChildTransformChange();
59
- }
56
+ this.callChildTransformChange();
60
57
  }
61
58
  var points = this._points;
62
59
  if (points != null) {
@@ -74,19 +71,19 @@ var EShapeBase = /** @class */ (function (_super) {
74
71
  };
75
72
  EShapeBase.prototype.onTransformChange = function () {
76
73
  if (!this._lockTransformChild.isLocked()) {
77
- var parent_2 = this.parent;
78
- if (parent_2 != null) {
79
- parent_2.onChildTransformChange();
80
- }
74
+ this.callChildTransformChange();
81
75
  }
82
76
  if (!this._lockTransformThis.isLocked()) {
83
77
  this.onThisTransformChange();
84
78
  }
85
79
  if (!this._lockTransformParent.isLocked()) {
86
- var children = this.children;
87
- for (var i = 0, imax = children.length; i < imax; ++i) {
88
- children[i].onParentTransformChange();
89
- }
80
+ this.callParentTransformChange();
81
+ }
82
+ };
83
+ EShapeBase.prototype.callChildTransformChange = function () {
84
+ var parent = this.parent;
85
+ if (parent != null) {
86
+ parent.onChildTransformChange();
90
87
  }
91
88
  };
92
89
  EShapeBase.prototype.onThisTransformChange = function () {
@@ -96,12 +93,18 @@ var EShapeBase = /** @class */ (function (_super) {
96
93
  connector.fit(true);
97
94
  }
98
95
  };
96
+ EShapeBase.prototype.callParentTransformChange = function () {
97
+ var children = this.children;
98
+ for (var i = 0, imax = children.length; i < imax; ++i) {
99
+ children[i].onParentTransformChange();
100
+ }
101
+ };
99
102
  EShapeBase.prototype.onParentTransformChange = function () {
103
+ if (!this._lockTransformThis.isLocked()) {
104
+ this.onThisTransformChange();
105
+ }
100
106
  if (!this._lockTransformParent.isLocked()) {
101
- var children = this.children;
102
- for (var i = 0, imax = children.length; i < imax; ++i) {
103
- children[i].onParentTransformChange();
104
- }
107
+ this.callParentTransformChange();
105
108
  }
106
109
  };
107
110
  EShapeBase.prototype.lock = function (part) {
@@ -122,9 +125,9 @@ var EShapeBase = /** @class */ (function (_super) {
122
125
  EShapeBase.prototype.unlock = function (part, invoke) {
123
126
  if (part & EShapeLockPart.TRANSFORM_CHILD) {
124
127
  if (this._lockTransformChild.unlock() && invoke) {
125
- var parent_3 = this.parent;
126
- if (parent_3 != null) {
127
- parent_3.onChildTransformChange();
128
+ var parent_1 = this.parent;
129
+ if (parent_1 != null) {
130
+ parent_1.onChildTransformChange();
128
131
  }
129
132
  }
130
133
  }
@@ -210,9 +213,9 @@ var EShapeBase = /** @class */ (function (_super) {
210
213
  Object.defineProperty(EShapeBase.prototype, "visible", {
211
214
  get: function () {
212
215
  if (this._visible) {
213
- var parent_4 = this.parent;
214
- if (parent_4 instanceof EShapeBase) {
215
- return parent_4.visible;
216
+ var parent_2 = this.parent;
217
+ if (parent_2 instanceof EShapeBase) {
218
+ return parent_2.visible;
216
219
  }
217
220
  return true;
218
221
  }
@@ -230,9 +233,9 @@ var EShapeBase = /** @class */ (function (_super) {
230
233
  Object.defineProperty(EShapeBase.prototype, "worldVisible", {
231
234
  get: function () {
232
235
  if (this._visible) {
233
- var parent_5 = this.parent;
234
- if (parent_5) {
235
- return parent_5.worldVisible;
236
+ var parent_3 = this.parent;
237
+ if (parent_3) {
238
+ return parent_3.worldVisible;
236
239
  }
237
240
  return true;
238
241
  }
@@ -1 +1 @@
1
- {"version":3,"file":"e-shape-base.js","sourceRoot":"","sources":["../../../../../src/main/typescript/wcardinal/ui/shape/variant/e-shape-base.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAEH,OAAO,EAIN,KAAK,EACL,SAAS,EAGT,SAAS,EACT,KAAK,EACL,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAGrD,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAGxD,OAAO,EAAE,4BAA4B,EAAE,MAAM,qCAAqC,CAAC;AAEnF,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAUtD,OAAO,EAAE,4BAA4B,EAAE,MAAM,sCAAsC,CAAC;AAEpF,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAG5D,OAAO,EAAmB,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAG5E,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAEhE,OAAO,EAAE,6BAA6B,EAAE,MAAM,sCAAsC,CAAC;AACrF,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD;IAAyC,8BAAkB;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AC,IAAI,CAAC,eAAe,CAAC,CAAC;iBACrC;qBAAM;oBACN,IAAM,SAAS,GAAG,IAAI,CAAC,UAAU,CAAC;oBAClC,IAAI,SAAS,EAAE;wBACd,SAAS,CAAC,KAAK,EAAE,CAAC;qBAClB;iBACD;aACD;iBAAM;gBACN,IAAM,SAAS,GAAG,IAAI,CAAC,UAAU,CAAC;gBAClC,IAAI,SAAS,EAAE;oBACd,SAAS,CAAC,KAAK,EAAE,CAAC;iBAClB;aACD;SACD;QACD,IAAI,IAAI,GAAG,cAAc,CAAC,UAAU,EAAE;YACrC,IAAM,gBAAgB,GAAG,MAAM,CAAC,aAAa,EAAE,CAAC;YAChD,IAAI,gBAAgB,IAAI,IAAI,EAAE;gBAC7B,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;aACvC;iBAAM;gBACN,IAAM,UAAU,GAAG,IAAI,CAAC,WAAW,CAAC;gBACpC,IAAI,UAAU,IAAI,IAAI,EAAE;oBACvB,UAAU,CAAC,KAAK,EAAE,CAAC;iBACnB;aACD;SACD;QACD,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QACtC,OAAO,IAAI,CAAC;IACb,CAAC;IACF,iBAAC;AAAD,CAAC,AA94BD,CAAyC,KAAK,CAAC,YAAY,GA84B1D","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {\n\tDisplayObject,\n\tIPoint,\n\tMatrix,\n\tPoint,\n\tRectangle,\n\tRenderer,\n\tTexture,\n\tTransform,\n\tutils\n} from \"pixi.js\";\nimport { DApplications } from \"../../d-applications\";\nimport { DBaseStateSet } from \"../../d-base-state-set\";\nimport { DDiagramSerializedItem } from \"../../d-diagram-serialized\";\nimport { EShapeAction } from \"../action/e-shape-action\";\nimport { EShape } from \"../e-shape\";\nimport { EShapeConnectorContainer } from \"../e-shape-connector-container\";\nimport { EShapeConnectorContainerImpl } from \"../e-shape-connector-container-impl\";\nimport { EShapeContainer } from \"../e-shape-container\";\nimport { EShapeCopyPart } from \"../e-shape-copy-part\";\nimport { EShapeCorner } from \"../e-shape-corner\";\nimport { EShapeEditor } from \"../e-shape-editor\";\nimport { EShapeFill } from \"../e-shape-fill\";\nimport { EShapeGradientLike } from \"../e-shape-gradient\";\nimport { EShapeLayout } from \"../e-shape-layout\";\nimport { EShapePoints } from \"../e-shape-points\";\nimport { EShapeResourceManagerSerialization } from \"../e-shape-resource-manager-serialization\";\nimport { EShapeRuntime } from \"../e-shape-runtime\";\nimport { EShapeStateSet } from \"../e-shape-state-set\";\nimport { EShapeStateSetImplObservable } from \"../e-shape-state-set-impl-observable\";\nimport { EShapeStroke } from \"../e-shape-stroke\";\nimport { EShapeStrokeStyle } from \"../e-shape-stroke-style\";\nimport { EShapeData } from \"../e-shape-data\";\nimport { EShapeText } from \"../e-shape-text\";\nimport { EShapeTransform, EShapeTransformImpl } from \"../e-shape-transform\";\nimport { EShapeType } from \"../e-shape-type\";\nimport { EShapeUploaded } from \"../e-shape-uploaded\";\nimport { EShapeBaseHitTestData } from \"./e-shape-base-hit-test-data\";\nimport { hitTestBBox } from \"./hit-test-bbox\";\nimport { toGradientSerialized } from \"./to-gradient-serialized\";\nimport { EShapeCapabilityContainer } from \"../e-shape-capability-container\";\nimport { EShapeCapabilityContainerImpl } from \"../e-shape-capability-container-impl\";\nimport { EShapeCapability } from \"../e-shape-capability\";\nimport { EShapeLock } from \"./e-shape-lock\";\nimport { EShapeLockPart } from \"./e-shape-lock-part\";\n\nexport abstract class EShapeBase extends utils.EventEmitter implements EShape {\n\tprotected static WORK_HIT_TEST_DATA?: EShapeBaseHitTestData;\n\tid: string;\n\tuuid: number;\n\treadonly type: EShapeType;\n\tabstract readonly size: IPoint;\n\tabstract readonly fill: EShapeFill;\n\tabstract readonly stroke: EShapeStroke;\n\treadonly transform: EShapeTransform;\n\tabstract radius: number;\n\tabstract corner: EShapeCorner;\n\tprotected _points?: EShapePoints;\n\tprotected _image?: HTMLImageElement;\n\timageSrc?: string;\n\ttexture?: Texture;\n\tabstract gradient?: EShapeGradientLike;\n\tabstract readonly text: EShapeText;\n\t/** @deprecated in favor of {@link data} */\n\tabstract readonly tag: EShapeData;\n\tabstract readonly data: EShapeData;\n\treadonly action: EShapeAction;\n\tcursor?: string;\n\tinteractive: boolean;\n\tshortcut?: string;\n\ttitle?: string;\n\n\tprotected _connector?: EShapeConnectorContainer;\n\n\tprotected _visible: boolean;\n\n\tprotected _lockTransformChild: EShapeLock;\n\tprotected _lockTransformThis: EShapeLock;\n\tprotected _lockTransformParent: EShapeLock;\n\tprotected _lockUploaded: EShapeLock;\n\n\tprotected _bounds?: Rectangle;\n\tprotected _boundsTransformId: number;\n\tprotected _boundsInternal?: Rectangle;\n\tprotected _boundsInternalTransformId: number;\n\tprotected _boundsLocal?: Rectangle;\n\tprotected _boundsLocalTransformId: number;\n\n\tprotected _state?: EShapeStateSet;\n\tprotected _capability?: EShapeCapabilityContainer;\n\n\t// Hierarchy\n\tparent: EShapeContainer | EShape | null;\n\tchildren: EShape[];\n\tlayout?: EShapeLayout;\n\n\t// Working space\n\tindex: number; // A work space for sorting.\n\tselected: boolean;\n\treference: number; // Count of references from commands\n\n\t// Working space for the viewer\n\truntime?: EShapeRuntime;\n\n\t// Working space for the editor\n\teditor?: EShapeEditor;\n\n\t// Working space for the renderer\n\tuploaded?: EShapeUploaded;\n\n\tconstructor(type: EShapeType) {\n\t\tsuper();\n\t\tthis.id = \"\";\n\t\tthis.uuid = 0;\n\t\tthis.type = type;\n\t\tthis.transform = this.newTransform();\n\t\tthis.action = new EShapeAction();\n\t\tthis._visible = true;\n\n\t\tthis._lockTransformChild = new EShapeLock();\n\t\tthis._lockTransformThis = new EShapeLock();\n\t\tthis._lockTransformParent = new EShapeLock();\n\t\tthis._lockUploaded = new EShapeLock();\n\n\t\tthis._boundsTransformId = NaN;\n\t\tthis._boundsInternalTransformId = NaN;\n\t\tthis._boundsLocalTransformId = NaN;\n\n\t\tthis.interactive = false;\n\n\t\t//\n\t\tthis.parent = null;\n\t\tthis.children = [];\n\n\t\t//\n\t\tthis.selected = false;\n\t\tthis.index = 0;\n\t\tthis.reference = 0;\n\t}\n\n\tprotected newTransform(): EShapeTransform {\n\t\treturn new EShapeTransformImpl(this);\n\t}\n\n\tonSizeChange(): void {\n\t\tthis._boundsTransformId = NaN;\n\t\tthis._boundsInternalTransformId = NaN;\n\t\tthis._boundsLocalTransformId = NaN;\n\n\t\tif (!this._lockTransformChild.isLocked()) {\n\t\t\tconst parent = this.parent;\n\t\t\tif (parent != null) {\n\t\t\t\tparent.onChildTransformChange();\n\t\t\t}\n\t\t}\n\t\tconst points = this._points;\n\t\tif (points != null) {\n\t\t\tpoints.onSizeChange();\n\t\t}\n\t\tthis.updateUploaded();\n\n\t\tconst connector = this._connector;\n\t\tif (connector != null) {\n\t\t\tconnector.fit(true);\n\t\t}\n\n\t\tconst runtime = this.runtime;\n\t\tif (runtime != null) {\n\t\t\truntime.onResize(this);\n\t\t}\n\t}\n\n\tonTransformChange(): void {\n\t\tif (!this._lockTransformChild.isLocked()) {\n\t\t\tconst parent = this.parent;\n\t\t\tif (parent != null) {\n\t\t\t\tparent.onChildTransformChange();\n\t\t\t}\n\t\t}\n\t\tif (!this._lockTransformThis.isLocked()) {\n\t\t\tthis.onThisTransformChange();\n\t\t}\n\t\tif (!this._lockTransformParent.isLocked()) {\n\t\t\tconst children = this.children;\n\t\t\tfor (let i = 0, imax = children.length; i < imax; ++i) {\n\t\t\t\tchildren[i].onParentTransformChange();\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected onThisTransformChange(): void {\n\t\tthis.updateUploaded();\n\t\tconst connector = this._connector;\n\t\tif (connector != null) {\n\t\t\tconnector.fit(true);\n\t\t}\n\t}\n\n\tonParentTransformChange(): void {\n\t\tif (!this._lockTransformParent.isLocked()) {\n\t\t\tconst children = this.children;\n\t\t\tfor (let i = 0, imax = children.length; i < imax; ++i) {\n\t\t\t\tchildren[i].onParentTransformChange();\n\t\t\t}\n\t\t}\n\t}\n\n\tlock(part: EShapeLockPart): this {\n\t\tif (part & EShapeLockPart.UPLOADED) {\n\t\t\tthis._lockUploaded.lock();\n\t\t}\n\t\tif (part & EShapeLockPart.TRANSFORM_PARENT) {\n\t\t\tthis._lockTransformParent.lock();\n\t\t}\n\t\tif (part & EShapeLockPart.TRANSFORM_THIS) {\n\t\t\tthis._lockTransformThis.lock();\n\t\t}\n\t\tif (part & EShapeLockPart.TRANSFORM_CHILD) {\n\t\t\tthis._lockTransformChild.lock();\n\t\t}\n\t\treturn this;\n\t}\n\n\tunlock(part: EShapeLockPart, invoke: boolean): this {\n\t\tif (part & EShapeLockPart.TRANSFORM_CHILD) {\n\t\t\tif (this._lockTransformChild.unlock() && invoke) {\n\t\t\t\tconst parent = this.parent;\n\t\t\t\tif (parent != null) {\n\t\t\t\t\tparent.onChildTransformChange();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (part & EShapeLockPart.TRANSFORM_THIS) {\n\t\t\tif (this._lockTransformThis.unlock() && invoke) {\n\t\t\t\tthis.onThisTransformChange();\n\t\t\t}\n\t\t}\n\t\tif (part & EShapeLockPart.TRANSFORM_PARENT) {\n\t\t\tif (this._lockTransformParent.unlock() && invoke) {\n\t\t\t\tconst children = this.children;\n\t\t\t\tfor (let i = 0, imax = children.length; i < imax; ++i) {\n\t\t\t\t\tchildren[i].onParentTransformChange();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (part & EShapeLockPart.UPLOADED) {\n\t\t\tconst lockUploaded = this._lockUploaded;\n\t\t\tif (lockUploaded.unlock() && invoke) {\n\t\t\t\tthis.updateUploaded(lockUploaded.isHigh());\n\t\t\t}\n\t\t}\n\t\treturn this;\n\t}\n\n\tonChildTransformChange(): void {\n\t\t//\n\t}\n\n\tupdateUploaded(recursively?: boolean): void {\n\t\tif (this._lockUploaded.isLocked()) {\n\t\t\treturn;\n\t\t}\n\t\tconst uploaded = this.uploaded;\n\t\tif (uploaded != null) {\n\t\t\tuploaded.update(this);\n\t\t}\n\t\tif (recursively === true) {\n\t\t\tconst children = this.children;\n\t\t\tfor (let i = 0, imax = children.length; i < imax; ++i) {\n\t\t\t\tchildren[i].updateUploaded(true);\n\t\t\t}\n\t\t}\n\t}\n\n\tget image(): HTMLImageElement | undefined {\n\t\treturn this._image;\n\t}\n\n\tset image(image: HTMLImageElement | undefined) {\n\t\tthis._image = image;\n\t}\n\n\tget points(): EShapePoints | undefined {\n\t\treturn this._points;\n\t}\n\n\tget root(): EShape {\n\t\tlet root: EShape = this;\n\t\twhile (root.parent instanceof EShapeBase) {\n\t\t\troot = root.parent;\n\t\t}\n\t\treturn root;\n\t}\n\n\tget connector(): EShapeConnectorContainer {\n\t\tlet result = this._connector;\n\t\tif (result == null) {\n\t\t\tresult = new EShapeConnectorContainerImpl(this);\n\t\t\tthis._connector = result;\n\t\t}\n\t\treturn result;\n\t}\n\n\tget visible(): boolean {\n\t\tif (this._visible) {\n\t\t\tconst parent = this.parent;\n\t\t\tif (parent instanceof EShapeBase) {\n\t\t\t\treturn parent.visible;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tset visible(visible: boolean) {\n\t\tif (this._visible !== visible) {\n\t\t\tthis._visible = visible;\n\t\t\tthis.updateUploaded(true);\n\t\t}\n\t}\n\n\tget worldVisible(): boolean {\n\t\tif (this._visible) {\n\t\t\tconst parent = this.parent;\n\t\t\tif (parent) {\n\t\t\t\treturn parent.worldVisible;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\t//\n\tabstract clone(): EShape;\n\n\t//\n\ttoDirty(): void {\n\t\tconst parent = this.parent;\n\t\tif (parent != null) {\n\t\t\tparent.toDirty();\n\t\t}\n\t}\n\n\t// Hierarchy\n\tattach(parent: EShapeContainer | EShape, at?: number): this {\n\t\tthis.detach();\n\t\tthis.parent = parent;\n\t\tconst children = parent.children;\n\t\tif (at != null && 0 <= at && at < children.length) {\n\t\t\tchildren.splice(at, 0, this);\n\t\t} else {\n\t\t\tchildren.push(this);\n\t\t}\n\t\tparent.onChildTransformChange();\n\t\tparent.toDirty();\n\t\tthis.onAttach();\n\t\treturn this;\n\t}\n\n\tonAttach(): void {\n\t\tthis.uploaded = undefined;\n\t\tconst connector = this._connector;\n\t\tif (connector) {\n\t\t\tconnector.attach();\n\t\t\tconnector.fit(true);\n\t\t}\n\t\tconst children = this.children;\n\t\tfor (let i = 0, imax = children.length; i < imax; ++i) {\n\t\t\tchildren[i].onAttach();\n\t\t}\n\t}\n\n\tdetach(exceptions?: Set<EShape>): this {\n\t\tconst parent = this.parent;\n\t\tif (parent) {\n\t\t\tthis.parent = null;\n\t\t\tconst children = parent.children;\n\t\t\tconst index = children.indexOf(this);\n\t\t\tif (0 <= index) {\n\t\t\t\tchildren.splice(index, 1);\n\t\t\t\tparent.onChildTransformChange();\n\t\t\t\tparent.toDirty();\n\t\t\t\tthis.onDetach(exceptions);\n\t\t\t}\n\t\t}\n\t\treturn this;\n\t}\n\n\tonDetach(exceptions?: Set<EShape>): void {\n\t\tthis.uploaded = undefined;\n\t\tconst connector = this._connector;\n\t\tif (connector) {\n\t\t\tconnector.detach(exceptions);\n\t\t}\n\t\tconst children = this.children;\n\t\tfor (let i = 0, imax = children.length; i < imax; ++i) {\n\t\t\tchildren[i].onDetach(exceptions);\n\t\t}\n\t}\n\n\t// Transform\n\tupdateTransform(): void {\n\t\tconst parent = this.parent;\n\t\tif (parent) {\n\t\t\tif (parent.parent) {\n\t\t\t\tparent.updateTransform();\n\t\t\t}\n\t\t\tthis.transform.updateTransform(parent.transform);\n\t\t} else {\n\t\t\tthis.transform.updateTransform(Transform.IDENTITY);\n\t\t}\n\t}\n\n\t// Serialization\n\tserializeChildren(manager: EShapeResourceManagerSerialization): DDiagramSerializedItem[] {\n\t\tconst children = this.children;\n\t\tconst childrenSerialized = [];\n\t\tfor (let i = 0, imax = children.length; i < imax; ++i) {\n\t\t\tconst child = children[i];\n\t\t\tchildrenSerialized.push(child.serialize(manager));\n\t\t}\n\t\treturn childrenSerialized;\n\t}\n\n\tserializeImage(manager: EShapeResourceManagerSerialization): number {\n\t\tconst image = this._image;\n\t\treturn image != null ? manager.addResource(image.src) : -1;\n\t}\n\n\tserializeGradient(manager: EShapeResourceManagerSerialization): number {\n\t\tconst gradient = this.gradient;\n\t\tif (gradient != null) {\n\t\t\tif (gradient.serialized == null) {\n\t\t\t\tgradient.serialized = toGradientSerialized(gradient);\n\t\t\t}\n\t\t\treturn manager.addResource(gradient.serialized);\n\t\t}\n\t\treturn -1;\n\t}\n\n\tserializeState(manager: EShapeResourceManagerSerialization): number {\n\t\tconst state = this.state;\n\t\treturn (this.interactive ? 1 : 0) | (state.isFocusable ? 0 : 2) | (state.isActive ? 4 : 0);\n\t}\n\n\tserialize(manager: EShapeResourceManagerSerialization): DDiagramSerializedItem {\n\t\tconst transform = this.transform;\n\t\tconst position = transform.position;\n\t\tconst pivot = transform.pivot;\n\t\tconst size = this.size;\n\t\tconst shortcut = this.shortcut;\n\t\tconst shortcutId = shortcut != null ? manager.addResource(shortcut) : -1;\n\t\tconst cursor = this.cursor;\n\t\tconst cursorId = cursor != null ? manager.addResource(cursor) : -1;\n\t\tconst title = this.title;\n\t\tconst titleId = title != null ? manager.addResource(title) : -1;\n\t\tlet capabilitiesAdded: EShapeCapability = EShapeCapability.NONE;\n\t\tlet capabilitiesRemoved: EShapeCapability = EShapeCapability.NONE;\n\t\tlet capabilitiesLocked: EShapeCapability = EShapeCapability.NONE;\n\t\tconst capability = this._capability;\n\t\tif (capability != null) {\n\t\t\tcapabilitiesAdded = capability.added;\n\t\t\tcapabilitiesRemoved = capability.removed;\n\t\t\tcapabilitiesLocked = capability.locked;\n\t\t}\n\t\treturn [\n\t\t\tthis.type,\n\t\t\tmanager.addResource(this.id),\n\t\t\tposition.x,\n\t\t\tposition.y,\n\t\t\tsize.x,\n\t\t\tsize.y,\n\t\t\ttransform.rotation,\n\t\t\ttransform.skew.x,\n\t\t\tthis.fill.serialize(manager),\n\t\t\tthis.stroke.serialize(manager),\n\t\t\tcursorId,\n\t\t\tthis.text.serialize(manager),\n\t\t\tthis.data.serialize(manager),\n\t\t\tthis.radius,\n\t\t\tthis.corner,\n\t\t\t-1,\n\t\t\t-1,\n\t\t\tthis.action.serialize(manager),\n\t\t\tthis.serializeImage(manager),\n\t\t\tthis.serializeGradient(manager),\n\t\t\tthis.serializeChildren(manager),\n\t\t\tpivot.x,\n\t\t\tpivot.y,\n\t\t\tthis.serializeState(manager),\n\t\t\tshortcutId,\n\t\t\ttitleId,\n\t\t\tthis.uuid,\n\t\t\tcapabilitiesAdded,\n\t\t\tcapabilitiesRemoved,\n\t\t\tcapabilitiesLocked\n\t\t];\n\t}\n\n\taddUuid(manager: EShapeResourceManagerSerialization): void {\n\t\tthis.uuid = manager.addUuid(this.uuid);\n\t\tconst children = this.children;\n\t\tfor (let i = 0, imax = children.length; i < imax; ++i) {\n\t\t\tchildren[i].addUuid(manager);\n\t\t}\n\t}\n\n\tupdateUuid(manager: EShapeResourceManagerSerialization): void {\n\t\tthis.uuid = manager.updateUuid(this.uuid);\n\t\tconst children = this.children;\n\t\tfor (let i = 0, imax = children.length; i < imax; ++i) {\n\t\t\tchildren[i].updateUuid(manager);\n\t\t}\n\t}\n\n\t// Hit test\n\tprotected getShapeScale(): number {\n\t\tconst container = this.root.parent as any;\n\t\tif (container != null && container.getShapeScale != null) {\n\t\t\treturn container.getShapeScale();\n\t\t}\n\t\treturn 1.0;\n\t}\n\n\tprotected getStrokeWidthScale(style: EShapeStrokeStyle): number {\n\t\tif (style & EShapeStrokeStyle.NON_EXPANDING_WIDTH) {\n\t\t\tif (style & EShapeStrokeStyle.NON_SHRINKING_WIDTH) {\n\t\t\t\treturn this.getShapeScale();\n\t\t\t} else {\n\t\t\t\treturn Math.min(1.0, this.getShapeScale());\n\t\t\t}\n\t\t} else {\n\t\t\tif (style & EShapeStrokeStyle.NON_SHRINKING_WIDTH) {\n\t\t\t\treturn Math.max(1.0, this.getShapeScale());\n\t\t\t} else {\n\t\t\t\treturn 1.0;\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected getHitTestSize(result: EShapeBaseHitTestData): EShapeBaseHitTestData {\n\t\tconst size = this.size;\n\t\tresult.width = 0.5 * size.x;\n\t\tresult.height = 0.5 * size.y;\n\t\treturn result;\n\t}\n\n\ttoHitTestData(x: number, y: number): EShapeBaseHitTestData {\n\t\tconst result = this.getHitTestSize(\n\t\t\t(EShapeBase.WORK_HIT_TEST_DATA ??= new EShapeBaseHitTestData())\n\t\t);\n\t\tconst sx = result.width;\n\t\tconst sy = result.height;\n\t\tconst pivot = this.transform.pivot;\n\t\tconst dx = x - pivot.x;\n\t\tconst dy = y - pivot.y;\n\t\tconst stroke = this.stroke;\n\t\tconst strokeWidth = stroke.enable ? stroke.width : 0;\n\t\tconst strokeScale = this.getStrokeWidthScale(stroke.style);\n\t\tconst strokeAlign = stroke.align;\n\t\tconst s = strokeWidth * strokeScale * strokeAlign;\n\t\treturn result.set(\n\t\t\t0 <= sx ? +dx : -dx,\n\t\t\t0 <= sy ? +dy : -dy,\n\t\t\tMath.abs(sx) + s,\n\t\t\tMath.abs(sy) + s,\n\t\t\tstrokeWidth,\n\t\t\tstrokeScale,\n\t\t\tstrokeAlign\n\t\t);\n\t}\n\n\tcontains(x: number, y: number): EShape | null {\n\t\tconst data = this.toHitTestData(x, y);\n\t\tif (\n\t\t\tthis.containsAbs(\n\t\t\t\tdata.x,\n\t\t\t\tdata.y,\n\t\t\t\tdata.width,\n\t\t\t\tdata.height,\n\t\t\t\tdata.strokeWidth,\n\t\t\t\tdata.strokeScale,\n\t\t\t\tdata.strokeAlign\n\t\t\t)\n\t\t) {\n\t\t\treturn this;\n\t\t}\n\t\treturn this.containsText(x, y) || this.containsChildren(x, y);\n\t}\n\n\tprotected containsText(x: number, y: number): EShape | null {\n\t\tconst text = this.text;\n\t\tconst textAtlas = text.atlas;\n\t\tif (textAtlas != null) {\n\t\t\tconst textWorld = text.world;\n\t\t\tif (textWorld != null) {\n\t\t\t\tconst transform = this.transform.internalTransform;\n\t\t\t\tconst tx = transform.a * x + transform.c * y + transform.tx - textWorld[0];\n\t\t\t\tconst ty = transform.b * x + transform.d * y + transform.ty - textWorld[1];\n\t\t\t\tconst th = textWorld[2] * tx + textWorld[3] * ty;\n\t\t\t\tconst tv = textWorld[4] * tx + textWorld[5] * ty;\n\t\t\t\tconst w = textWorld[6];\n\t\t\t\tconst h = textWorld[7];\n\t\t\t\tif (0 <= th && th <= w && 0 <= tv && tv <= h) {\n\t\t\t\t\treturn this;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\tprotected containsChildren(x: number, y: number): EShape | null {\n\t\tconst children = this.children;\n\t\tfor (let i = children.length - 1; 0 <= i; --i) {\n\t\t\tconst child = children[i];\n\t\t\tchild.updateTransform();\n\t\t\tconst localTransform = child.transform.localTransform;\n\t\t\tconst a = localTransform.a;\n\t\t\tconst b = localTransform.b;\n\t\t\tconst c = localTransform.c;\n\t\t\tconst d = localTransform.d;\n\t\t\tconst tx = localTransform.tx;\n\t\t\tconst ty = localTransform.ty;\n\t\t\tconst id = 1 / (a * d - c * b);\n\t\t\tconst lx = (d * x - c * y + ty * c - tx * d) * id;\n\t\t\tconst ly = (a * y - b * x - ty * a + tx * b) * id;\n\t\t\tconst childResult = child.contains(lx, ly);\n\t\t\tif (childResult != null) {\n\t\t\t\treturn childResult;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\tcontainsBBox(x: number, y: number): boolean {\n\t\tconst data = this.toHitTestData(x, y);\n\t\treturn this.containsAbsBBox(data.x, data.y, data.width, data.height);\n\t}\n\n\tcontainsAbs(\n\t\tx: number,\n\t\ty: number,\n\t\tax: number,\n\t\tay: number,\n\t\tsw: number,\n\t\tss: number,\n\t\tsa: number\n\t): boolean {\n\t\treturn this.containsAbsBBox(x, y, ax, ay);\n\t}\n\n\tcontainsAbsBBox(x: number, y: number, ax: number, ay: number): boolean {\n\t\treturn hitTestBBox(x, y, ax, ay);\n\t}\n\n\tselect(point: Point): boolean {\n\t\treturn false;\n\t}\n\n\t//\n\ttoGlobal(position: IPoint, result: Point, skipUpdate?: boolean): Point {\n\t\tif (skipUpdate !== true) {\n\t\t\tthis.updateTransform();\n\t\t}\n\t\tresult.copyFrom(position);\n\t\tthis.transform.worldTransform.apply(result, result);\n\t\treturn result;\n\t}\n\n\ttoLocal(position: IPoint, from?: DisplayObject, result?: Point, skipUpdate?: boolean): Point {\n\t\tif (skipUpdate !== true) {\n\t\t\tthis.updateTransform();\n\t\t}\n\t\tif (result === undefined) {\n\t\t\tresult = new Point();\n\t\t}\n\t\tresult.copyFrom(position);\n\t\tthis.transform.worldTransform.applyInverse(result, result);\n\t\treturn result;\n\t}\n\n\tgetBounds(skipUpdate?: boolean, result?: Rectangle): Rectangle {\n\t\tif (skipUpdate !== true) {\n\t\t\tthis.updateTransform();\n\t\t}\n\t\tconst bounds = this._bounds || new Rectangle();\n\t\tthis._bounds = bounds;\n\t\tconst worldId = this.transform.getWorldId();\n\t\tif (worldId !== this._boundsTransformId) {\n\t\t\tthis._boundsTransformId = worldId;\n\t\t\tthis.getBounds_(this.transform.worldTransform, bounds);\n\t\t}\n\t\tresult ??= new Rectangle();\n\t\tresult.copyFrom(bounds);\n\t\treturn result;\n\t}\n\n\tgetBoundsInternal(skipUpdate?: boolean, result?: Rectangle): Rectangle {\n\t\tif (skipUpdate !== true) {\n\t\t\tthis.updateTransform();\n\t\t}\n\t\tconst boundsInternal = this._boundsInternal || new Rectangle();\n\t\tthis._boundsInternal = boundsInternal;\n\t\tconst currentLocalId = this.transform.getLocalIdCurrent();\n\t\tif (currentLocalId !== this._boundsInternalTransformId) {\n\t\t\tthis._boundsInternalTransformId = currentLocalId;\n\t\t\tthis.getBounds_(this.transform.internalTransform, boundsInternal);\n\t\t}\n\t\tresult ??= new Rectangle();\n\t\tresult.copyFrom(boundsInternal);\n\t\treturn result;\n\t}\n\n\tgetBoundsLocal(skipUpdate?: boolean, result?: Rectangle): Rectangle {\n\t\tif (skipUpdate !== true) {\n\t\t\tthis.updateTransform();\n\t\t}\n\t\tconst boundsLocal = this._boundsLocal || new Rectangle();\n\t\tthis._boundsLocal = boundsLocal;\n\t\tconst currentLocalId = this.transform.getLocalIdCurrent();\n\t\tif (currentLocalId !== this._boundsLocalTransformId) {\n\t\t\tthis._boundsLocalTransformId = currentLocalId;\n\t\t\tthis.getBounds_(this.transform.localTransform, boundsLocal);\n\t\t}\n\t\tresult ??= new Rectangle();\n\t\tresult.copyFrom(boundsLocal);\n\t\treturn result;\n\t}\n\n\tprotected getBoundsSize(): IPoint {\n\t\treturn this.size;\n\t}\n\n\tprotected getBounds_(transform: Matrix, result: Rectangle): Rectangle {\n\t\tconst pivot = this.transform.pivot;\n\t\tconst px = pivot.x;\n\t\tconst py = pivot.y;\n\t\tconst size = this.getBoundsSize();\n\t\tconst sx = 0.5 * size.x;\n\t\tconst sy = 0.5 * size.y;\n\n\t\tconst a = transform.a;\n\t\tconst b = transform.b;\n\t\tconst c = transform.c;\n\t\tconst d = transform.d;\n\n\t\tlet x = -sx + px;\n\t\tlet y = -sy + py;\n\t\tconst x0 = a * x + c * y;\n\t\tconst y0 = b * x + d * y;\n\n\t\tx = +sx + px;\n\t\ty = -sy + py;\n\t\tconst x1 = a * x + c * y;\n\t\tconst y1 = b * x + d * y;\n\n\t\tx = -sx + px;\n\t\ty = +sy + py;\n\t\tconst x2 = a * x + c * y;\n\t\tconst y2 = b * x + d * y;\n\n\t\tx = +sx + px;\n\t\ty = +sy + py;\n\t\tconst x3 = a * x + c * y;\n\t\tconst y3 = b * x + d * y;\n\n\t\tconst xmin = Math.min(x0, x1, x2, x3);\n\t\tconst ymin = Math.min(y0, y1, y2, y3);\n\t\tconst xmax = Math.max(x0, x1, x2, x3);\n\t\tconst ymax = Math.max(y0, y1, y2, y3);\n\t\tresult.x = xmin + transform.tx;\n\t\tresult.y = ymin + transform.ty;\n\t\tresult.width = xmax - xmin;\n\t\tresult.height = ymax - ymin;\n\t\treturn result;\n\t}\n\n\t//\n\tdestroy(): void {\n\t\tconst children = this.children;\n\t\tfor (let i = children.length - 1; 0 <= i; --i) {\n\t\t\tchildren[i].destroy();\n\t\t}\n\t\tchildren.length = 0;\n\t}\n\n\t//\n\tprotected onStateChange(newState: DBaseStateSet, oldState: DBaseStateSet): void {\n\t\tconst runtime = this.runtime;\n\t\tif (runtime != null) {\n\t\t\truntime.onStateChange(this, newState, oldState);\n\t\t}\n\n\t\tconst children = this.children;\n\t\tfor (let i = 0, imax = children.length; i < imax; ++i) {\n\t\t\tconst child = children[i];\n\t\t\tif (child instanceof EShapeBase) {\n\t\t\t\tchild.state.onParentChange(newState, oldState);\n\t\t\t}\n\t\t}\n\t}\n\n\tget state(): EShapeStateSet {\n\t\tlet result = this._state;\n\t\tif (result == null) {\n\t\t\tresult = new EShapeStateSetImplObservable((newState, oldState): void => {\n\t\t\t\tthis.onStateChange(newState, oldState);\n\t\t\t});\n\t\t\tthis._state = result;\n\t\t}\n\t\treturn result;\n\t}\n\n\tget capability(): EShapeCapabilityContainer {\n\t\tlet result = this._capability;\n\t\tif (result == null) {\n\t\t\tresult = new EShapeCapabilityContainerImpl();\n\t\t\tthis._capability = result;\n\t\t}\n\t\treturn result;\n\t}\n\n\tgetCapability(): EShapeCapabilityContainer | undefined {\n\t\treturn this._capability;\n\t}\n\n\tfocus(): this {\n\t\tthis.setFocused(true);\n\t\treturn this;\n\t}\n\n\tblur(): this {\n\t\tthis.setFocused(false);\n\t\treturn this;\n\t}\n\n\tprotected setFocused(isFocused: boolean): void {\n\t\tif (this.state.isFocused !== isFocused) {\n\t\t\tconst layer = DApplications.getLayer(this);\n\t\t\tif (layer) {\n\t\t\t\tlayer.getFocusController().set(this, isFocused);\n\t\t\t}\n\t\t}\n\t}\n\n\tonKeyDown(e: KeyboardEvent): boolean {\n\t\tconst runtime = this.runtime;\n\t\tif (runtime) {\n\t\t\treturn runtime.onKeyDown(this, e);\n\t\t}\n\t\treturn false;\n\t}\n\n\tonKeyUp(e: KeyboardEvent): boolean {\n\t\tconst runtime = this.runtime;\n\t\tif (runtime) {\n\t\t\treturn runtime.onKeyUp(this, e);\n\t\t}\n\t\treturn false;\n\t}\n\n\t//\n\tupdate(time: number): void {\n\t\tconst runtime = this.runtime;\n\t\tif (runtime) {\n\t\t\truntime.update(this, time);\n\t\t}\n\t}\n\n\tonRender(time: number, renderer: Renderer): void {\n\t\tconst runtime = this.runtime;\n\t\tif (runtime) {\n\t\t\truntime.onRender(this, time, renderer);\n\t\t}\n\t}\n\n\tcopy(source: EShape, part: EShapeCopyPart = EShapeCopyPart.ALL): this {\n\t\tthis.lock(EShapeLockPart.ALL);\n\t\tthis.id = source.id;\n\t\tthis.uuid = source.uuid;\n\t\tthis.visible = source.visible;\n\t\tif (part & EShapeCopyPart.TRANSFORM) {\n\t\t\tconst transform = this.transform;\n\t\t\tconst sourceTransform = source.transform;\n\t\t\ttransform.position.copyFrom(sourceTransform.position);\n\t\t\ttransform.rotation = sourceTransform.rotation;\n\t\t\ttransform.skew.copyFrom(sourceTransform.skew);\n\t\t\ttransform.pivot.copyFrom(sourceTransform.pivot);\n\t\t\ttransform.scale.copyFrom(sourceTransform.scale);\n\t\t}\n\t\tif (part & EShapeCopyPart.SIZE) {\n\t\t\tthis.size.copyFrom(source.size);\n\t\t}\n\t\tif (part & EShapeCopyPart.STYLE) {\n\t\t\tthis.fill.copy(source.fill);\n\t\t\tthis.stroke.copy(source.stroke);\n\t\t\tthis.text.copy(source.text);\n\t\t\tthis.radius = source.radius;\n\t\t\tthis.corner = source.corner;\n\t\t}\n\t\tif (part & EShapeCopyPart.DATA) {\n\t\t\tthis.data.copy(source.data);\n\t\t}\n\t\tif (part & EShapeCopyPart.IMAGE) {\n\t\t\tthis.image = source.image;\n\t\t}\n\t\tif (part & EShapeCopyPart.ACTION) {\n\t\t\tthis.action.clearAndAddAll(source.action.values);\n\t\t\tthis.interactive = source.interactive;\n\t\t\tthis.cursor = source.cursor;\n\t\t\tthis.shortcut = source.shortcut;\n\t\t}\n\t\tif (part & EShapeCopyPart.POINTS) {\n\t\t\tconst sourcePoints = source.points;\n\t\t\tif (sourcePoints != null) {\n\t\t\t\tconst points = this.points;\n\t\t\t\tif (points != null) {\n\t\t\t\t\tpoints.copy(sourcePoints);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (part & EShapeCopyPart.STATE) {\n\t\t\tthis.state.lock(false).copy(source.state).unlock();\n\t\t}\n\t\tif (part & EShapeCopyPart.CONNECTOR) {\n\t\t\tif (source instanceof EShapeBase) {\n\t\t\t\tconst sourceConnector = source._connector;\n\t\t\t\tif (sourceConnector) {\n\t\t\t\t\tthis.connector.copy(sourceConnector);\n\t\t\t\t} else {\n\t\t\t\t\tconst connector = this._connector;\n\t\t\t\t\tif (connector) {\n\t\t\t\t\t\tconnector.clear();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tconst connector = this._connector;\n\t\t\t\tif (connector) {\n\t\t\t\t\tconnector.clear();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (part & EShapeCopyPart.CAPABILITY) {\n\t\t\tconst sourceCapability = source.getCapability();\n\t\t\tif (sourceCapability != null) {\n\t\t\t\tthis.capability.copy(sourceCapability);\n\t\t\t} else {\n\t\t\t\tconst capability = this._capability;\n\t\t\t\tif (capability != null) {\n\t\t\t\t\tcapability.clear();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tthis.unlock(EShapeLockPart.ALL, true);\n\t\treturn this;\n\t}\n}\n"]}
1
+ {"version":3,"file":"e-shape-base.js","sourceRoot":"","sources":["../../../../../src/main/typescript/wcardinal/ui/shape/variant/e-shape-base.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAEH,OAAO,EAIN,KAAK,EACL,SAAS,EAGT,SAAS,EACT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AAI,CAAC,gBAAgB,CAAC,CAAC;aACvC;iBAAM;gBACN,IAAM,UAAU,GAAG,IAAI,CAAC,WAAW,CAAC;gBACpC,IAAI,UAAU,IAAI,IAAI,EAAE;oBACvB,UAAU,CAAC,KAAK,EAAE,CAAC;iBACnB;aACD;SACD;QACD,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QACtC,OAAO,IAAI,CAAC;IACb,CAAC;IACF,iBAAC;AAAD,CAAC,AAn5BD,CAAyC,KAAK,CAAC,YAAY,GAm5B1D","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {\n\tDisplayObject,\n\tIPoint,\n\tMatrix,\n\tPoint,\n\tRectangle,\n\tRenderer,\n\tTexture,\n\tTransform,\n\tutils\n} from \"pixi.js\";\nimport { DApplications } from \"../../d-applications\";\nimport { DBaseStateSet } from \"../../d-base-state-set\";\nimport { DDiagramSerializedItem } from \"../../d-diagram-serialized\";\nimport { EShapeAction } from \"../action/e-shape-action\";\nimport { EShape } from \"../e-shape\";\nimport { EShapeConnectorContainer } from \"../e-shape-connector-container\";\nimport { EShapeConnectorContainerImpl } from \"../e-shape-connector-container-impl\";\nimport { EShapeContainer } from \"../e-shape-container\";\nimport { EShapeCopyPart } from \"../e-shape-copy-part\";\nimport { EShapeCorner } from \"../e-shape-corner\";\nimport { EShapeEditor } from \"../e-shape-editor\";\nimport { EShapeFill } from \"../e-shape-fill\";\nimport { EShapeGradientLike } from \"../e-shape-gradient\";\nimport { EShapeLayout } from \"../e-shape-layout\";\nimport { EShapePoints } from \"../e-shape-points\";\nimport { EShapeResourceManagerSerialization } from \"../e-shape-resource-manager-serialization\";\nimport { EShapeRuntime } from \"../e-shape-runtime\";\nimport { EShapeStateSet } from \"../e-shape-state-set\";\nimport { EShapeStateSetImplObservable } from \"../e-shape-state-set-impl-observable\";\nimport { EShapeStroke } from \"../e-shape-stroke\";\nimport { EShapeStrokeStyle } from \"../e-shape-stroke-style\";\nimport { EShapeData } from \"../e-shape-data\";\nimport { EShapeText } from \"../e-shape-text\";\nimport { EShapeTransform, EShapeTransformImpl } from \"../e-shape-transform\";\nimport { EShapeType } from \"../e-shape-type\";\nimport { EShapeUploaded } from \"../e-shape-uploaded\";\nimport { EShapeBaseHitTestData } from \"./e-shape-base-hit-test-data\";\nimport { hitTestBBox } from \"./hit-test-bbox\";\nimport { toGradientSerialized } from \"./to-gradient-serialized\";\nimport { EShapeCapabilityContainer } from \"../e-shape-capability-container\";\nimport { EShapeCapabilityContainerImpl } from \"../e-shape-capability-container-impl\";\nimport { EShapeCapability } from \"../e-shape-capability\";\nimport { EShapeLock } from \"./e-shape-lock\";\nimport { EShapeLockPart } from \"./e-shape-lock-part\";\n\nexport abstract class EShapeBase extends utils.EventEmitter implements EShape {\n\tprotected static WORK_HIT_TEST_DATA?: EShapeBaseHitTestData;\n\tid: string;\n\tuuid: number;\n\treadonly type: EShapeType;\n\tabstract readonly size: IPoint;\n\tabstract readonly fill: EShapeFill;\n\tabstract readonly stroke: EShapeStroke;\n\treadonly transform: EShapeTransform;\n\tabstract radius: number;\n\tabstract corner: EShapeCorner;\n\tprotected _points?: EShapePoints;\n\tprotected _image?: HTMLImageElement;\n\timageSrc?: string;\n\ttexture?: Texture;\n\tabstract gradient?: EShapeGradientLike;\n\tabstract readonly text: EShapeText;\n\t/** @deprecated in favor of {@link data} */\n\tabstract readonly tag: EShapeData;\n\tabstract readonly data: EShapeData;\n\treadonly action: EShapeAction;\n\tcursor?: string;\n\tinteractive: boolean;\n\tshortcut?: string;\n\ttitle?: string;\n\n\tprotected _connector?: EShapeConnectorContainer;\n\n\tprotected _visible: boolean;\n\n\tprotected _lockTransformChild: EShapeLock;\n\tprotected _lockTransformThis: EShapeLock;\n\tprotected _lockTransformParent: EShapeLock;\n\tprotected _lockUploaded: EShapeLock;\n\n\tprotected _bounds?: Rectangle;\n\tprotected _boundsTransformId: number;\n\tprotected _boundsInternal?: Rectangle;\n\tprotected _boundsInternalTransformId: number;\n\tprotected _boundsLocal?: Rectangle;\n\tprotected _boundsLocalTransformId: number;\n\n\tprotected _state?: EShapeStateSet;\n\tprotected _capability?: EShapeCapabilityContainer;\n\n\t// Hierarchy\n\tparent: EShapeContainer | EShape | null;\n\tchildren: EShape[];\n\tlayout?: EShapeLayout;\n\n\t// Working space\n\tindex: number; // A work space for sorting.\n\tselected: boolean;\n\treference: number; // Count of references from commands\n\n\t// Working space for the viewer\n\truntime?: EShapeRuntime;\n\n\t// Working space for the editor\n\teditor?: EShapeEditor;\n\n\t// Working space for the renderer\n\tuploaded?: EShapeUploaded;\n\n\tconstructor(type: EShapeType) {\n\t\tsuper();\n\t\tthis.id = \"\";\n\t\tthis.uuid = 0;\n\t\tthis.type = type;\n\t\tthis.transform = this.newTransform();\n\t\tthis.action = new EShapeAction();\n\t\tthis._visible = true;\n\n\t\tthis._lockTransformChild = new EShapeLock();\n\t\tthis._lockTransformThis = new EShapeLock();\n\t\tthis._lockTransformParent = new EShapeLock();\n\t\tthis._lockUploaded = new EShapeLock();\n\n\t\tthis._boundsTransformId = NaN;\n\t\tthis._boundsInternalTransformId = NaN;\n\t\tthis._boundsLocalTransformId = NaN;\n\n\t\tthis.interactive = false;\n\n\t\t//\n\t\tthis.parent = null;\n\t\tthis.children = [];\n\n\t\t//\n\t\tthis.selected = false;\n\t\tthis.index = 0;\n\t\tthis.reference = 0;\n\t}\n\n\tprotected newTransform(): EShapeTransform {\n\t\treturn new EShapeTransformImpl(this);\n\t}\n\n\tonSizeChange(): void {\n\t\tthis._boundsTransformId = NaN;\n\t\tthis._boundsInternalTransformId = NaN;\n\t\tthis._boundsLocalTransformId = NaN;\n\n\t\tif (!this._lockTransformChild.isLocked()) {\n\t\t\tthis.callChildTransformChange();\n\t\t}\n\t\tconst points = this._points;\n\t\tif (points != null) {\n\t\t\tpoints.onSizeChange();\n\t\t}\n\t\tthis.updateUploaded();\n\n\t\tconst connector = this._connector;\n\t\tif (connector != null) {\n\t\t\tconnector.fit(true);\n\t\t}\n\n\t\tconst runtime = this.runtime;\n\t\tif (runtime != null) {\n\t\t\truntime.onResize(this);\n\t\t}\n\t}\n\n\tonTransformChange(): void {\n\t\tif (!this._lockTransformChild.isLocked()) {\n\t\t\tthis.callChildTransformChange();\n\t\t}\n\t\tif (!this._lockTransformThis.isLocked()) {\n\t\t\tthis.onThisTransformChange();\n\t\t}\n\t\tif (!this._lockTransformParent.isLocked()) {\n\t\t\tthis.callParentTransformChange();\n\t\t}\n\t}\n\n\tprotected callChildTransformChange(): void {\n\t\tconst parent = this.parent;\n\t\tif (parent != null) {\n\t\t\tparent.onChildTransformChange();\n\t\t}\n\t}\n\n\tprotected onThisTransformChange(): void {\n\t\tthis.updateUploaded();\n\t\tconst connector = this._connector;\n\t\tif (connector != null) {\n\t\t\tconnector.fit(true);\n\t\t}\n\t}\n\n\tprotected callParentTransformChange(): void {\n\t\tconst children = this.children;\n\t\tfor (let i = 0, imax = children.length; i < imax; ++i) {\n\t\t\tchildren[i].onParentTransformChange();\n\t\t}\n\t}\n\n\tonParentTransformChange(): void {\n\t\tif (!this._lockTransformThis.isLocked()) {\n\t\t\tthis.onThisTransformChange();\n\t\t}\n\t\tif (!this._lockTransformParent.isLocked()) {\n\t\t\tthis.callParentTransformChange();\n\t\t}\n\t}\n\n\tlock(part: EShapeLockPart): this {\n\t\tif (part & EShapeLockPart.UPLOADED) {\n\t\t\tthis._lockUploaded.lock();\n\t\t}\n\t\tif (part & EShapeLockPart.TRANSFORM_PARENT) {\n\t\t\tthis._lockTransformParent.lock();\n\t\t}\n\t\tif (part & EShapeLockPart.TRANSFORM_THIS) {\n\t\t\tthis._lockTransformThis.lock();\n\t\t}\n\t\tif (part & EShapeLockPart.TRANSFORM_CHILD) {\n\t\t\tthis._lockTransformChild.lock();\n\t\t}\n\t\treturn this;\n\t}\n\n\tunlock(part: EShapeLockPart, invoke: boolean): this {\n\t\tif (part & EShapeLockPart.TRANSFORM_CHILD) {\n\t\t\tif (this._lockTransformChild.unlock() && invoke) {\n\t\t\t\tconst parent = this.parent;\n\t\t\t\tif (parent != null) {\n\t\t\t\t\tparent.onChildTransformChange();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (part & EShapeLockPart.TRANSFORM_THIS) {\n\t\t\tif (this._lockTransformThis.unlock() && invoke) {\n\t\t\t\tthis.onThisTransformChange();\n\t\t\t}\n\t\t}\n\t\tif (part & EShapeLockPart.TRANSFORM_PARENT) {\n\t\t\tif (this._lockTransformParent.unlock() && invoke) {\n\t\t\t\tconst children = this.children;\n\t\t\t\tfor (let i = 0, imax = children.length; i < imax; ++i) {\n\t\t\t\t\tchildren[i].onParentTransformChange();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (part & EShapeLockPart.UPLOADED) {\n\t\t\tconst lockUploaded = this._lockUploaded;\n\t\t\tif (lockUploaded.unlock() && invoke) {\n\t\t\t\tthis.updateUploaded(lockUploaded.isHigh());\n\t\t\t}\n\t\t}\n\t\treturn this;\n\t}\n\n\tonChildTransformChange(): void {\n\t\t//\n\t}\n\n\tupdateUploaded(recursively?: boolean): void {\n\t\tif (this._lockUploaded.isLocked()) {\n\t\t\treturn;\n\t\t}\n\t\tconst uploaded = this.uploaded;\n\t\tif (uploaded != null) {\n\t\t\tuploaded.update(this);\n\t\t}\n\t\tif (recursively === true) {\n\t\t\tconst children = this.children;\n\t\t\tfor (let i = 0, imax = children.length; i < imax; ++i) {\n\t\t\t\tchildren[i].updateUploaded(true);\n\t\t\t}\n\t\t}\n\t}\n\n\tget image(): HTMLImageElement | undefined {\n\t\treturn this._image;\n\t}\n\n\tset image(image: HTMLImageElement | undefined) {\n\t\tthis._image = image;\n\t}\n\n\tget points(): EShapePoints | undefined {\n\t\treturn this._points;\n\t}\n\n\tget root(): EShape {\n\t\tlet root: EShape = this;\n\t\twhile (root.parent instanceof EShapeBase) {\n\t\t\troot = root.parent;\n\t\t}\n\t\treturn root;\n\t}\n\n\tget connector(): EShapeConnectorContainer {\n\t\tlet result = this._connector;\n\t\tif (result == null) {\n\t\t\tresult = new EShapeConnectorContainerImpl(this);\n\t\t\tthis._connector = result;\n\t\t}\n\t\treturn result;\n\t}\n\n\tget visible(): boolean {\n\t\tif (this._visible) {\n\t\t\tconst parent = this.parent;\n\t\t\tif (parent instanceof EShapeBase) {\n\t\t\t\treturn parent.visible;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tset visible(visible: boolean) {\n\t\tif (this._visible !== visible) {\n\t\t\tthis._visible = visible;\n\t\t\tthis.updateUploaded(true);\n\t\t}\n\t}\n\n\tget worldVisible(): boolean {\n\t\tif (this._visible) {\n\t\t\tconst parent = this.parent;\n\t\t\tif (parent) {\n\t\t\t\treturn parent.worldVisible;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\t//\n\tabstract clone(): EShape;\n\n\t//\n\ttoDirty(): void {\n\t\tconst parent = this.parent;\n\t\tif (parent != null) {\n\t\t\tparent.toDirty();\n\t\t}\n\t}\n\n\t// Hierarchy\n\tattach(parent: EShapeContainer | EShape, at?: number): this {\n\t\tthis.detach();\n\t\tthis.parent = parent;\n\t\tconst children = parent.children;\n\t\tif (at != null && 0 <= at && at < children.length) {\n\t\t\tchildren.splice(at, 0, this);\n\t\t} else {\n\t\t\tchildren.push(this);\n\t\t}\n\t\tparent.onChildTransformChange();\n\t\tparent.toDirty();\n\t\tthis.onAttach();\n\t\treturn this;\n\t}\n\n\tonAttach(): void {\n\t\tthis.uploaded = undefined;\n\t\tconst connector = this._connector;\n\t\tif (connector) {\n\t\t\tconnector.attach();\n\t\t\tconnector.fit(true);\n\t\t}\n\t\tconst children = this.children;\n\t\tfor (let i = 0, imax = children.length; i < imax; ++i) {\n\t\t\tchildren[i].onAttach();\n\t\t}\n\t}\n\n\tdetach(exceptions?: Set<EShape>): this {\n\t\tconst parent = this.parent;\n\t\tif (parent) {\n\t\t\tthis.parent = null;\n\t\t\tconst children = parent.children;\n\t\t\tconst index = children.indexOf(this);\n\t\t\tif (0 <= index) {\n\t\t\t\tchildren.splice(index, 1);\n\t\t\t\tparent.onChildTransformChange();\n\t\t\t\tparent.toDirty();\n\t\t\t\tthis.onDetach(exceptions);\n\t\t\t}\n\t\t}\n\t\treturn this;\n\t}\n\n\tonDetach(exceptions?: Set<EShape>): void {\n\t\tthis.uploaded = undefined;\n\t\tconst connector = this._connector;\n\t\tif (connector) {\n\t\t\tconnector.detach(exceptions);\n\t\t}\n\t\tconst children = this.children;\n\t\tfor (let i = 0, imax = children.length; i < imax; ++i) {\n\t\t\tchildren[i].onDetach(exceptions);\n\t\t}\n\t}\n\n\t// Transform\n\tupdateTransform(): void {\n\t\tconst parent = this.parent;\n\t\tif (parent) {\n\t\t\tif (parent.parent) {\n\t\t\t\tparent.updateTransform();\n\t\t\t}\n\t\t\tthis.transform.updateTransform(parent.transform);\n\t\t} else {\n\t\t\tthis.transform.updateTransform(Transform.IDENTITY);\n\t\t}\n\t}\n\n\t// Serialization\n\tserializeChildren(manager: EShapeResourceManagerSerialization): DDiagramSerializedItem[] {\n\t\tconst children = this.children;\n\t\tconst childrenSerialized = [];\n\t\tfor (let i = 0, imax = children.length; i < imax; ++i) {\n\t\t\tconst child = children[i];\n\t\t\tchildrenSerialized.push(child.serialize(manager));\n\t\t}\n\t\treturn childrenSerialized;\n\t}\n\n\tserializeImage(manager: EShapeResourceManagerSerialization): number {\n\t\tconst image = this._image;\n\t\treturn image != null ? manager.addResource(image.src) : -1;\n\t}\n\n\tserializeGradient(manager: EShapeResourceManagerSerialization): number {\n\t\tconst gradient = this.gradient;\n\t\tif (gradient != null) {\n\t\t\tif (gradient.serialized == null) {\n\t\t\t\tgradient.serialized = toGradientSerialized(gradient);\n\t\t\t}\n\t\t\treturn manager.addResource(gradient.serialized);\n\t\t}\n\t\treturn -1;\n\t}\n\n\tserializeState(manager: EShapeResourceManagerSerialization): number {\n\t\tconst state = this.state;\n\t\treturn (this.interactive ? 1 : 0) | (state.isFocusable ? 0 : 2) | (state.isActive ? 4 : 0);\n\t}\n\n\tserialize(manager: EShapeResourceManagerSerialization): DDiagramSerializedItem {\n\t\tconst transform = this.transform;\n\t\tconst position = transform.position;\n\t\tconst pivot = transform.pivot;\n\t\tconst size = this.size;\n\t\tconst shortcut = this.shortcut;\n\t\tconst shortcutId = shortcut != null ? manager.addResource(shortcut) : -1;\n\t\tconst cursor = this.cursor;\n\t\tconst cursorId = cursor != null ? manager.addResource(cursor) : -1;\n\t\tconst title = this.title;\n\t\tconst titleId = title != null ? manager.addResource(title) : -1;\n\t\tlet capabilitiesAdded: EShapeCapability = EShapeCapability.NONE;\n\t\tlet capabilitiesRemoved: EShapeCapability = EShapeCapability.NONE;\n\t\tlet capabilitiesLocked: EShapeCapability = EShapeCapability.NONE;\n\t\tconst capability = this._capability;\n\t\tif (capability != null) {\n\t\t\tcapabilitiesAdded = capability.added;\n\t\t\tcapabilitiesRemoved = capability.removed;\n\t\t\tcapabilitiesLocked = capability.locked;\n\t\t}\n\t\treturn [\n\t\t\tthis.type,\n\t\t\tmanager.addResource(this.id),\n\t\t\tposition.x,\n\t\t\tposition.y,\n\t\t\tsize.x,\n\t\t\tsize.y,\n\t\t\ttransform.rotation,\n\t\t\ttransform.skew.x,\n\t\t\tthis.fill.serialize(manager),\n\t\t\tthis.stroke.serialize(manager),\n\t\t\tcursorId,\n\t\t\tthis.text.serialize(manager),\n\t\t\tthis.data.serialize(manager),\n\t\t\tthis.radius,\n\t\t\tthis.corner,\n\t\t\t-1,\n\t\t\t-1,\n\t\t\tthis.action.serialize(manager),\n\t\t\tthis.serializeImage(manager),\n\t\t\tthis.serializeGradient(manager),\n\t\t\tthis.serializeChildren(manager),\n\t\t\tpivot.x,\n\t\t\tpivot.y,\n\t\t\tthis.serializeState(manager),\n\t\t\tshortcutId,\n\t\t\ttitleId,\n\t\t\tthis.uuid,\n\t\t\tcapabilitiesAdded,\n\t\t\tcapabilitiesRemoved,\n\t\t\tcapabilitiesLocked\n\t\t];\n\t}\n\n\taddUuid(manager: EShapeResourceManagerSerialization): void {\n\t\tthis.uuid = manager.addUuid(this.uuid);\n\t\tconst children = this.children;\n\t\tfor (let i = 0, imax = children.length; i < imax; ++i) {\n\t\t\tchildren[i].addUuid(manager);\n\t\t}\n\t}\n\n\tupdateUuid(manager: EShapeResourceManagerSerialization): void {\n\t\tthis.uuid = manager.updateUuid(this.uuid);\n\t\tconst children = this.children;\n\t\tfor (let i = 0, imax = children.length; i < imax; ++i) {\n\t\t\tchildren[i].updateUuid(manager);\n\t\t}\n\t}\n\n\t// Hit test\n\tprotected getShapeScale(): number {\n\t\tconst container = this.root.parent as any;\n\t\tif (container != null && container.getShapeScale != null) {\n\t\t\treturn container.getShapeScale();\n\t\t}\n\t\treturn 1.0;\n\t}\n\n\tprotected getStrokeWidthScale(style: EShapeStrokeStyle): number {\n\t\tif (style & EShapeStrokeStyle.NON_EXPANDING_WIDTH) {\n\t\t\tif (style & EShapeStrokeStyle.NON_SHRINKING_WIDTH) {\n\t\t\t\treturn this.getShapeScale();\n\t\t\t} else {\n\t\t\t\treturn Math.min(1.0, this.getShapeScale());\n\t\t\t}\n\t\t} else {\n\t\t\tif (style & EShapeStrokeStyle.NON_SHRINKING_WIDTH) {\n\t\t\t\treturn Math.max(1.0, this.getShapeScale());\n\t\t\t} else {\n\t\t\t\treturn 1.0;\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected getHitTestSize(result: EShapeBaseHitTestData): EShapeBaseHitTestData {\n\t\tconst size = this.size;\n\t\tresult.width = 0.5 * size.x;\n\t\tresult.height = 0.5 * size.y;\n\t\treturn result;\n\t}\n\n\ttoHitTestData(x: number, y: number): EShapeBaseHitTestData {\n\t\tconst result = this.getHitTestSize(\n\t\t\t(EShapeBase.WORK_HIT_TEST_DATA ??= new EShapeBaseHitTestData())\n\t\t);\n\t\tconst sx = result.width;\n\t\tconst sy = result.height;\n\t\tconst pivot = this.transform.pivot;\n\t\tconst dx = x - pivot.x;\n\t\tconst dy = y - pivot.y;\n\t\tconst stroke = this.stroke;\n\t\tconst strokeWidth = stroke.enable ? stroke.width : 0;\n\t\tconst strokeScale = this.getStrokeWidthScale(stroke.style);\n\t\tconst strokeAlign = stroke.align;\n\t\tconst s = strokeWidth * strokeScale * strokeAlign;\n\t\treturn result.set(\n\t\t\t0 <= sx ? +dx : -dx,\n\t\t\t0 <= sy ? +dy : -dy,\n\t\t\tMath.abs(sx) + s,\n\t\t\tMath.abs(sy) + s,\n\t\t\tstrokeWidth,\n\t\t\tstrokeScale,\n\t\t\tstrokeAlign\n\t\t);\n\t}\n\n\tcontains(x: number, y: number): EShape | null {\n\t\tconst data = this.toHitTestData(x, y);\n\t\tif (\n\t\t\tthis.containsAbs(\n\t\t\t\tdata.x,\n\t\t\t\tdata.y,\n\t\t\t\tdata.width,\n\t\t\t\tdata.height,\n\t\t\t\tdata.strokeWidth,\n\t\t\t\tdata.strokeScale,\n\t\t\t\tdata.strokeAlign\n\t\t\t)\n\t\t) {\n\t\t\treturn this;\n\t\t}\n\t\treturn this.containsText(x, y) || this.containsChildren(x, y);\n\t}\n\n\tprotected containsText(x: number, y: number): EShape | null {\n\t\tconst text = this.text;\n\t\tconst textAtlas = text.atlas;\n\t\tif (textAtlas != null) {\n\t\t\tconst textWorld = text.world;\n\t\t\tif (textWorld != null) {\n\t\t\t\tconst transform = this.transform.internalTransform;\n\t\t\t\tconst tx = transform.a * x + transform.c * y + transform.tx - textWorld[0];\n\t\t\t\tconst ty = transform.b * x + transform.d * y + transform.ty - textWorld[1];\n\t\t\t\tconst th = textWorld[2] * tx + textWorld[3] * ty;\n\t\t\t\tconst tv = textWorld[4] * tx + textWorld[5] * ty;\n\t\t\t\tconst w = textWorld[6];\n\t\t\t\tconst h = textWorld[7];\n\t\t\t\tif (0 <= th && th <= w && 0 <= tv && tv <= h) {\n\t\t\t\t\treturn this;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\tprotected containsChildren(x: number, y: number): EShape | null {\n\t\tconst children = this.children;\n\t\tfor (let i = children.length - 1; 0 <= i; --i) {\n\t\t\tconst child = children[i];\n\t\t\tchild.updateTransform();\n\t\t\tconst localTransform = child.transform.localTransform;\n\t\t\tconst a = localTransform.a;\n\t\t\tconst b = localTransform.b;\n\t\t\tconst c = localTransform.c;\n\t\t\tconst d = localTransform.d;\n\t\t\tconst tx = localTransform.tx;\n\t\t\tconst ty = localTransform.ty;\n\t\t\tconst id = 1 / (a * d - c * b);\n\t\t\tconst lx = (d * x - c * y + ty * c - tx * d) * id;\n\t\t\tconst ly = (a * y - b * x - ty * a + tx * b) * id;\n\t\t\tconst childResult = child.contains(lx, ly);\n\t\t\tif (childResult != null) {\n\t\t\t\treturn childResult;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\tcontainsBBox(x: number, y: number): boolean {\n\t\tconst data = this.toHitTestData(x, y);\n\t\treturn this.containsAbsBBox(data.x, data.y, data.width, data.height);\n\t}\n\n\tcontainsAbs(\n\t\tx: number,\n\t\ty: number,\n\t\tax: number,\n\t\tay: number,\n\t\tsw: number,\n\t\tss: number,\n\t\tsa: number\n\t): boolean {\n\t\treturn this.containsAbsBBox(x, y, ax, ay);\n\t}\n\n\tcontainsAbsBBox(x: number, y: number, ax: number, ay: number): boolean {\n\t\treturn hitTestBBox(x, y, ax, ay);\n\t}\n\n\tselect(point: Point): boolean {\n\t\treturn false;\n\t}\n\n\t//\n\ttoGlobal(position: IPoint, result: Point, skipUpdate?: boolean): Point {\n\t\tif (skipUpdate !== true) {\n\t\t\tthis.updateTransform();\n\t\t}\n\t\tresult.copyFrom(position);\n\t\tthis.transform.worldTransform.apply(result, result);\n\t\treturn result;\n\t}\n\n\ttoLocal(position: IPoint, from?: DisplayObject, result?: Point, skipUpdate?: boolean): Point {\n\t\tif (skipUpdate !== true) {\n\t\t\tthis.updateTransform();\n\t\t}\n\t\tif (result === undefined) {\n\t\t\tresult = new Point();\n\t\t}\n\t\tresult.copyFrom(position);\n\t\tthis.transform.worldTransform.applyInverse(result, result);\n\t\treturn result;\n\t}\n\n\tgetBounds(skipUpdate?: boolean, result?: Rectangle): Rectangle {\n\t\tif (skipUpdate !== true) {\n\t\t\tthis.updateTransform();\n\t\t}\n\t\tconst bounds = this._bounds || new Rectangle();\n\t\tthis._bounds = bounds;\n\t\tconst worldId = this.transform.getWorldId();\n\t\tif (worldId !== this._boundsTransformId) {\n\t\t\tthis._boundsTransformId = worldId;\n\t\t\tthis.getBounds_(this.transform.worldTransform, bounds);\n\t\t}\n\t\tresult ??= new Rectangle();\n\t\tresult.copyFrom(bounds);\n\t\treturn result;\n\t}\n\n\tgetBoundsInternal(skipUpdate?: boolean, result?: Rectangle): Rectangle {\n\t\tif (skipUpdate !== true) {\n\t\t\tthis.updateTransform();\n\t\t}\n\t\tconst boundsInternal = this._boundsInternal || new Rectangle();\n\t\tthis._boundsInternal = boundsInternal;\n\t\tconst currentLocalId = this.transform.getLocalIdCurrent();\n\t\tif (currentLocalId !== this._boundsInternalTransformId) {\n\t\t\tthis._boundsInternalTransformId = currentLocalId;\n\t\t\tthis.getBounds_(this.transform.internalTransform, boundsInternal);\n\t\t}\n\t\tresult ??= new Rectangle();\n\t\tresult.copyFrom(boundsInternal);\n\t\treturn result;\n\t}\n\n\tgetBoundsLocal(skipUpdate?: boolean, result?: Rectangle): Rectangle {\n\t\tif (skipUpdate !== true) {\n\t\t\tthis.updateTransform();\n\t\t}\n\t\tconst boundsLocal = this._boundsLocal || new Rectangle();\n\t\tthis._boundsLocal = boundsLocal;\n\t\tconst currentLocalId = this.transform.getLocalIdCurrent();\n\t\tif (currentLocalId !== this._boundsLocalTransformId) {\n\t\t\tthis._boundsLocalTransformId = currentLocalId;\n\t\t\tthis.getBounds_(this.transform.localTransform, boundsLocal);\n\t\t}\n\t\tresult ??= new Rectangle();\n\t\tresult.copyFrom(boundsLocal);\n\t\treturn result;\n\t}\n\n\tprotected getBoundsSize(): IPoint {\n\t\treturn this.size;\n\t}\n\n\tprotected getBounds_(transform: Matrix, result: Rectangle): Rectangle {\n\t\tconst pivot = this.transform.pivot;\n\t\tconst px = pivot.x;\n\t\tconst py = pivot.y;\n\t\tconst size = this.getBoundsSize();\n\t\tconst sx = 0.5 * size.x;\n\t\tconst sy = 0.5 * size.y;\n\n\t\tconst a = transform.a;\n\t\tconst b = transform.b;\n\t\tconst c = transform.c;\n\t\tconst d = transform.d;\n\n\t\tlet x = -sx + px;\n\t\tlet y = -sy + py;\n\t\tconst x0 = a * x + c * y;\n\t\tconst y0 = b * x + d * y;\n\n\t\tx = +sx + px;\n\t\ty = -sy + py;\n\t\tconst x1 = a * x + c * y;\n\t\tconst y1 = b * x + d * y;\n\n\t\tx = -sx + px;\n\t\ty = +sy + py;\n\t\tconst x2 = a * x + c * y;\n\t\tconst y2 = b * x + d * y;\n\n\t\tx = +sx + px;\n\t\ty = +sy + py;\n\t\tconst x3 = a * x + c * y;\n\t\tconst y3 = b * x + d * y;\n\n\t\tconst xmin = Math.min(x0, x1, x2, x3);\n\t\tconst ymin = Math.min(y0, y1, y2, y3);\n\t\tconst xmax = Math.max(x0, x1, x2, x3);\n\t\tconst ymax = Math.max(y0, y1, y2, y3);\n\t\tresult.x = xmin + transform.tx;\n\t\tresult.y = ymin + transform.ty;\n\t\tresult.width = xmax - xmin;\n\t\tresult.height = ymax - ymin;\n\t\treturn result;\n\t}\n\n\t//\n\tdestroy(): void {\n\t\tconst children = this.children;\n\t\tfor (let i = children.length - 1; 0 <= i; --i) {\n\t\t\tchildren[i].destroy();\n\t\t}\n\t\tchildren.length = 0;\n\t}\n\n\t//\n\tprotected onStateChange(newState: DBaseStateSet, oldState: DBaseStateSet): void {\n\t\tconst runtime = this.runtime;\n\t\tif (runtime != null) {\n\t\t\truntime.onStateChange(this, newState, oldState);\n\t\t}\n\n\t\tconst children = this.children;\n\t\tfor (let i = 0, imax = children.length; i < imax; ++i) {\n\t\t\tconst child = children[i];\n\t\t\tif (child instanceof EShapeBase) {\n\t\t\t\tchild.state.onParentChange(newState, oldState);\n\t\t\t}\n\t\t}\n\t}\n\n\tget state(): EShapeStateSet {\n\t\tlet result = this._state;\n\t\tif (result == null) {\n\t\t\tresult = new EShapeStateSetImplObservable((newState, oldState): void => {\n\t\t\t\tthis.onStateChange(newState, oldState);\n\t\t\t});\n\t\t\tthis._state = result;\n\t\t}\n\t\treturn result;\n\t}\n\n\tget capability(): EShapeCapabilityContainer {\n\t\tlet result = this._capability;\n\t\tif (result == null) {\n\t\t\tresult = new EShapeCapabilityContainerImpl();\n\t\t\tthis._capability = result;\n\t\t}\n\t\treturn result;\n\t}\n\n\tgetCapability(): EShapeCapabilityContainer | undefined {\n\t\treturn this._capability;\n\t}\n\n\tfocus(): this {\n\t\tthis.setFocused(true);\n\t\treturn this;\n\t}\n\n\tblur(): this {\n\t\tthis.setFocused(false);\n\t\treturn this;\n\t}\n\n\tprotected setFocused(isFocused: boolean): void {\n\t\tif (this.state.isFocused !== isFocused) {\n\t\t\tconst layer = DApplications.getLayer(this);\n\t\t\tif (layer) {\n\t\t\t\tlayer.getFocusController().set(this, isFocused);\n\t\t\t}\n\t\t}\n\t}\n\n\tonKeyDown(e: KeyboardEvent): boolean {\n\t\tconst runtime = this.runtime;\n\t\tif (runtime) {\n\t\t\treturn runtime.onKeyDown(this, e);\n\t\t}\n\t\treturn false;\n\t}\n\n\tonKeyUp(e: KeyboardEvent): boolean {\n\t\tconst runtime = this.runtime;\n\t\tif (runtime) {\n\t\t\treturn runtime.onKeyUp(this, e);\n\t\t}\n\t\treturn false;\n\t}\n\n\t//\n\tupdate(time: number): void {\n\t\tconst runtime = this.runtime;\n\t\tif (runtime) {\n\t\t\truntime.update(this, time);\n\t\t}\n\t}\n\n\tonRender(time: number, renderer: Renderer): void {\n\t\tconst runtime = this.runtime;\n\t\tif (runtime) {\n\t\t\truntime.onRender(this, time, renderer);\n\t\t}\n\t}\n\n\tcopy(source: EShape, part: EShapeCopyPart = EShapeCopyPart.ALL): this {\n\t\tthis.lock(EShapeLockPart.ALL);\n\t\tthis.id = source.id;\n\t\tthis.uuid = source.uuid;\n\t\tthis.visible = source.visible;\n\t\tif (part & EShapeCopyPart.TRANSFORM) {\n\t\t\tconst transform = this.transform;\n\t\t\tconst sourceTransform = source.transform;\n\t\t\ttransform.position.copyFrom(sourceTransform.position);\n\t\t\ttransform.rotation = sourceTransform.rotation;\n\t\t\ttransform.skew.copyFrom(sourceTransform.skew);\n\t\t\ttransform.pivot.copyFrom(sourceTransform.pivot);\n\t\t\ttransform.scale.copyFrom(sourceTransform.scale);\n\t\t}\n\t\tif (part & EShapeCopyPart.SIZE) {\n\t\t\tthis.size.copyFrom(source.size);\n\t\t}\n\t\tif (part & EShapeCopyPart.STYLE) {\n\t\t\tthis.fill.copy(source.fill);\n\t\t\tthis.stroke.copy(source.stroke);\n\t\t\tthis.text.copy(source.text);\n\t\t\tthis.radius = source.radius;\n\t\t\tthis.corner = source.corner;\n\t\t}\n\t\tif (part & EShapeCopyPart.DATA) {\n\t\t\tthis.data.copy(source.data);\n\t\t}\n\t\tif (part & EShapeCopyPart.IMAGE) {\n\t\t\tthis.image = source.image;\n\t\t}\n\t\tif (part & EShapeCopyPart.ACTION) {\n\t\t\tthis.action.clearAndAddAll(source.action.values);\n\t\t\tthis.interactive = source.interactive;\n\t\t\tthis.cursor = source.cursor;\n\t\t\tthis.shortcut = source.shortcut;\n\t\t}\n\t\tif (part & EShapeCopyPart.POINTS) {\n\t\t\tconst sourcePoints = source.points;\n\t\t\tif (sourcePoints != null) {\n\t\t\t\tconst points = this.points;\n\t\t\t\tif (points != null) {\n\t\t\t\t\tpoints.copy(sourcePoints);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (part & EShapeCopyPart.STATE) {\n\t\t\tthis.state.lock(false).copy(source.state).unlock();\n\t\t}\n\t\tif (part & EShapeCopyPart.CONNECTOR) {\n\t\t\tif (source instanceof EShapeBase) {\n\t\t\t\tconst sourceConnector = source._connector;\n\t\t\t\tif (sourceConnector) {\n\t\t\t\t\tthis.connector.copy(sourceConnector);\n\t\t\t\t} else {\n\t\t\t\t\tconst connector = this._connector;\n\t\t\t\t\tif (connector) {\n\t\t\t\t\t\tconnector.clear();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tconst connector = this._connector;\n\t\t\t\tif (connector) {\n\t\t\t\t\tconnector.clear();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (part & EShapeCopyPart.CAPABILITY) {\n\t\t\tconst sourceCapability = source.getCapability();\n\t\t\tif (sourceCapability != null) {\n\t\t\t\tthis.capability.copy(sourceCapability);\n\t\t\t} else {\n\t\t\t\tconst capability = this._capability;\n\t\t\t\tif (capability != null) {\n\t\t\t\t\tcapability.clear();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tthis.unlock(EShapeLockPart.ALL, true);\n\t\treturn this;\n\t}\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.376.1
2
+ Winter Cardinal UI v0.376.3
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.376.1
2
+ Winter Cardinal UI v0.376.3
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.376.1
2
+ Winter Cardinal UI v0.376.3
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.376.1
2
+ Winter Cardinal UI v0.376.3
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5