@wcardinal/wcardinal-ui 0.372.0 → 0.373.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/dist/types/wcardinal/ui/shape/e-shape-connector-container-impl.d.ts +1 -1
  2. package/dist/types/wcardinal/ui/shape/e-shape-connector-container.d.ts +2 -1
  3. package/dist/types/wcardinal/ui/shape/e-shape-connector-edge-container-impl.d.ts +2 -1
  4. package/dist/types/wcardinal/ui/shape/e-shape-connector-edge-container.d.ts +2 -1
  5. package/dist/types/wcardinal/ui/shape/e-shape-connector-edge-impl.d.ts +1 -1
  6. package/dist/types/wcardinal/ui/shape/e-shape-connector-edge.d.ts +1 -1
  7. package/dist/types/wcardinal/ui/shape/e-shape-deleter.d.ts +2 -0
  8. package/dist/types/wcardinal/ui/shape/e-shape.d.ts +6 -8
  9. package/dist/types/wcardinal/ui/shape/variant/e-shape-base.d.ts +10 -13
  10. package/dist/types/wcardinal/ui/shape/variant/e-shape-connector-line.d.ts +6 -5
  11. package/dist/types/wcardinal/ui/shape/variant/e-shape-group-size-parent.d.ts +4 -3
  12. package/dist/types/wcardinal/ui/shape/variant/e-shape-lock-part.d.ts +8 -0
  13. package/dist/types/wcardinal/ui/shape/variant/e-shape-lock.d.ts +9 -0
  14. package/dist/types/wcardinal/ui/shape/variant/index.d.ts +2 -0
  15. package/dist/wcardinal/ui/d-chart-axis-base-bar.js +3 -2
  16. package/dist/wcardinal/ui/d-chart-axis-base-bar.js.map +1 -1
  17. package/dist/wcardinal/ui/d-chart-axis-base-tick-container.js +7 -6
  18. package/dist/wcardinal/ui/d-chart-axis-base-tick-container.js.map +1 -1
  19. package/dist/wcardinal/ui/d-chart-axis-guide-simple-shape-impl.js +7 -6
  20. package/dist/wcardinal/ui/d-chart-axis-guide-simple-shape-impl.js.map +1 -1
  21. package/dist/wcardinal/ui/d-chart-series-line-of-any.js +3 -2
  22. package/dist/wcardinal/ui/d-chart-series-line-of-any.js.map +1 -1
  23. package/dist/wcardinal/ui/d-chart-series-line.js +3 -2
  24. package/dist/wcardinal/ui/d-chart-series-line.js.map +1 -1
  25. package/dist/wcardinal/ui/d-chart-series-linear.js +3 -2
  26. package/dist/wcardinal/ui/d-chart-series-linear.js.map +1 -1
  27. package/dist/wcardinal/ui/d-diagram-canvas-editor-snap.js +5 -4
  28. package/dist/wcardinal/ui/d-diagram-canvas-editor-snap.js.map +1 -1
  29. package/dist/wcardinal/ui/shape/e-shape-capability.js +1 -1
  30. package/dist/wcardinal/ui/shape/e-shape-capability.js.map +1 -1
  31. package/dist/wcardinal/ui/shape/e-shape-connector-container-impl.js +4 -2
  32. package/dist/wcardinal/ui/shape/e-shape-connector-container-impl.js.map +1 -1
  33. package/dist/wcardinal/ui/shape/e-shape-connector-container.js.map +1 -1
  34. package/dist/wcardinal/ui/shape/e-shape-connector-edge-container-impl.js +3 -3
  35. package/dist/wcardinal/ui/shape/e-shape-connector-edge-container-impl.js.map +1 -1
  36. package/dist/wcardinal/ui/shape/e-shape-connector-edge-container.js.map +1 -1
  37. package/dist/wcardinal/ui/shape/e-shape-connector-edge-impl.js +2 -2
  38. package/dist/wcardinal/ui/shape/e-shape-connector-edge-impl.js.map +1 -1
  39. package/dist/wcardinal/ui/shape/e-shape-connector-edge.js.map +1 -1
  40. package/dist/wcardinal/ui/shape/e-shape-deleter.js +18 -2
  41. package/dist/wcardinal/ui/shape/e-shape-deleter.js.map +1 -1
  42. package/dist/wcardinal/ui/shape/e-shape-runtime-impl.js +5 -4
  43. package/dist/wcardinal/ui/shape/e-shape-runtime-impl.js.map +1 -1
  44. package/dist/wcardinal/ui/shape/e-shape-transforms.js +5 -4
  45. package/dist/wcardinal/ui/shape/e-shape-transforms.js.map +1 -1
  46. package/dist/wcardinal/ui/shape/e-shape.js.map +1 -1
  47. package/dist/wcardinal/ui/shape/variant/deserialize-connector-line.js +3 -2
  48. package/dist/wcardinal/ui/shape/variant/deserialize-connector-line.js.map +1 -1
  49. package/dist/wcardinal/ui/shape/variant/e-shape-base.js +59 -73
  50. package/dist/wcardinal/ui/shape/variant/e-shape-base.js.map +1 -1
  51. package/dist/wcardinal/ui/shape/variant/e-shape-connector-line.js +18 -18
  52. package/dist/wcardinal/ui/shape/variant/e-shape-connector-line.js.map +1 -1
  53. package/dist/wcardinal/ui/shape/variant/e-shape-group-size-editor.js +33 -26
  54. package/dist/wcardinal/ui/shape/variant/e-shape-group-size-editor.js.map +1 -1
  55. package/dist/wcardinal/ui/shape/variant/e-shape-group-size-layout.js +3 -2
  56. package/dist/wcardinal/ui/shape/variant/e-shape-group-size-layout.js.map +1 -1
  57. package/dist/wcardinal/ui/shape/variant/e-shape-group-size-parent.js.map +1 -1
  58. package/dist/wcardinal/ui/shape/variant/e-shape-group.js +2 -0
  59. package/dist/wcardinal/ui/shape/variant/e-shape-group.js.map +1 -1
  60. package/dist/wcardinal/ui/shape/variant/e-shape-lock-part.js +8 -0
  61. package/dist/wcardinal/ui/shape/variant/e-shape-lock-part.js.map +1 -0
  62. package/dist/wcardinal/ui/shape/variant/e-shape-lock.js +31 -0
  63. package/dist/wcardinal/ui/shape/variant/e-shape-lock.js.map +1 -0
  64. package/dist/wcardinal/ui/shape/variant/index.js +2 -0
  65. package/dist/wcardinal/ui/shape/variant/index.js.map +1 -1
  66. package/dist/wcardinal/ui/shape/variant/to-resized.js +3 -2
  67. package/dist/wcardinal/ui/shape/variant/to-resized.js.map +1 -1
  68. package/dist/wcardinal/ui/theme/dark/d-theme-dark-atlas.js +1 -1
  69. package/dist/wcardinal/ui/theme/dark/d-theme-dark-atlas.js.map +1 -1
  70. package/dist/wcardinal/ui/theme/white/d-theme-white-atlas.js +1 -1
  71. package/dist/wcardinal/ui/theme/white/d-theme-white-atlas.js.map +1 -1
  72. package/dist/wcardinal-ui-theme-dark.js +2 -2
  73. package/dist/wcardinal-ui-theme-dark.min.js +2 -2
  74. package/dist/wcardinal-ui-theme-dark.min.js.map +1 -1
  75. package/dist/wcardinal-ui-theme-white.js +2 -2
  76. package/dist/wcardinal-ui-theme-white.min.js +2 -2
  77. package/dist/wcardinal-ui-theme-white.min.js.map +1 -1
  78. package/dist/wcardinal-ui.cjs.js +215 -168
  79. package/dist/wcardinal-ui.js +213 -166
  80. package/dist/wcardinal-ui.min.js +2 -2
  81. package/dist/wcardinal-ui.min.js.map +1 -1
  82. package/package.json +1 -1
@@ -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;AAEzD;IAAyC,8BAAkB;IAgE1D,oBAAY,IAAgB;QAA5B,YACC,iBAAO,SA2BP;QA1BA,KAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QACb,KAAI,CAAC,IAAI,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AyC,KAAK,CAAC,YAAY,GA04B1D","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\";\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\tprotected _onTransformChangeLock: number;\n\tprotected _isOnTransformChanged: boolean;\n\tprotected _uploadedUpdateLock: number;\n\tprotected _isUploadedUpdated: boolean;\n\tprotected _isUploadedUpdatedRecursively: boolean;\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._onTransformChangeLock = 0;\n\t\tthis._isOnTransformChanged = false;\n\t\tthis.action = new EShapeAction();\n\t\tthis._visible = true;\n\t\tthis._uploadedUpdateLock = 0;\n\t\tthis._isUploadedUpdated = false;\n\t\tthis._isUploadedUpdatedRecursively = false;\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\tthis.onTransformChange_();\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\tthis.onTransformChange_();\n\t\tthis.onParentTransformChange();\n\t}\n\n\tonParentTransformChange(): 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\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\tprotected onTransformChange_(): void {\n\t\tif (this._onTransformChangeLock === 0) {\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} else {\n\t\t\tthis._isOnTransformChanged = true;\n\t\t}\n\t}\n\n\tdisallowOnTransformChange(): void {\n\t\tthis._onTransformChangeLock += 1;\n\t\tif (this._onTransformChangeLock === 1) {\n\t\t\tthis._isOnTransformChanged = false;\n\t\t}\n\t}\n\n\tallowOnTransformChange(invokeOnTransformChange: boolean): void {\n\t\tthis._onTransformChangeLock -= 1;\n\t\tif (this._onTransformChangeLock === 0) {\n\t\t\tif (this._isOnTransformChanged) {\n\t\t\t\tthis._isOnTransformChanged = false;\n\t\t\t\tif (invokeOnTransformChange) {\n\t\t\t\t\tthis.onTransformChange();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tonChildTransformChange(): void {\n\t\t//\n\t}\n\n\tdisallowUploadedUpdate(): void {\n\t\tthis._uploadedUpdateLock += 1;\n\t\tif (this._uploadedUpdateLock === 1) {\n\t\t\tthis._isUploadedUpdated = false;\n\t\t\tthis._isUploadedUpdatedRecursively = false;\n\t\t}\n\t}\n\n\tallowUploadedUpdate(): void {\n\t\tthis._uploadedUpdateLock -= 1;\n\t\tif (this._uploadedUpdateLock === 0) {\n\t\t\tif (this._isUploadedUpdatedRecursively) {\n\t\t\t\tthis._isUploadedUpdatedRecursively = false;\n\t\t\t\tthis._isUploadedUpdated = false;\n\t\t\t\tthis.updateUploadedRecursively();\n\t\t\t} else if (this._isUploadedUpdated) {\n\t\t\t\tthis._isUploadedUpdated = false;\n\t\t\t\tthis.updateUploaded();\n\t\t\t}\n\t\t}\n\t}\n\n\tupdateUploadedRecursively(): void {\n\t\tif (this._uploadedUpdateLock === 0) {\n\t\t\tthis.updateUploaded();\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].updateUploadedRecursively();\n\t\t\t}\n\t\t} else {\n\t\t\tthis._isUploadedUpdatedRecursively = true;\n\t\t}\n\t}\n\n\tupdateUploaded(): void {\n\t\tif (this._uploadedUpdateLock === 0) {\n\t\t\tconst uploaded = this.uploaded;\n\t\t\tif (uploaded != null) {\n\t\t\t\tuploaded.update(this);\n\t\t\t}\n\t\t} else {\n\t\t\tthis._isUploadedUpdated = true;\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.updateUploadedRecursively();\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(): 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();\n\t\t\t}\n\t\t}\n\t\treturn this;\n\t}\n\n\tonDetach(): void {\n\t\tthis.uploaded = undefined;\n\t\tconst connector = this._connector;\n\t\tif (connector) {\n\t\t\tconnector.detach();\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();\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\tupdateRecursively(time: number): void {\n\t\tthis.update(time);\n\n\t\tconst children = this.children;\n\t\tfor (let i = 0, imax = children.length; i < imax; ++i) {\n\t\t\tchildren[i].update(time);\n\t\t}\n\t}\n\n\tcopy(source: EShape, part: EShapeCopyPart = EShapeCopyPart.ALL): this {\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\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.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;oBACpB,IAAI,CAAC,SAAS,CAAC,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,OAAO,IAAI,CAAC;IACb,CAAC;IACF,iBAAC;AAAD,CAAC,AA33BD,CAAyC,KAAK,CAAC,YAAY,GA23B1D","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 _lockTransform: 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._lockTransform = 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\tthis.onTransformChange_();\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\tthis.onTransformChange_();\n\t\tthis.onParentTransformChange();\n\t}\n\n\tonParentTransformChange(): void {\n\t\tif (this._lockTransformParent.isLocked()) {\n\t\t\treturn;\n\t\t}\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\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\tprotected onTransformChange_(): void {\n\t\tif (this._lockTransform.isLocked()) {\n\t\t\treturn;\n\t\t}\n\t\tconst parent = this.parent;\n\t\tif (parent != null) {\n\t\t\tparent.onChildTransformChange();\n\t\t}\n\t}\n\n\tlock(part: EShapeLockPart): this {\n\t\tif (part & EShapeLockPart.TRANSFORM) {\n\t\t\tthis._lockTransform.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.UPLOADED) {\n\t\t\tthis._lockUploaded.lock();\n\t\t}\n\t\treturn this;\n\t}\n\n\tunlock(part: EShapeLockPart, invoke: boolean): this {\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\tif (part & EShapeLockPart.TRANSFORM_PARENT) {\n\t\t\tif (this._lockTransformParent.unlock() && invoke) {\n\t\t\t\tthis.onParentTransformChange();\n\t\t\t}\n\t\t}\n\t\tif (part & EShapeLockPart.TRANSFORM) {\n\t\t\tif (this._lockTransform.unlock() && invoke) {\n\t\t\t\tthis.onTransformChange();\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\tupdateRecursively(time: number): void {\n\t\tthis.update(time);\n\n\t\tconst children = this.children;\n\t\tfor (let i = 0, imax = children.length; i < imax; ++i) {\n\t\t\tchildren[i].update(time);\n\t\t}\n\t}\n\n\tcopy(source: EShape, part: EShapeCopyPart = EShapeCopyPart.ALL): this {\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\treturn this;\n\t}\n}\n"]}
@@ -11,6 +11,8 @@ import { EShapeDefaults } from "../e-shape-defaults";
11
11
  import { EShapeCopyPart } from "../e-shape-copy-part";
12
12
  import { toPointsBoundary } from "../e-shape-points-formatted";
13
13
  import { EShapeConnectorBodyImpl } from "../e-shape-connector-body-impl";
14
+ import { EShapeLockPart } from "./e-shape-lock-part";
15
+ import { EShapeLock } from "./e-shape-lock";
14
16
  var EShapeConnectorLine = /** @class */ (function (_super) {
15
17
  __extends(EShapeConnectorLine, _super);
16
18
  function EShapeConnectorLine(type) {
@@ -23,8 +25,7 @@ var EShapeConnectorLine = /** @class */ (function (_super) {
23
25
  _this._headNormalId = 0;
24
26
  _this._headMargin = 0;
25
27
  _this._bodyId = 0;
26
- _this._lockCount = 0;
27
- _this._isChanged = false;
28
+ _this._lockChange = new EShapeLock();
28
29
  var sx = EShapeDefaults.SIZE_X;
29
30
  var sy = EShapeDefaults.SIZE_Y;
30
31
  var hx = sx * 0.5;
@@ -37,20 +38,20 @@ var EShapeConnectorLine = /** @class */ (function (_super) {
37
38
  _this._body = new EShapeConnectorBodyImpl(_this, onChangeBound);
38
39
  return _this;
39
40
  }
40
- EShapeConnectorLine.prototype.lock = function () {
41
- this._lockCount += 1;
42
- if (this._lockCount === 1) {
43
- this._isChanged = false;
41
+ EShapeConnectorLine.prototype.lock = function (part) {
42
+ _super.prototype.lock.call(this, part);
43
+ if (part & EShapeLockPart.CONNECTOR) {
44
+ this._lockChange.lock();
44
45
  }
46
+ return this;
45
47
  };
46
- EShapeConnectorLine.prototype.unlock = function () {
47
- this._lockCount -= 1;
48
- if (this._lockCount === 0) {
49
- if (this._isChanged) {
48
+ EShapeConnectorLine.prototype.unlock = function (part, invoke) {
49
+ if (part & EShapeLockPart.CONNECTOR) {
50
+ if (this._lockChange.unlock() && invoke) {
50
51
  this.onChange();
51
52
  }
52
- this._isChanged = false;
53
53
  }
54
+ return _super.prototype.unlock.call(this, part, invoke);
54
55
  };
55
56
  Object.defineProperty(EShapeConnectorLine.prototype, "points", {
56
57
  get: function () {
@@ -77,14 +78,13 @@ var EShapeConnectorLine = /** @class */ (function (_super) {
77
78
  _super.prototype.onAttach.call(this);
78
79
  this._edge.attach();
79
80
  };
80
- EShapeConnectorLine.prototype.onDetach = function () {
81
- this._edge.detach();
82
- _super.prototype.onDetach.call(this);
81
+ EShapeConnectorLine.prototype.onDetach = function (exceptions) {
82
+ this._edge.detach(exceptions);
83
+ _super.prototype.onDetach.call(this, exceptions);
83
84
  };
84
85
  EShapeConnectorLine.prototype.onChange = function () {
85
86
  var _a;
86
- if (0 < this._lockCount) {
87
- this._isChanged = true;
87
+ if (this._lockChange.isLocked()) {
88
88
  return;
89
89
  }
90
90
  var edge = this._edge;
@@ -132,7 +132,7 @@ var EShapeConnectorLine = /** @class */ (function (_super) {
132
132
  values[i + 0] -= cx;
133
133
  values[i + 1] -= cy;
134
134
  }
135
- this.disallowUploadedUpdate();
135
+ this.lock(EShapeLockPart.TRANSFORM_AND_UPLOADED);
136
136
  transformPosition.set(px + cx, py + cy);
137
137
  transform.scale.set(1, 1);
138
138
  transform.rotation = 0;
@@ -140,7 +140,7 @@ var EShapeConnectorLine = /** @class */ (function (_super) {
140
140
  points.toFitted(sx, sy);
141
141
  this.size.set(sx, sy);
142
142
  points.set(values);
143
- this.allowUploadedUpdate();
143
+ this.unlock(EShapeLockPart.TRANSFORM_AND_UPLOADED, true);
144
144
  }
145
145
  };
146
146
  EShapeConnectorLine.prototype.fillPoints = function (tail, tailMargin, head, headMargin, body, px, py, values) {
@@ -1 +1 @@
1
- {"version":3,"file":"e-shape-connector-line.js","sourceRoot":"","sources":["../../../../../src/main/typescript/wcardinal/ui/shape/variant/e-shape-connector-line.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAG7C,OAAO,EAAE,gCAAgC,EAAE,MAAM,0CAA0C,CAAC;AAC5F,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAItD,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAE/D,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AAGzE;IAAyC,uCAAc;IAetD,6BAAY,IAA4C;QAA5C,qBAAA,EAAA,OAAmB,UAAU,CAAC,cAAc;QAAxD,YACC,kBAAM,IAAI,CAAC,SAoBX;QAnBA,KAAI,CAAC,YAAY,GAAG,CAAC,CAAC;QACtB,KAAI,CAAC,aAAa,GAAG,CAAC,CAAC;QACvB,KAAI,CAAC,WAAW,GAAG,CAAC,CAAC;QACrB,KAAI,CAAC,YAAY,GAAG,CAAC,CAAC;QACtB,KAAI,CAAC,aAAa,GAAG,CAAC,CAAC;QACvB,KAAI,CAAC,WAAW,GAAG,CAAC,CAAC;QACrB,KAAI,CAAC,OAAO,GAAG,CAAC,CAAC;QACjB,KAAI,CAAC,UAAU,GAAG,CAAC,CAAC;QACpB,KAAI,CAAC,UAAU,GAAG,KAAK,CAAC;QACxB,IAAM,EAAE,GAAG,cAAc,CAAC,MAAM,CAAC;QACjC,IAA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C,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;QAC7C,IAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;QAC7C,IAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;QACjD,MAAM,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,WAAW,CAAC,WAAI,MAAM,cAAI,QAAQ,cAAI,MAAM,MAAG,CAAC,CAAC;QACtE,OAAO,MAAM,CAAC;IACf,CAAC;IACF,0BAAC;AAAD,CAAC,AA5PD,CAAyC,cAAc,GA4PtD","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { EShapeType } from \"../e-shape-type\";\nimport { EShapeConnector } from \"../e-shape-connector\";\nimport { EShapeConnectorEdgeContainer } from \"../e-shape-connector-edge-container\";\nimport { EShapeConnectorEdgeContainerImpl } from \"../e-shape-connector-edge-container-impl\";\nimport { EShapeLineBase } from \"./e-shape-line-base\";\nimport { EShapeLinePoints } from \"./e-shape-line-points\";\nimport { EShapeDefaults } from \"../e-shape-defaults\";\nimport { EShapeCopyPart } from \"../e-shape-copy-part\";\nimport { DDiagramSerializedItem } from \"../../d-diagram-serialized\";\nimport { EShapeResourceManagerSerialization } from \"../e-shape-resource-manager-serialization\";\nimport { EShape } from \"../e-shape\";\nimport { toPointsBoundary } from \"../e-shape-points-formatted\";\nimport { EShapeConnectorBody } from \"../e-shape-connector-body\";\nimport { EShapeConnectorBodyImpl } from \"../e-shape-connector-body-impl\";\nimport { EShapeConnectorEdge } from \"../e-shape-connector-edge\";\n\nexport class EShapeConnectorLine extends EShapeLineBase implements EShapeConnector {\n\tprotected static WORK_BOUNDARY: [number, number, number, number];\n\tprotected _edge: EShapeConnectorEdgeContainer;\n\tprotected _body: EShapeConnectorBody;\n\tprotected declare _points: EShapeLinePoints;\n\tprotected _tailLocalId: number;\n\tprotected _tailNormalId: number;\n\tprotected _tailMargin: number;\n\tprotected _headLocalId: number;\n\tprotected _headNormalId: number;\n\tprotected _headMargin: number;\n\tprotected _bodyId: number;\n\tprotected _lockCount: number;\n\tprotected _isChanged: boolean;\n\n\tconstructor(type: EShapeType = EShapeType.CONNECTOR_LINE) {\n\t\tsuper(type);\n\t\tthis._tailLocalId = 0;\n\t\tthis._tailNormalId = 0;\n\t\tthis._tailMargin = 0;\n\t\tthis._headLocalId = 0;\n\t\tthis._headNormalId = 0;\n\t\tthis._headMargin = 0;\n\t\tthis._bodyId = 0;\n\t\tthis._lockCount = 0;\n\t\tthis._isChanged = false;\n\t\tconst sx = EShapeDefaults.SIZE_X;\n\t\tconst sy = EShapeDefaults.SIZE_Y;\n\t\tconst hx = sx * 0.5;\n\t\tconst hy = sy * 0.5;\n\t\tthis._points = new EShapeLinePoints(this).set([-hx, -hy, +hx, +hy]);\n\t\tconst onChangeBound = (): void => {\n\t\t\tthis.onChange();\n\t\t};\n\t\tthis._edge = new EShapeConnectorEdgeContainerImpl(this, onChangeBound);\n\t\tthis._body = new EShapeConnectorBodyImpl(this, onChangeBound);\n\t}\n\n\tlock(): void {\n\t\tthis._lockCount += 1;\n\t\tif (this._lockCount === 1) {\n\t\t\tthis._isChanged = false;\n\t\t}\n\t}\n\n\tunlock(): void {\n\t\tthis._lockCount -= 1;\n\t\tif (this._lockCount === 0) {\n\t\t\tif (this._isChanged) {\n\t\t\t\tthis.onChange();\n\t\t\t}\n\t\t\tthis._isChanged = false;\n\t\t}\n\t}\n\n\tget points(): EShapeLinePoints {\n\t\treturn this._points;\n\t}\n\n\tget edge(): EShapeConnectorEdgeContainer {\n\t\treturn this._edge;\n\t}\n\n\tget body(): EShapeConnectorBody {\n\t\treturn this._body;\n\t}\n\n\tonAttach(): void {\n\t\tsuper.onAttach();\n\t\tthis._edge.attach();\n\t}\n\n\tonDetach(): void {\n\t\tthis._edge.detach();\n\t\tsuper.onDetach();\n\t}\n\n\tprotected onChange(): void {\n\t\tif (0 < this._lockCount) {\n\t\t\tthis._isChanged = true;\n\t\t\treturn;\n\t\t}\n\n\t\tconst edge = this._edge;\n\t\tconst tail = edge.tail;\n\t\tconst tailLocalId = tail.localId;\n\t\tconst tailNormalId = tail.normalId;\n\t\tconst tailMargin = tail.margin;\n\t\tconst head = edge.head;\n\t\tconst headLocalId = head.localId;\n\t\tconst headNormalId = head.normalId;\n\t\tconst headMargin = head.margin;\n\t\tconst body = this._body;\n\t\tconst bodyId = body.id;\n\t\tif (\n\t\t\tthis._tailLocalId !== tailLocalId ||\n\t\t\tthis._tailNormalId !== tailNormalId ||\n\t\t\tthis._tailMargin !== tailMargin ||\n\t\t\tthis._headLocalId !== headLocalId ||\n\t\t\tthis._headNormalId !== headNormalId ||\n\t\t\tthis._headMargin !== headMargin ||\n\t\t\tthis._bodyId !== bodyId\n\t\t) {\n\t\t\tthis._tailLocalId = tailLocalId;\n\t\t\tthis._tailNormalId = tailNormalId;\n\t\t\tthis._tailMargin = tailMargin;\n\t\t\tthis._headLocalId = headLocalId;\n\t\t\tthis._headNormalId = headNormalId;\n\t\t\tthis._headMargin = headMargin;\n\t\t\tthis._bodyId !== bodyId;\n\n\t\t\tconst transform = this.transform;\n\t\t\tconst transformPosition = transform.position;\n\t\t\tconst px = transformPosition.x;\n\t\t\tconst py = transformPosition.y;\n\t\t\tconst points = this._points;\n\t\t\tconst values = points.values;\n\n\t\t\t// Fill points\n\t\t\tthis.fillPoints(tail, tailMargin, head, headMargin, body, px, py, values);\n\n\t\t\t// Center & size\n\t\t\tconst boundary = (EShapeConnectorLine.WORK_BOUNDARY ??= [0, 0, 0, 0]);\n\t\t\ttoPointsBoundary(values, boundary);\n\t\t\tconst cx = (boundary[2] + boundary[0]) * 0.5;\n\t\t\tconst cy = (boundary[3] + boundary[1]) * 0.5;\n\t\t\tconst sx = boundary[2] - boundary[0];\n\t\t\tconst sy = boundary[3] - boundary[1];\n\n\t\t\t// Adjust values\n\t\t\tfor (let i = 0, imax = values.length; i < imax; i += 2) {\n\t\t\t\tvalues[i + 0] -= cx;\n\t\t\t\tvalues[i + 1] -= cy;\n\t\t\t}\n\n\t\t\tthis.disallowUploadedUpdate();\n\t\t\ttransformPosition.set(px + cx, py + cy);\n\t\t\ttransform.scale.set(1, 1);\n\t\t\ttransform.rotation = 0;\n\t\t\ttransform.skew.set(0, 0);\n\t\t\tpoints.toFitted(sx, sy);\n\t\t\tthis.size.set(sx, sy);\n\t\t\tpoints.set(values);\n\t\t\tthis.allowUploadedUpdate();\n\t\t}\n\t}\n\n\tprotected fillPoints(\n\t\ttail: EShapeConnectorEdge,\n\t\ttailMargin: number,\n\t\thead: EShapeConnectorEdge,\n\t\theadMargin: number,\n\t\tbody: EShapeConnectorBody,\n\t\tpx: number,\n\t\tpy: number,\n\t\tvalues: number[]\n\t): void {\n\t\t// Tail\n\t\tconst threshold = 0.000001;\n\t\tconst tailLocal = tail.local;\n\t\tconst tailLocalX = tailLocal.x;\n\t\tconst tailLocalY = tailLocal.y;\n\t\tconst x0 = tailLocalX - px;\n\t\tconst y0 = tailLocalY - py;\n\n\t\t// Head\n\t\tconst headLocal = head.local;\n\t\tconst headLocalX = headLocal.x;\n\t\tconst headLocalY = headLocal.y;\n\t\tconst x1 = headLocalX - px;\n\t\tconst y1 = headLocalY - py;\n\n\t\t// Body\n\t\tconst bodyValues = body.values;\n\t\tconst bodyValuesLength = bodyValues.length;\n\n\t\t// Tail points\n\t\tvalues[0] = x0;\n\t\tvalues[1] = y0;\n\n\t\t// Body points\n\t\tif (0 < bodyValuesLength) {\n\t\t\tconst cx = (x1 + x0) * 0.5;\n\t\t\tconst cy = (y1 + y0) * 0.5;\n\t\t\tconst dx = x1 - x0;\n\t\t\tconst dy = y1 - y0;\n\t\t\tconst a = Math.atan2(dy, dx);\n\t\t\tconst c = Math.cos(a);\n\t\t\tconst s = Math.sin(a);\n\t\t\tconst l = Math.sqrt(dx * dx + dy * dy);\n\t\t\tfor (let i = 0; i < bodyValuesLength; i += 2) {\n\t\t\t\tconst x = bodyValues[i + 0];\n\t\t\t\tconst y = bodyValues[i + 1];\n\t\t\t\tvalues[i + 2] = cx + (c * x - s * y) * l;\n\t\t\t\tvalues[i + 3] = cy + (c * y + s * x) * l;\n\t\t\t}\n\t\t}\n\n\t\t// Head points\n\t\tvalues[2 + bodyValuesLength] = x1;\n\t\tvalues[3 + bodyValuesLength] = y1;\n\n\t\t// Tail margin\n\t\tif (tailMargin !== 0) {\n\t\t\tconst dx = values[2] - x0;\n\t\t\tconst dy = values[3] - y0;\n\t\t\tconst d = dx * dx + dy * dy;\n\t\t\tif (threshold < d) {\n\t\t\t\tconst f = tailMargin / Math.sqrt(dx * dx + dy * dy);\n\t\t\t\tvalues[0] = x0 + dx * f;\n\t\t\t\tvalues[1] = y0 + dy * f;\n\t\t\t}\n\t\t}\n\n\t\t// Head margin\n\t\tif (headMargin !== 0) {\n\t\t\tconst dx = values[0 + bodyValuesLength] - x1;\n\t\t\tconst dy = values[1 + bodyValuesLength] - y1;\n\t\t\tconst d = dx * dx + dy * dy;\n\t\t\tif (threshold < d) {\n\t\t\t\tconst f = headMargin / Math.sqrt(dx * dx + dy * dy);\n\t\t\t\tvalues[2 + bodyValuesLength] = x1 + dx * f;\n\t\t\t\tvalues[3 + bodyValuesLength] = y1 + dy * f;\n\t\t\t}\n\t\t}\n\n\t\t// Remove the rest\n\t\tvalues.length = bodyValuesLength + 4;\n\t}\n\n\tcopy(source: EShape, part: EShapeCopyPart = EShapeCopyPart.ALL): this {\n\t\tsuper.copy(source, part);\n\t\tif (source instanceof EShapeConnectorLine) {\n\t\t\tthis._edge.copy(source.edge);\n\t\t\tthis._body.copy(source.body);\n\t\t}\n\t\treturn this;\n\t}\n\n\tclone(): EShapeConnectorLine {\n\t\tconst constructor = this.constructor as typeof EShapeConnectorLine;\n\t\treturn new constructor(this.type).copy(this);\n\t}\n\n\tserialize(manager: EShapeResourceManagerSerialization): DDiagramSerializedItem {\n\t\tconst result = super.serialize(manager);\n\t\tconst edgeId = this._edge.serialize(manager);\n\t\tconst bodyId = this._body.serialize(manager);\n\t\tconst pointsId = this._points.serialize(manager);\n\t\tresult[15] = manager.addResource(`[${edgeId},${pointsId},${bodyId}]`);\n\t\treturn result;\n\t}\n}\n"]}
1
+ {"version":3,"file":"e-shape-connector-line.js","sourceRoot":"","sources":["../../../../../src/main/typescript/wcardinal/ui/shape/variant/e-shape-connector-line.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAG7C,OAAO,EAAE,gCAAgC,EAAE,MAAM,0CAA0C,CAAC;AAC5F,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAItD,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAE/D,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AAEzE,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C;IAAyC,uCAAc;IActD,6BAAY,IAA4C;QAA5C,qBAAA,EAAA,OAAmB,UAAU,CAAC,cAAc;QAAxD,YACC,kBAAM,IAAI,CAAC,SAmBX;QAlBA,KAAI,CAAC,YAAY,GAAG,CAAC,CAAC;QACtB,KAAI,CAAC,aAAa,GAAG,CAAC,CAAC;QACvB,KAAI,CAAC,WAAW,GAAG,CAAC,CAAC;QACrB,KAAI,CAAC,YAAY,GAAG,CAAC,CAAC;QACtB,KAAI,CAAC,aAAa,GAAG,CAAC,CAAC;QACvB,KAAI,CAAC,WAAW,GAAG,CAAC,CAAC;QACrB,KAAI,CAAC,OAAO,GAAG,CA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AAW,GAAG,IAAI,CAAC,WAAyC,CAAC;QACnE,OAAO,IAAI,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC9C,CAAC;IAED,uCAAS,GAAT,UAAU,OAA2C;QACpD,IAAM,MAAM,GAAG,iBAAM,SAAS,YAAC,OAAO,CAAC,CAAC;QACxC,IAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;QAC7C,IAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;QAC7C,IAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;QACjD,MAAM,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,WAAW,CAAC,WAAI,MAAM,cAAI,QAAQ,cAAI,MAAM,MAAG,CAAC,CAAC;QACtE,OAAO,MAAM,CAAC;IACf,CAAC;IACF,0BAAC;AAAD,CAAC,AAzPD,CAAyC,cAAc,GAyPtD","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { EShapeType } from \"../e-shape-type\";\nimport { EShapeConnector } from \"../e-shape-connector\";\nimport { EShapeConnectorEdgeContainer } from \"../e-shape-connector-edge-container\";\nimport { EShapeConnectorEdgeContainerImpl } from \"../e-shape-connector-edge-container-impl\";\nimport { EShapeLineBase } from \"./e-shape-line-base\";\nimport { EShapeLinePoints } from \"./e-shape-line-points\";\nimport { EShapeDefaults } from \"../e-shape-defaults\";\nimport { EShapeCopyPart } from \"../e-shape-copy-part\";\nimport { DDiagramSerializedItem } from \"../../d-diagram-serialized\";\nimport { EShapeResourceManagerSerialization } from \"../e-shape-resource-manager-serialization\";\nimport { EShape } from \"../e-shape\";\nimport { toPointsBoundary } from \"../e-shape-points-formatted\";\nimport { EShapeConnectorBody } from \"../e-shape-connector-body\";\nimport { EShapeConnectorBodyImpl } from \"../e-shape-connector-body-impl\";\nimport { EShapeConnectorEdge } from \"../e-shape-connector-edge\";\nimport { EShapeLockPart } from \"./e-shape-lock-part\";\nimport { EShapeLock } from \"./e-shape-lock\";\n\nexport class EShapeConnectorLine extends EShapeLineBase implements EShapeConnector {\n\tprotected static WORK_BOUNDARY: [number, number, number, number];\n\tprotected _edge: EShapeConnectorEdgeContainer;\n\tprotected _body: EShapeConnectorBody;\n\tprotected declare _points: EShapeLinePoints;\n\tprotected _tailLocalId: number;\n\tprotected _tailNormalId: number;\n\tprotected _tailMargin: number;\n\tprotected _headLocalId: number;\n\tprotected _headNormalId: number;\n\tprotected _headMargin: number;\n\tprotected _bodyId: number;\n\tprotected _lockChange: EShapeLock;\n\n\tconstructor(type: EShapeType = EShapeType.CONNECTOR_LINE) {\n\t\tsuper(type);\n\t\tthis._tailLocalId = 0;\n\t\tthis._tailNormalId = 0;\n\t\tthis._tailMargin = 0;\n\t\tthis._headLocalId = 0;\n\t\tthis._headNormalId = 0;\n\t\tthis._headMargin = 0;\n\t\tthis._bodyId = 0;\n\t\tthis._lockChange = new EShapeLock();\n\t\tconst sx = EShapeDefaults.SIZE_X;\n\t\tconst sy = EShapeDefaults.SIZE_Y;\n\t\tconst hx = sx * 0.5;\n\t\tconst hy = sy * 0.5;\n\t\tthis._points = new EShapeLinePoints(this).set([-hx, -hy, +hx, +hy]);\n\t\tconst onChangeBound = (): void => {\n\t\t\tthis.onChange();\n\t\t};\n\t\tthis._edge = new EShapeConnectorEdgeContainerImpl(this, onChangeBound);\n\t\tthis._body = new EShapeConnectorBodyImpl(this, onChangeBound);\n\t}\n\n\toverride lock(part: EShapeLockPart): this {\n\t\tsuper.lock(part);\n\t\tif (part & EShapeLockPart.CONNECTOR) {\n\t\t\tthis._lockChange.lock();\n\t\t}\n\t\treturn this;\n\t}\n\n\toverride unlock(part: EShapeLockPart, invoke: boolean): this {\n\t\tif (part & EShapeLockPart.CONNECTOR) {\n\t\t\tif (this._lockChange.unlock() && invoke) {\n\t\t\t\tthis.onChange();\n\t\t\t}\n\t\t}\n\t\treturn super.unlock(part, invoke);\n\t}\n\n\tget points(): EShapeLinePoints {\n\t\treturn this._points;\n\t}\n\n\tget edge(): EShapeConnectorEdgeContainer {\n\t\treturn this._edge;\n\t}\n\n\tget body(): EShapeConnectorBody {\n\t\treturn this._body;\n\t}\n\n\tonAttach(): void {\n\t\tsuper.onAttach();\n\t\tthis._edge.attach();\n\t}\n\n\tonDetach(exceptions?: Set<EShape>): void {\n\t\tthis._edge.detach(exceptions);\n\t\tsuper.onDetach(exceptions);\n\t}\n\n\tprotected onChange(): void {\n\t\tif (this._lockChange.isLocked()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst edge = this._edge;\n\t\tconst tail = edge.tail;\n\t\tconst tailLocalId = tail.localId;\n\t\tconst tailNormalId = tail.normalId;\n\t\tconst tailMargin = tail.margin;\n\t\tconst head = edge.head;\n\t\tconst headLocalId = head.localId;\n\t\tconst headNormalId = head.normalId;\n\t\tconst headMargin = head.margin;\n\t\tconst body = this._body;\n\t\tconst bodyId = body.id;\n\t\tif (\n\t\t\tthis._tailLocalId !== tailLocalId ||\n\t\t\tthis._tailNormalId !== tailNormalId ||\n\t\t\tthis._tailMargin !== tailMargin ||\n\t\t\tthis._headLocalId !== headLocalId ||\n\t\t\tthis._headNormalId !== headNormalId ||\n\t\t\tthis._headMargin !== headMargin ||\n\t\t\tthis._bodyId !== bodyId\n\t\t) {\n\t\t\tthis._tailLocalId = tailLocalId;\n\t\t\tthis._tailNormalId = tailNormalId;\n\t\t\tthis._tailMargin = tailMargin;\n\t\t\tthis._headLocalId = headLocalId;\n\t\t\tthis._headNormalId = headNormalId;\n\t\t\tthis._headMargin = headMargin;\n\t\t\tthis._bodyId !== bodyId;\n\n\t\t\tconst transform = this.transform;\n\t\t\tconst transformPosition = transform.position;\n\t\t\tconst px = transformPosition.x;\n\t\t\tconst py = transformPosition.y;\n\t\t\tconst points = this._points;\n\t\t\tconst values = points.values;\n\n\t\t\t// Fill points\n\t\t\tthis.fillPoints(tail, tailMargin, head, headMargin, body, px, py, values);\n\n\t\t\t// Center & size\n\t\t\tconst boundary = (EShapeConnectorLine.WORK_BOUNDARY ??= [0, 0, 0, 0]);\n\t\t\ttoPointsBoundary(values, boundary);\n\t\t\tconst cx = (boundary[2] + boundary[0]) * 0.5;\n\t\t\tconst cy = (boundary[3] + boundary[1]) * 0.5;\n\t\t\tconst sx = boundary[2] - boundary[0];\n\t\t\tconst sy = boundary[3] - boundary[1];\n\n\t\t\t// Adjust values\n\t\t\tfor (let i = 0, imax = values.length; i < imax; i += 2) {\n\t\t\t\tvalues[i + 0] -= cx;\n\t\t\t\tvalues[i + 1] -= cy;\n\t\t\t}\n\n\t\t\tthis.lock(EShapeLockPart.TRANSFORM_AND_UPLOADED);\n\t\t\ttransformPosition.set(px + cx, py + cy);\n\t\t\ttransform.scale.set(1, 1);\n\t\t\ttransform.rotation = 0;\n\t\t\ttransform.skew.set(0, 0);\n\t\t\tpoints.toFitted(sx, sy);\n\t\t\tthis.size.set(sx, sy);\n\t\t\tpoints.set(values);\n\t\t\tthis.unlock(EShapeLockPart.TRANSFORM_AND_UPLOADED, true);\n\t\t}\n\t}\n\n\tprotected fillPoints(\n\t\ttail: EShapeConnectorEdge,\n\t\ttailMargin: number,\n\t\thead: EShapeConnectorEdge,\n\t\theadMargin: number,\n\t\tbody: EShapeConnectorBody,\n\t\tpx: number,\n\t\tpy: number,\n\t\tvalues: number[]\n\t): void {\n\t\t// Tail\n\t\tconst threshold = 0.000001;\n\t\tconst tailLocal = tail.local;\n\t\tconst tailLocalX = tailLocal.x;\n\t\tconst tailLocalY = tailLocal.y;\n\t\tconst x0 = tailLocalX - px;\n\t\tconst y0 = tailLocalY - py;\n\n\t\t// Head\n\t\tconst headLocal = head.local;\n\t\tconst headLocalX = headLocal.x;\n\t\tconst headLocalY = headLocal.y;\n\t\tconst x1 = headLocalX - px;\n\t\tconst y1 = headLocalY - py;\n\n\t\t// Body\n\t\tconst bodyValues = body.values;\n\t\tconst bodyValuesLength = bodyValues.length;\n\n\t\t// Tail points\n\t\tvalues[0] = x0;\n\t\tvalues[1] = y0;\n\n\t\t// Body points\n\t\tif (0 < bodyValuesLength) {\n\t\t\tconst cx = (x1 + x0) * 0.5;\n\t\t\tconst cy = (y1 + y0) * 0.5;\n\t\t\tconst dx = x1 - x0;\n\t\t\tconst dy = y1 - y0;\n\t\t\tconst a = Math.atan2(dy, dx);\n\t\t\tconst c = Math.cos(a);\n\t\t\tconst s = Math.sin(a);\n\t\t\tconst l = Math.sqrt(dx * dx + dy * dy);\n\t\t\tfor (let i = 0; i < bodyValuesLength; i += 2) {\n\t\t\t\tconst x = bodyValues[i + 0];\n\t\t\t\tconst y = bodyValues[i + 1];\n\t\t\t\tvalues[i + 2] = cx + (c * x - s * y) * l;\n\t\t\t\tvalues[i + 3] = cy + (c * y + s * x) * l;\n\t\t\t}\n\t\t}\n\n\t\t// Head points\n\t\tvalues[2 + bodyValuesLength] = x1;\n\t\tvalues[3 + bodyValuesLength] = y1;\n\n\t\t// Tail margin\n\t\tif (tailMargin !== 0) {\n\t\t\tconst dx = values[2] - x0;\n\t\t\tconst dy = values[3] - y0;\n\t\t\tconst d = dx * dx + dy * dy;\n\t\t\tif (threshold < d) {\n\t\t\t\tconst f = tailMargin / Math.sqrt(dx * dx + dy * dy);\n\t\t\t\tvalues[0] = x0 + dx * f;\n\t\t\t\tvalues[1] = y0 + dy * f;\n\t\t\t}\n\t\t}\n\n\t\t// Head margin\n\t\tif (headMargin !== 0) {\n\t\t\tconst dx = values[0 + bodyValuesLength] - x1;\n\t\t\tconst dy = values[1 + bodyValuesLength] - y1;\n\t\t\tconst d = dx * dx + dy * dy;\n\t\t\tif (threshold < d) {\n\t\t\t\tconst f = headMargin / Math.sqrt(dx * dx + dy * dy);\n\t\t\t\tvalues[2 + bodyValuesLength] = x1 + dx * f;\n\t\t\t\tvalues[3 + bodyValuesLength] = y1 + dy * f;\n\t\t\t}\n\t\t}\n\n\t\t// Remove the rest\n\t\tvalues.length = bodyValuesLength + 4;\n\t}\n\n\tcopy(source: EShape, part: EShapeCopyPart = EShapeCopyPart.ALL): this {\n\t\tsuper.copy(source, part);\n\t\tif (source instanceof EShapeConnectorLine) {\n\t\t\tthis._edge.copy(source.edge);\n\t\t\tthis._body.copy(source.body);\n\t\t}\n\t\treturn this;\n\t}\n\n\tclone(): EShapeConnectorLine {\n\t\tconst constructor = this.constructor as typeof EShapeConnectorLine;\n\t\treturn new constructor(this.type).copy(this);\n\t}\n\n\tserialize(manager: EShapeResourceManagerSerialization): DDiagramSerializedItem {\n\t\tconst result = super.serialize(manager);\n\t\tconst edgeId = this._edge.serialize(manager);\n\t\tconst bodyId = this._body.serialize(manager);\n\t\tconst pointsId = this._points.serialize(manager);\n\t\tresult[15] = manager.addResource(`[${edgeId},${pointsId},${bodyId}]`);\n\t\treturn result;\n\t}\n}\n"]}
@@ -4,6 +4,7 @@
4
4
  */
5
5
  import { Point, Rectangle } from "pixi.js";
6
6
  import { EShapeGroupSizeLayout } from "./e-shape-group-size-layout";
7
+ import { EShapeLockPart } from "./e-shape-lock-part";
7
8
  var EShapeGroupSizeEditor = /** @class */ (function () {
8
9
  function EShapeGroupSizeEditor(parent, x, y, isFittable) {
9
10
  this._workRectForCalcRect = new Rectangle();
@@ -98,41 +99,43 @@ var EShapeGroupSizeEditor = /** @class */ (function () {
98
99
  };
99
100
  EShapeGroupSizeEditor.prototype.doFit = function () {
100
101
  var parent = this._parent;
101
- parent.disallowOnTransformChange();
102
+ parent.lock(EShapeLockPart.TRANSFORM | EShapeLockPart.TRANSFORM_PARENT);
102
103
  // Calculate the rect
103
104
  var rect = this.calcRect(this._workRectForFit);
104
105
  // Set size
105
106
  var size = this._size;
106
107
  size.set(rect.width, rect.height);
107
- // Position & Pivot
108
- // rx := rect.x
109
- // ry := rect.y
108
+ // Calculating new position & pivot
110
109
  //
111
- // | a c tx | | 1 0 +rx | | 1 0 -rx | | a c tx + (a * rx + c * ry) | | 1 0 -rx |
112
- // | b d ty | | 0 1 +ry | | 0 1 -ry | = | b d ty + (b * rx + d * ry) | | 0 1 -ry |
113
- // | 0 0 1 | | 0 0 1 | | 0 0 1 | | 0 0 1 | | 0 0 1 |
110
+ // cx := rect.x + rect.width * 0.5
111
+ // cy := rect.y + rect.height * 0.5
114
112
  //
115
- // tx -> tx + (a * rx + c * ry) = poxition.x - (a * pivot.x + c * pivot.y)
116
- // ty -> ty + (b * rx + d * ry) = poxition.y - (b * pivot.x + d * pivot.y)
117
- // position.x -> position.x + (a * rx + c * ry) - (a * pivot.x + c * pivot.y)
118
- // position.y -> position.y + (b * rx + d * ry) - (b * pivot.x + d * pivot.y)
119
- // pivot.x -> 0
120
- // pivot.y -> 0
113
+ // Since the local transform need to be unchanged:
121
114
  //
122
- // a -> a', b -> b', c -> c', tx -> tx', ty -> ty'
115
+ // | a c tx | | a c px' - (a * pvx' + c * pvy') |
116
+ // | b d ty | = | b d py' - (b * pvx' + d * pvy') |
117
+ // | 0 0 1 | | 0 0 1 |
123
118
  //
124
- // | a' c' tx' | | 1 0 -rx | | a' c' tx' - (a' * rx + c' * ry) |
125
- // | b' d' ty' | | 0 1 -ry | = | b' d' ty' - (b' * rx + d' * ry) |
126
- // | 0 0 1 | | 0 0 1 | | 0 0 1 |
119
+ // Here, (px', py') and (pvx', pvy') are the new position
120
+ // and the new pivot, respectively.
127
121
  //
128
- // tx' -> tx' - (a' * rx + c' * ry) = poxition.x - (a' * pivot.x + c' * pivot.y)
129
- // ty' -> ty' - (b' * rx + d' * ry) = poxition.y - (b' * pivot.x + d' * pivot.y)
130
- // pivot.x -> pivot.x + rx
131
- // pivot.y -> pivot.y + ry
122
+ // Setting the new pivot (pvx', pvy') to (cx, cy) leads to
123
+ //
124
+ // | a c tx | | a c px' - (a * cx + c * cy) |
125
+ // | b d ty | = | b d py' - (b * cx + d * cy) |
126
+ // | 0 0 1 | | 0 0 1 |
127
+ //
128
+ // tx = px - (a * pvx + c * pvy) = px' - (a * cx + c * cy)
129
+ // ty = py - (b * pvx + d * pvy) = py' - (b * cx + d * cy)
130
+ //
131
+ // Thus, the new position (px', py') is
132
+ //
133
+ // px' = px + (a * (cx - pvx) + c * (cy - pvy))
134
+ // py' = py + (b * (cy - pvx) + d * (cy - pvy))
132
135
  parent.updateTransform();
133
136
  var transform = parent.transform;
134
- var x = rect.x + rect.width * 0.5;
135
- var y = rect.y + rect.height * 0.5;
137
+ var cx = rect.x + rect.width * 0.5;
138
+ var cy = rect.y + rect.height * 0.5;
136
139
  var position = transform.position;
137
140
  var localTransform = transform.localTransform;
138
141
  var a = localTransform.a;
@@ -140,12 +143,16 @@ var EShapeGroupSizeEditor = /** @class */ (function () {
140
143
  var c = localTransform.c;
141
144
  var d = localTransform.d;
142
145
  var pivot = transform.pivot;
143
- position.set(position.x + (a * x + c * y) - (a * pivot.x + c * pivot.y), position.y + (b * x + d * y) - (b * pivot.x + d * pivot.y));
144
- pivot.set(x, y);
146
+ var pvx = pivot.x;
147
+ var pvy = pivot.y;
148
+ var dpvx = cx - pvx;
149
+ var dpvy = cy - pvy;
150
+ position.set(position.x + (a * dpvx + c * dpvy), position.y + (b * dpvx + d * dpvy));
151
+ pivot.set(cx, cy);
145
152
  // Reset the data
146
153
  this.reset(parent.children, this._layouts, size);
147
154
  //
148
- parent.allowOnTransformChange(true);
155
+ parent.unlock(EShapeLockPart.TRANSFORM | EShapeLockPart.TRANSFORM_PARENT, true);
149
156
  };
150
157
  EShapeGroupSizeEditor.prototype.reset = function (children, layouts, size) {
151
158
  for (var i = 0, imax = Math.min(layouts.length, children.length); i < imax; ++i) {
@@ -1 +1 @@
1
- {"version":3,"file":"e-shape-group-size-editor.js","sourceRoot":"","sources":["../../../../../src/main/typescript/wcardinal/ui/shape/variant/e-shape-group-size-editor.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAU,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS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E,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;aACrC;iBAAM;gBACN,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC;gBACnB,MAAM;aACN;SACD;QACD,KAAK,IAAI,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,IAAI,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,GAAG,IAAI,EAAE,EAAE,CAAC,EAAE;YACnE,IAAM,KAAK,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;YAC1B,IAAM,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;YAC7C,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;YACrC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;SACrB;QACD,IAAI,OAAO,CAAC,MAAM,KAAK,QAAQ,CAAC,MAAM,EAAE;YACvC,OAAO,CAAC,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC;SACjC;IACF,CAAC;IAES,yCAAS,GAAnB,UAAoB,KAAa,EAAE,EAAU,EAAE,EAAU;QACxD,OAAO,KAAK,CAAC,MAAM,IAAI,IAAI,qBAAqB,CAAC,KAAK,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;IACjE,CAAC;IACF,4BAAC;AAAD,CAAC,AAhPD,IAgPC","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { IPoint, Point, Rectangle } from \"pixi.js\";\nimport { EShape } from \"../e-shape\";\nimport { EShapeLayout } from \"../e-shape-layout\";\nimport { EShapeGroupSize } from \"./e-shape-group-size\";\nimport { EShapeGroupSizeLayout } from \"./e-shape-group-size-layout\";\nimport { EShapeGroupSizeParent } from \"./e-shape-group-size-parent\";\n\nexport class EShapeGroupSizeEditor implements EShapeGroupSize {\n\tprotected _parent: EShapeGroupSizeParent;\n\tprotected _size: Point;\n\tprotected _layouts: EShapeLayout[];\n\tprotected _workRectForCalcRect: Rectangle = new Rectangle();\n\tprotected _workRectForFit: Rectangle = new Rectangle();\n\tprotected _isFittable: boolean;\n\n\tconstructor(parent: EShapeGroupSizeParent, x: number, y: number, isFittable: boolean) {\n\t\tthis._parent = parent;\n\t\tthis._layouts = [];\n\t\tthis._size = new Point(x, y);\n\t\tthis._isFittable = isFittable;\n\t}\n\n\tinit(): this {\n\t\treturn this;\n\t}\n\n\tget x(): number {\n\t\treturn this._size.x;\n\t}\n\n\tset x(x: number) {\n\t\tconst size = this._size;\n\t\tif (size.x !== x) {\n\t\t\tconst ox = size.x;\n\t\t\tsize.x = x;\n\t\t\tthis.onChange(ox, size.y);\n\t\t}\n\t}\n\n\tget y(): number {\n\t\treturn this._size.y;\n\t}\n\n\tset y(y: number) {\n\t\tconst size = this._size;\n\t\tif (size.y !== y) {\n\t\t\tconst oy = size.y;\n\t\t\tsize.y = y;\n\t\t\tthis.onChange(size.x, oy);\n\t\t}\n\t}\n\n\tset(x?: number, y?: number): this {\n\t\tlet isChanged = false;\n\t\tconst size = this._size;\n\t\tconst ox = size.x;\n\t\tconst oy = size.y;\n\t\tif (x != null && ox !== x) {\n\t\t\tisChanged = true;\n\t\t\tsize.x = x;\n\t\t}\n\t\tif (y != null && oy !== y) {\n\t\t\tisChanged = true;\n\t\t\tsize.y = y;\n\t\t}\n\t\tif (isChanged) {\n\t\t\tthis.onChange(ox, oy);\n\t\t}\n\t\treturn this;\n\t}\n\n\tclone(): EShapeGroupSizeEditor {\n\t\tconst size = this._size;\n\t\treturn new EShapeGroupSizeEditor(this._parent, size.x, size.y, this._isFittable);\n\t}\n\n\tcopy(): void {\n\t\t// DO NOTHING\n\t}\n\n\tcopyFrom(point: IPoint): this {\n\t\tconst x = point.x;\n\t\tconst y = point.y;\n\t\tconst size = this._size;\n\t\tconst ox = size.x;\n\t\tconst oy = size.y;\n\t\tif (ox !== x || oy !== y) {\n\t\t\tsize.x = x;\n\t\t\tsize.y = y;\n\t\t\tthis.onChange(ox, oy);\n\t\t}\n\t\treturn this;\n\t}\n\n\tcopyTo(point: IPoint): IPoint {\n\t\treturn this._size.copyTo(point);\n\t}\n\n\tequals(point: IPoint): boolean {\n\t\treturn this._size.equals(point);\n\t}\n\n\tfit(): this {\n\t\tif (this._isFittable) {\n\t\t\tthis.doFit();\n\t\t}\n\t\treturn this;\n\t}\n\n\tprotected doFit(): void {\n\t\tconst parent = this._parent;\n\t\tparent.disallowOnTransformChange();\n\n\t\t// Calculate the rect\n\t\tconst rect = this.calcRect(this._workRectForFit);\n\n\t\t// Set size\n\t\tconst size = this._size;\n\t\tsize.set(rect.width, rect.height);\n\n\t\t// Position & Pivot\n\t\t// rx := rect.x\n\t\t// ry := rect.y\n\t\t//\n\t\t// | a c tx | | 1 0 +rx | | 1 0 -rx | | a c tx + (a * rx + c * ry) | | 1 0 -rx |\n\t\t// | b d ty | | 0 1 +ry | | 0 1 -ry | = | b d ty + (b * rx + d * ry) | | 0 1 -ry |\n\t\t// | 0 0 1 | | 0 0 1 | | 0 0 1 | | 0 0 1 | | 0 0 1 |\n\t\t//\n\t\t// tx -> tx + (a * rx + c * ry) = poxition.x - (a * pivot.x + c * pivot.y)\n\t\t// ty -> ty + (b * rx + d * ry) = poxition.y - (b * pivot.x + d * pivot.y)\n\t\t// position.x -> position.x + (a * rx + c * ry) - (a * pivot.x + c * pivot.y)\n\t\t// position.y -> position.y + (b * rx + d * ry) - (b * pivot.x + d * pivot.y)\n\t\t// pivot.x -> 0\n\t\t// pivot.y -> 0\n\t\t//\n\t\t// a -> a', b -> b', c -> c', tx -> tx', ty -> ty'\n\t\t//\n\t\t// | a' c' tx' | | 1 0 -rx | | a' c' tx' - (a' * rx + c' * ry) |\n\t\t// | b' d' ty' | | 0 1 -ry | = | b' d' ty' - (b' * rx + d' * ry) |\n\t\t// | 0 0 1 | | 0 0 1 | | 0 0 1 |\n\t\t//\n\t\t// tx' -> tx' - (a' * rx + c' * ry) = poxition.x - (a' * pivot.x + c' * pivot.y)\n\t\t// ty' -> ty' - (b' * rx + d' * ry) = poxition.y - (b' * pivot.x + d' * pivot.y)\n\t\t// pivot.x -> pivot.x + rx\n\t\t// pivot.y -> pivot.y + ry\n\t\tparent.updateTransform();\n\t\tconst transform = parent.transform;\n\t\tconst x = rect.x + rect.width * 0.5;\n\t\tconst y = rect.y + rect.height * 0.5;\n\t\tconst position = transform.position;\n\t\tconst localTransform = transform.localTransform;\n\t\tconst a = localTransform.a;\n\t\tconst b = localTransform.b;\n\t\tconst c = localTransform.c;\n\t\tconst d = localTransform.d;\n\t\tconst pivot = transform.pivot;\n\t\tposition.set(\n\t\t\tposition.x + (a * x + c * y) - (a * pivot.x + c * pivot.y),\n\t\t\tposition.y + (b * x + d * y) - (b * pivot.x + d * pivot.y)\n\t\t);\n\t\tpivot.set(x, y);\n\n\t\t// Reset the data\n\t\tthis.reset(parent.children, this._layouts, size);\n\n\t\t//\n\t\tparent.allowOnTransformChange(true);\n\t}\n\n\tprotected reset(children: EShape[], layouts: EShapeLayout[], size: IPoint): void {\n\t\tfor (let i = 0, imax = Math.min(layouts.length, children.length); i < imax; ++i) {\n\t\t\tconst child = children[i];\n\t\t\tconst layout = layouts[i];\n\t\t\tif (layout.isCompatible(child)) {\n\t\t\t\tlayout.reset(child, size.x, size.y);\n\t\t\t} else {\n\t\t\t\tlayouts.length = i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (children.length < layouts.length) {\n\t\t\tlayouts.length = children.length;\n\t\t}\n\t}\n\n\tcalcRect(result: Rectangle): Rectangle {\n\t\tconst parent = this._parent;\n\t\tconst children = parent.children;\n\t\tif (children.length <= 0) {\n\t\t\tresult.x = 0;\n\t\t\tresult.y = 0;\n\t\t\tresult.width = 0;\n\t\t\tresult.height = 0;\n\t\t} else {\n\t\t\tconst workRect = this._workRectForCalcRect;\n\t\t\tchildren[0].getBoundsLocal(false, result);\n\t\t\tfor (let i = 1, imax = children.length; i < imax; ++i) {\n\t\t\t\tconst child = children[i];\n\t\t\t\tchild.getBoundsLocal(false, workRect);\n\t\t\t\tresult.enlarge(workRect);\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}\n\n\tprotected onChange(ox: number, oy: number): void {\n\t\tconst parent = this._parent;\n\t\tconst size = this._size;\n\t\tconst pivot = parent.transform.pivot;\n\t\tthis.onChange_(parent.children, this._layouts, size.x, size.y, pivot.x, pivot.y, ox, oy);\n\t\tparent.onSizeChange();\n\t}\n\n\tprotected onChange_(\n\t\tchildren: EShape[],\n\t\tlayouts: EShapeLayout[],\n\t\tsx: number,\n\t\tsy: number,\n\t\tpx: number,\n\t\tpy: number,\n\t\tox: number,\n\t\toy: number\n\t): void {\n\t\tfor (let i = 0, imax = Math.min(layouts.length, children.length); i < imax; ++i) {\n\t\t\tconst child = children[i];\n\t\t\tconst layout = layouts[i];\n\t\t\tif (layout.isCompatible(child)) {\n\t\t\t\tlayout.update(child, sx, sy, px, py);\n\t\t\t} else {\n\t\t\t\tlayouts.length = i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tfor (let i = layouts.length, imax = children.length; i < imax; ++i) {\n\t\t\tconst child = children[i];\n\t\t\tconst layout = this.newLayout(child, ox, oy);\n\t\t\tlayout.update(child, sx, sy, px, py);\n\t\t\tlayouts.push(layout);\n\t\t}\n\t\tif (layouts.length !== children.length) {\n\t\t\tlayouts.length = children.length;\n\t\t}\n\t}\n\n\tprotected newLayout(shape: EShape, ox: number, oy: number): EShapeLayout {\n\t\treturn shape.layout || new EShapeGroupSizeLayout(shape, ox, oy);\n\t}\n}\n"]}
1
+ {"version":3,"file":"e-shape-group-size-editor.js","sourceRoot":"","sources":["../../../../../src/main/typescript/wcardinal/ui/shape/variant/e-shape-group-size-editor.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAU,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AA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GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;YAC1B,IAAM,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;YAC1B,IAAI,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE;gBAC/B,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;aACrC;iBAAM;gBACN,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC;gBACnB,MAAM;aACN;SACD;QACD,KAAK,IAAI,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,IAAI,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,GAAG,IAAI,EAAE,EAAE,CAAC,EAAE;YACnE,IAAM,KAAK,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;YAC1B,IAAM,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;YAC7C,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;YACrC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;SACrB;QACD,IAAI,OAAO,CAAC,MAAM,KAAK,QAAQ,CAAC,MAAM,EAAE;YACvC,OAAO,CAAC,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC;SACjC;IACF,CAAC;IAES,yCAAS,GAAnB,UAAoB,KAAa,EAAE,EAAU,EAAE,EAAU;QACxD,OAAO,KAAK,CAAC,MAAM,IAAI,IAAI,qBAAqB,CAAC,KAAK,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;IACjE,CAAC;IACF,4BAAC;AAAD,CAAC,AAnPD,IAmPC","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { IPoint, Point, Rectangle } from \"pixi.js\";\nimport { EShape } from \"../e-shape\";\nimport { EShapeLayout } from \"../e-shape-layout\";\nimport { EShapeGroupSize } from \"./e-shape-group-size\";\nimport { EShapeGroupSizeLayout } from \"./e-shape-group-size-layout\";\nimport { EShapeGroupSizeParent } from \"./e-shape-group-size-parent\";\nimport { EShapeLockPart } from \"./e-shape-lock-part\";\n\nexport class EShapeGroupSizeEditor implements EShapeGroupSize {\n\tprotected _parent: EShapeGroupSizeParent;\n\tprotected _size: Point;\n\tprotected _layouts: EShapeLayout[];\n\tprotected _workRectForCalcRect: Rectangle = new Rectangle();\n\tprotected _workRectForFit: Rectangle = new Rectangle();\n\tprotected _isFittable: boolean;\n\n\tconstructor(parent: EShapeGroupSizeParent, x: number, y: number, isFittable: boolean) {\n\t\tthis._parent = parent;\n\t\tthis._layouts = [];\n\t\tthis._size = new Point(x, y);\n\t\tthis._isFittable = isFittable;\n\t}\n\n\tinit(): this {\n\t\treturn this;\n\t}\n\n\tget x(): number {\n\t\treturn this._size.x;\n\t}\n\n\tset x(x: number) {\n\t\tconst size = this._size;\n\t\tif (size.x !== x) {\n\t\t\tconst ox = size.x;\n\t\t\tsize.x = x;\n\t\t\tthis.onChange(ox, size.y);\n\t\t}\n\t}\n\n\tget y(): number {\n\t\treturn this._size.y;\n\t}\n\n\tset y(y: number) {\n\t\tconst size = this._size;\n\t\tif (size.y !== y) {\n\t\t\tconst oy = size.y;\n\t\t\tsize.y = y;\n\t\t\tthis.onChange(size.x, oy);\n\t\t}\n\t}\n\n\tset(x?: number, y?: number): this {\n\t\tlet isChanged = false;\n\t\tconst size = this._size;\n\t\tconst ox = size.x;\n\t\tconst oy = size.y;\n\t\tif (x != null && ox !== x) {\n\t\t\tisChanged = true;\n\t\t\tsize.x = x;\n\t\t}\n\t\tif (y != null && oy !== y) {\n\t\t\tisChanged = true;\n\t\t\tsize.y = y;\n\t\t}\n\t\tif (isChanged) {\n\t\t\tthis.onChange(ox, oy);\n\t\t}\n\t\treturn this;\n\t}\n\n\tclone(): EShapeGroupSizeEditor {\n\t\tconst size = this._size;\n\t\treturn new EShapeGroupSizeEditor(this._parent, size.x, size.y, this._isFittable);\n\t}\n\n\tcopy(): void {\n\t\t// DO NOTHING\n\t}\n\n\tcopyFrom(point: IPoint): this {\n\t\tconst x = point.x;\n\t\tconst y = point.y;\n\t\tconst size = this._size;\n\t\tconst ox = size.x;\n\t\tconst oy = size.y;\n\t\tif (ox !== x || oy !== y) {\n\t\t\tsize.x = x;\n\t\t\tsize.y = y;\n\t\t\tthis.onChange(ox, oy);\n\t\t}\n\t\treturn this;\n\t}\n\n\tcopyTo(point: IPoint): IPoint {\n\t\treturn this._size.copyTo(point);\n\t}\n\n\tequals(point: IPoint): boolean {\n\t\treturn this._size.equals(point);\n\t}\n\n\tfit(): this {\n\t\tif (this._isFittable) {\n\t\t\tthis.doFit();\n\t\t}\n\t\treturn this;\n\t}\n\n\tprotected doFit(): void {\n\t\tconst parent = this._parent;\n\t\tparent.lock(EShapeLockPart.TRANSFORM | EShapeLockPart.TRANSFORM_PARENT);\n\n\t\t// Calculate the rect\n\t\tconst rect = this.calcRect(this._workRectForFit);\n\n\t\t// Set size\n\t\tconst size = this._size;\n\t\tsize.set(rect.width, rect.height);\n\n\t\t// Calculating new position & pivot\n\t\t//\n\t\t// cx := rect.x + rect.width * 0.5\n\t\t// cy := rect.y + rect.height * 0.5\n\t\t//\n\t\t// Since the local transform need to be unchanged:\n\t\t//\n\t\t// | a c tx | | a c px' - (a * pvx' + c * pvy') |\n\t\t// | b d ty | = | b d py' - (b * pvx' + d * pvy') |\n\t\t// | 0 0 1 | | 0 0 1 |\n\t\t//\n\t\t// Here, (px', py') and (pvx', pvy') are the new position\n\t\t// and the new pivot, respectively.\n\t\t//\n\t\t// Setting the new pivot (pvx', pvy') to (cx, cy) leads to\n\t\t//\n\t\t// | a c tx | | a c px' - (a * cx + c * cy) |\n\t\t// | b d ty | = | b d py' - (b * cx + d * cy) |\n\t\t// | 0 0 1 | | 0 0 1 |\n\t\t//\n\t\t// tx = px - (a * pvx + c * pvy) = px' - (a * cx + c * cy)\n\t\t// ty = py - (b * pvx + d * pvy) = py' - (b * cx + d * cy)\n\t\t//\n\t\t// Thus, the new position (px', py') is\n\t\t//\n\t\t// px' = px + (a * (cx - pvx) + c * (cy - pvy))\n\t\t// py' = py + (b * (cy - pvx) + d * (cy - pvy))\n\t\tparent.updateTransform();\n\t\tconst transform = parent.transform;\n\t\tconst cx = rect.x + rect.width * 0.5;\n\t\tconst cy = rect.y + rect.height * 0.5;\n\t\tconst position = transform.position;\n\t\tconst localTransform = transform.localTransform;\n\t\tconst a = localTransform.a;\n\t\tconst b = localTransform.b;\n\t\tconst c = localTransform.c;\n\t\tconst d = localTransform.d;\n\t\tconst pivot = transform.pivot;\n\t\tconst pvx = pivot.x;\n\t\tconst pvy = pivot.y;\n\t\tconst dpvx = cx - pvx;\n\t\tconst dpvy = cy - pvy;\n\t\tposition.set(position.x + (a * dpvx + c * dpvy), position.y + (b * dpvx + d * dpvy));\n\t\tpivot.set(cx, cy);\n\n\t\t// Reset the data\n\t\tthis.reset(parent.children, this._layouts, size);\n\n\t\t//\n\t\tparent.unlock(EShapeLockPart.TRANSFORM | EShapeLockPart.TRANSFORM_PARENT, true);\n\t}\n\n\tprotected reset(children: EShape[], layouts: EShapeLayout[], size: IPoint): void {\n\t\tfor (let i = 0, imax = Math.min(layouts.length, children.length); i < imax; ++i) {\n\t\t\tconst child = children[i];\n\t\t\tconst layout = layouts[i];\n\t\t\tif (layout.isCompatible(child)) {\n\t\t\t\tlayout.reset(child, size.x, size.y);\n\t\t\t} else {\n\t\t\t\tlayouts.length = i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (children.length < layouts.length) {\n\t\t\tlayouts.length = children.length;\n\t\t}\n\t}\n\n\tcalcRect(result: Rectangle): Rectangle {\n\t\tconst parent = this._parent;\n\t\tconst children = parent.children;\n\t\tif (children.length <= 0) {\n\t\t\tresult.x = 0;\n\t\t\tresult.y = 0;\n\t\t\tresult.width = 0;\n\t\t\tresult.height = 0;\n\t\t} else {\n\t\t\tconst workRect = this._workRectForCalcRect;\n\t\t\tchildren[0].getBoundsLocal(false, result);\n\t\t\tfor (let i = 1, imax = children.length; i < imax; ++i) {\n\t\t\t\tconst child = children[i];\n\t\t\t\tchild.getBoundsLocal(false, workRect);\n\t\t\t\tresult.enlarge(workRect);\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}\n\n\tprotected onChange(ox: number, oy: number): void {\n\t\tconst parent = this._parent;\n\t\tconst size = this._size;\n\t\tconst pivot = parent.transform.pivot;\n\t\tthis.onChange_(parent.children, this._layouts, size.x, size.y, pivot.x, pivot.y, ox, oy);\n\t\tparent.onSizeChange();\n\t}\n\n\tprotected onChange_(\n\t\tchildren: EShape[],\n\t\tlayouts: EShapeLayout[],\n\t\tsx: number,\n\t\tsy: number,\n\t\tpx: number,\n\t\tpy: number,\n\t\tox: number,\n\t\toy: number\n\t): void {\n\t\tfor (let i = 0, imax = Math.min(layouts.length, children.length); i < imax; ++i) {\n\t\t\tconst child = children[i];\n\t\t\tconst layout = layouts[i];\n\t\t\tif (layout.isCompatible(child)) {\n\t\t\t\tlayout.update(child, sx, sy, px, py);\n\t\t\t} else {\n\t\t\t\tlayouts.length = i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tfor (let i = layouts.length, imax = children.length; i < imax; ++i) {\n\t\t\tconst child = children[i];\n\t\t\tconst layout = this.newLayout(child, ox, oy);\n\t\t\tlayout.update(child, sx, sy, px, py);\n\t\t\tlayouts.push(layout);\n\t\t}\n\t\tif (layouts.length !== children.length) {\n\t\t\tlayouts.length = children.length;\n\t\t}\n\t}\n\n\tprotected newLayout(shape: EShape, ox: number, oy: number): EShapeLayout {\n\t\treturn shape.layout || new EShapeGroupSizeLayout(shape, ox, oy);\n\t}\n}\n"]}