@wcardinal/wcardinal-ui 0.376.2 → 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.
- package/dist/wcardinal/ui/shape/e-shape-connector-edge-impl.js +5 -4
- package/dist/wcardinal/ui/shape/e-shape-connector-edge-impl.js.map +1 -1
- package/dist/wcardinal-ui-theme-dark.js +1 -1
- package/dist/wcardinal-ui-theme-dark.min.js +1 -1
- package/dist/wcardinal-ui-theme-white.js +1 -1
- package/dist/wcardinal-ui-theme-white.min.js +1 -1
- package/dist/wcardinal-ui.cjs.js +5 -5
- package/dist/wcardinal-ui.js +5 -5
- package/dist/wcardinal-ui.min.js +2 -2
- package/dist/wcardinal-ui.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -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.
|
|
367
|
+
.copyFrom(parentParent.transform.internalTransform)
|
|
367
368
|
.invert()
|
|
368
|
-
.append(shape.transform.
|
|
369
|
+
.append(shape.transform.internalTransform);
|
|
369
370
|
}
|
|
370
371
|
else {
|
|
371
|
-
return result.copyFrom(shape.transform.
|
|
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/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;AAEtE;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,GAAG,IAAI,eAAe,CAAC;YAClC,KAAI,CAAC,cAAc,EAAE,CAAC;QACvB,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AK,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\";\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;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AAK,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;gBAC9B,IAAI,CAAC,gBAAgB,EAAE,CAAC;aACxB;SACD;QACD,OAAO,IAAI,CAAC;IACb,CAAC;IAED,wCAAM,GAAN,UAAO,UAAwB;QAC9B,IAAM,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC;QACnC,IAAI,KAAK,IAAI,IAAI,IAAI,CAAC,UAAU,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"]}
|
package/dist/wcardinal-ui.cjs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Winter Cardinal UI v0.376.
|
|
2
|
+
Winter Cardinal UI v0.376.3
|
|
3
3
|
Copyright (C) 2019 Toshiba Corporation
|
|
4
4
|
SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
|
|
@@ -18554,15 +18554,15 @@ var EShapeConnectorEdgeImpl = /** @class */ (function () {
|
|
|
18554
18554
|
shape.updateTransform();
|
|
18555
18555
|
var parent = this._parent;
|
|
18556
18556
|
var parentParent = parent.parent;
|
|
18557
|
-
if (parentParent) {
|
|
18557
|
+
if (parentParent instanceof EShapeBase) {
|
|
18558
18558
|
parent.updateTransform();
|
|
18559
18559
|
return result
|
|
18560
|
-
.copyFrom(parentParent.transform.
|
|
18560
|
+
.copyFrom(parentParent.transform.internalTransform)
|
|
18561
18561
|
.invert()
|
|
18562
|
-
.append(shape.transform.
|
|
18562
|
+
.append(shape.transform.internalTransform);
|
|
18563
18563
|
}
|
|
18564
18564
|
else {
|
|
18565
|
-
return result.copyFrom(shape.transform.
|
|
18565
|
+
return result.copyFrom(shape.transform.internalTransform);
|
|
18566
18566
|
}
|
|
18567
18567
|
};
|
|
18568
18568
|
EShapeConnectorEdgeImpl.prototype.onAcceptorChange = function () {
|
package/dist/wcardinal-ui.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Winter Cardinal UI v0.376.
|
|
2
|
+
Winter Cardinal UI v0.376.3
|
|
3
3
|
Copyright (C) 2019 Toshiba Corporation
|
|
4
4
|
SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
|
|
@@ -18551,15 +18551,15 @@
|
|
|
18551
18551
|
shape.updateTransform();
|
|
18552
18552
|
var parent = this._parent;
|
|
18553
18553
|
var parentParent = parent.parent;
|
|
18554
|
-
if (parentParent) {
|
|
18554
|
+
if (parentParent instanceof EShapeBase) {
|
|
18555
18555
|
parent.updateTransform();
|
|
18556
18556
|
return result
|
|
18557
|
-
.copyFrom(parentParent.transform.
|
|
18557
|
+
.copyFrom(parentParent.transform.internalTransform)
|
|
18558
18558
|
.invert()
|
|
18559
|
-
.append(shape.transform.
|
|
18559
|
+
.append(shape.transform.internalTransform);
|
|
18560
18560
|
}
|
|
18561
18561
|
else {
|
|
18562
|
-
return result.copyFrom(shape.transform.
|
|
18562
|
+
return result.copyFrom(shape.transform.internalTransform);
|
|
18563
18563
|
}
|
|
18564
18564
|
};
|
|
18565
18565
|
EShapeConnectorEdgeImpl.prototype.onAcceptorChange = function () {
|