@wcardinal/wcardinal-ui 0.435.0 → 0.436.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.
@@ -118,13 +118,18 @@ var DDiagramCanvasEditorSnap = /** @class */ (function () {
118
118
  return this._controller.serialize();
119
119
  };
120
120
  DDiagramCanvasEditorSnap.prototype.onResize = function (newWidth, newHeight, oldWidth, oldHeight) {
121
- this._gridParentWidth = newWidth;
122
- this._gridParentHeight = newHeight;
123
- this.updateGridSize();
121
+ if (this._gridParentWidth !== newWidth || this._gridParentHeight !== newHeight) {
122
+ this._gridParentWidth = newWidth;
123
+ this._gridParentHeight = newHeight;
124
+ this._isDirty = true;
125
+ this.updateGridSize();
126
+ }
124
127
  };
125
128
  DDiagramCanvasEditorSnap.prototype.onScale = function (newX, newY, oldX, oldY) {
126
- this._gridParentScale = newX;
127
- this.updateGridSize();
129
+ if (this._gridParentScale !== newX) {
130
+ this._gridParentScale = newX;
131
+ this.updateGridSize();
132
+ }
128
133
  };
129
134
  DDiagramCanvasEditorSnap.prototype.updateGridSize = function () {
130
135
  var gridSize = this.newGridSize();
@@ -1 +1 @@
1
- {"version":3,"file":"d-diagram-canvas-editor-snap.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-diagram-canvas-editor-snap.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAE5D,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAEzE,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAkGnE;IAeC,kCACC,MAAsC,EACtC,KAAoC,EACpC,OAAwC;QAHzC,iBAg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c,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;SAC5C;aAAM;YACN,KAAK,GAAG,IAAI,SAAS,EAAE,CAAC;YACxB,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;YACpC,KAAK,CAAC,MAAM,CAAC,QAAQ,GAAG,QAAQ,CAAC;YACjC,KAAK,CAAC,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;YACnC,KAAK,CAAC,MAAM,CAAC,GAAG,CACf,IAAI,EACJ,KAAK,CAAC,KAAK,EACX,KAAK,CAAC,KAAK,EACX,KAAK,CAAC,KAAK,EACX,SAAS,EACT,SAAS,EACT,KAAK,CAAC,KAAK,CACX,CAAC;YACF,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;YACrB,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC;YACrB,KAAK,CAAC,MAAM,CAAC,cAAc,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;YAC5C,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;SACxB;IACF,CAAC;IACF,+BAAC;AAAD,CAAC,AAhSD,IAgSC","sourcesContent":["/*\n * Copyright (C) 2021 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { Container } from \"pixi.js\";\nimport { DApplications } from \"./d-applications\";\nimport { DDiagramSerializedSnap } from \"./d-diagram-serialized\";\nimport { EShapeContainer } from \"./shape/e-shape-container\";\nimport { EShapeStrokeStyle } from \"./shape/e-shape-stroke-style\";\nimport { EShapeBar } from \"./shape/variant/e-shape-bar\";\nimport { EShapeBarPosition } from \"./shape/variant/e-shape-bar-position\";\nimport { ESnapper } from \"./snapper/e-snapper\";\nimport { ESnapperTargetValueType } from \"./snapper/e-snapper-target-value\";\nimport { EShapeLockPart } from \"./shape/variant/e-shape-lock-part\";\n\nexport interface DDiagramCanvasEditorSnapGridMajorOptions {\n\tinterval?: number;\n\tcolor?: number;\n\talpha?: number;\n\twidth?: number;\n\tstyle?: EShapeStrokeStyle;\n}\n\nexport interface DDiagramCanvasEditorSnapGridMinorOptions {\n\tcolor?: number;\n\talpha?: number;\n\twidth?: number;\n\tstyle?: EShapeStrokeStyle;\n}\n\nexport type DDiagramCanvasEditorSnapGridSize = (\n\tgiven: number,\n\twidth: number,\n\theight: number,\n\tscale: number\n) => number;\n\nexport interface DDiagramCanvasEditorSnapGridOptions {\n\tmajor?: DDiagramCanvasEditorSnapGridMajorOptions;\n\tminor?: DDiagramCanvasEditorSnapGridMinorOptions;\n\tsize?: DDiagramCanvasEditorSnapGridSize;\n\tadaptive?: boolean;\n}\n\nexport interface DDiagramCanvasEditorSnapTargetOptions {\n\tcolor?: number;\n\talpha?: number;\n\twidth?: number;\n\tstyle?: EShapeStrokeStyle;\n}\n\nexport interface DDiagramCanvasEditorSnapOptions {\n\tcontroller: ESnapper;\n\tgrid?: DDiagramCanvasEditorSnapGridOptions;\n\ttarget?: DDiagramCanvasEditorSnapTargetOptions;\n}\n\nexport interface DThemeDiagramCanvasEditorSnap {\n\tgetSnapGridMajorInterval(): number;\n\tgetSnapGridMajorColor(): number;\n\tgetSnapGridMajorAlpha(): number;\n\tgetSnapGridMajorWidth(): number;\n\tgetSnapGridMajorStyle(): EShapeStrokeStyle;\n\n\tgetSnapGridMinorColor(): number;\n\tgetSnapGridMinorAlpha(): number;\n\tgetSnapGridMinorWidth(): number;\n\tgetSnapGridMinorStyle(): EShapeStrokeStyle;\n\n\tgetSnapGridSize(): DDiagramCanvasEditorSnapGridSize;\n\n\tgetSnapTargetColor(): number;\n\tgetSnapTargetAlpha(): number;\n\tgetSnapTargetWidth(): number;\n\tgetSnapTargetStyle(): EShapeStrokeStyle;\n}\n\nexport interface DDiagramCanvasEditorSnapParent extends Container {\n\treadonly width: number;\n\treadonly height: number;\n\ttoDirty(): void;\n}\n\nexport interface DDiagramCanvasEditorSnapGridMajor {\n\tinterval: number;\n\tcolor: number;\n\talpha: number;\n\twidth: number;\n\tstyle: EShapeStrokeStyle;\n}\n\nexport interface DDiagramCanvasEditorSnapGridMinor {\n\tcolor: number;\n\talpha: number;\n\twidth: number;\n\tstyle: EShapeStrokeStyle;\n}\n\nexport interface DDiagramCanvasEditorSnapGrid {\n\tmajor: DDiagramCanvasEditorSnapGridMajor;\n\tminor: DDiagramCanvasEditorSnapGridMinor;\n\tsize: DDiagramCanvasEditorSnapGridSize;\n}\n\nexport interface DDiagramCanvasEditorSnapTarget {\n\tcolor: number;\n\talpha: number;\n\twidth: number;\n\tstyle: EShapeStrokeStyle;\n}\n\nexport class DDiagramCanvasEditorSnap {\n\tprotected _parent: DDiagramCanvasEditorSnapParent;\n\tprotected _controller: ESnapper;\n\tprotected _container: EShapeContainer;\n\n\tprotected _isDirty: boolean;\n\n\tprotected _grid: DDiagramCanvasEditorSnapGrid;\n\tprotected _gridParentWidth: number;\n\tprotected _gridParentHeight: number;\n\tprotected _gridParentScale: number;\n\tprotected _gridSize: number;\n\n\tprotected _target: DDiagramCanvasEditorSnapTarget;\n\n\tconstructor(\n\t\tparent: DDiagramCanvasEditorSnapParent,\n\t\ttheme: DThemeDiagramCanvasEditorSnap,\n\t\toptions: DDiagramCanvasEditorSnapOptions\n\t) {\n\t\tthis._parent = parent;\n\t\tthis._isDirty = true;\n\n\t\t// Controller\n\t\tconst controller = options.controller;\n\t\tthis._controller = controller;\n\t\tconst onChangeBound = (): void => {\n\t\t\tthis.onChange();\n\t\t};\n\t\tcontroller.grid.on(\"change\", onChangeBound);\n\t\tcontroller.target.on(\"change\", onChangeBound);\n\n\t\t// Container\n\t\tconst container = new EShapeContainer();\n\t\tcontainer.visible = false;\n\t\tthis._container = container;\n\t\tparent.addChildAt(container, parent.children.length - 1);\n\n\t\t// Grid\n\t\tthis._grid = this.toGrid(theme, options.grid);\n\t\tthis._gridParentWidth = parent.width;\n\t\tthis._gridParentHeight = parent.height;\n\t\tthis._gridParentScale = parent.scale.x;\n\t\tthis._gridSize = this.newGridSize();\n\n\t\t// Target\n\t\tthis._target = this.toTarget(theme, options.target);\n\t}\n\n\tprotected toGrid(\n\t\ttheme: DThemeDiagramCanvasEditorSnap,\n\t\toptions?: DDiagramCanvasEditorSnapGridOptions\n\t): DDiagramCanvasEditorSnapGrid {\n\t\tif (options != null) {\n\t\t\treturn {\n\t\t\t\tmajor: this.toGridMajor(theme, options.major),\n\t\t\t\tminor: this.toGridMinor(theme, options.minor),\n\t\t\t\tsize: options.size ?? theme.getSnapGridSize()\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\tmajor: this.toGridMajor(theme),\n\t\t\tminor: this.toGridMinor(theme),\n\t\t\tsize: theme.getSnapGridSize()\n\t\t};\n\t}\n\n\tprotected toGridMajor(\n\t\ttheme: DThemeDiagramCanvasEditorSnap,\n\t\toptions?: DDiagramCanvasEditorSnapGridMajorOptions\n\t): DDiagramCanvasEditorSnapGridMajor {\n\t\tif (options != null) {\n\t\t\treturn {\n\t\t\t\tinterval: options.interval ?? theme.getSnapGridMajorInterval(),\n\t\t\t\tcolor: options.color ?? theme.getSnapGridMajorColor(),\n\t\t\t\talpha: options.alpha ?? theme.getSnapGridMajorAlpha(),\n\t\t\t\twidth: options.width ?? theme.getSnapGridMajorWidth(),\n\t\t\t\tstyle: options.style ?? theme.getSnapGridMajorStyle()\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\tinterval: theme.getSnapGridMajorInterval(),\n\t\t\tcolor: theme.getSnapGridMajorColor(),\n\t\t\talpha: theme.getSnapGridMajorAlpha(),\n\t\t\twidth: theme.getSnapGridMajorWidth(),\n\t\t\tstyle: theme.getSnapGridMajorStyle()\n\t\t};\n\t}\n\n\tprotected toGridMinor(\n\t\ttheme: DThemeDiagramCanvasEditorSnap,\n\t\toptions?: DDiagramCanvasEditorSnapGridMinorOptions\n\t): DDiagramCanvasEditorSnapGridMinor {\n\t\tif (options != null) {\n\t\t\treturn {\n\t\t\t\tcolor: options.color ?? theme.getSnapGridMinorColor(),\n\t\t\t\talpha: options.alpha ?? theme.getSnapGridMinorAlpha(),\n\t\t\t\twidth: options.width ?? theme.getSnapGridMinorWidth(),\n\t\t\t\tstyle: options.style ?? theme.getSnapGridMinorStyle()\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\tcolor: theme.getSnapGridMinorColor(),\n\t\t\talpha: theme.getSnapGridMinorAlpha(),\n\t\t\twidth: theme.getSnapGridMinorWidth(),\n\t\t\tstyle: theme.getSnapGridMinorStyle()\n\t\t};\n\t}\n\n\tprotected toTarget(\n\t\ttheme: DThemeDiagramCanvasEditorSnap,\n\t\toptions?: DDiagramCanvasEditorSnapTargetOptions\n\t): DDiagramCanvasEditorSnapTarget {\n\t\tif (options != null) {\n\t\t\treturn {\n\t\t\t\tcolor: options.color ?? theme.getSnapTargetColor(),\n\t\t\t\talpha: options.alpha ?? theme.getSnapTargetAlpha(),\n\t\t\t\twidth: options.width ?? theme.getSnapTargetWidth(),\n\t\t\t\tstyle: options.style ?? theme.getSnapTargetStyle()\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\tcolor: theme.getSnapTargetColor(),\n\t\t\talpha: theme.getSnapTargetAlpha(),\n\t\t\twidth: theme.getSnapTargetWidth(),\n\t\t\tstyle: theme.getSnapTargetStyle()\n\t\t};\n\t}\n\n\tprotected onChange(): void {\n\t\tthis._isDirty = true;\n\t\tDApplications.update(this._parent);\n\t}\n\n\tget container(): EShapeContainer {\n\t\treturn this._container;\n\t}\n\n\tserialize(): DDiagramSerializedSnap {\n\t\treturn this._controller.serialize();\n\t}\n\n\tonResize(newWidth: number, newHeight: number, oldWidth: number, oldHeight: number): void {\n\t\tthis._gridParentWidth = newWidth;\n\t\tthis._gridParentHeight = newHeight;\n\t\tthis.updateGridSize();\n\t}\n\n\tonScale(newX: number, newY: number, oldX: number, oldY: number): void {\n\t\tthis._gridParentScale = newX;\n\t\tthis.updateGridSize();\n\t}\n\n\tprotected updateGridSize(): void {\n\t\tconst gridSize = this.newGridSize();\n\t\tif (this._gridSize !== gridSize) {\n\t\t\tthis._gridSize = gridSize;\n\t\t\tthis._isDirty = true;\n\t\t}\n\t}\n\n\tprotected newGridSize(): number {\n\t\treturn this._grid.size(\n\t\t\tthis._controller.grid.size,\n\t\t\tthis._gridParentWidth,\n\t\t\tthis._gridParentHeight,\n\t\t\tthis._gridParentScale\n\t\t);\n\t}\n\n\tonRender(): void {\n\t\tif (this._isDirty) {\n\t\t\tthis._isDirty = false;\n\t\t\tthis.updateAll();\n\t\t}\n\t}\n\n\tprotected updateAll(): void {\n\t\tconst container = this._container;\n\t\tconst controller = this._controller;\n\n\t\tconst isGridVisible = controller.grid.visible;\n\t\tconst isTargetVisible = controller.target.visible;\n\t\tif (isGridVisible || isTargetVisible) {\n\t\t\tconst w = this._gridParentWidth;\n\t\t\tconst h = this._gridParentHeight;\n\t\t\tconst wh = 0.5 * w;\n\t\t\tconst hh = 0.5 * h;\n\t\t\tconst TOP = EShapeBarPosition.TOP;\n\t\t\tconst LEFT = EShapeBarPosition.LEFT;\n\n\t\t\tconst shapes = container.children as EShapeBar[];\n\t\t\tlet index = 0;\n\n\t\t\t// Grid\n\t\t\tif (isGridVisible) {\n\t\t\t\tconst grid = this._grid;\n\t\t\t\tconst major = grid.major;\n\t\t\t\tconst minor = grid.minor;\n\t\t\t\tconst interval = major.interval;\n\t\t\t\tconst size = this._gridSize;\n\t\t\t\tfor (let x = size, ix = 1; x < w; x += size, ix += 1, index += 1) {\n\t\t\t\t\tconst style = ix % interval === 0 ? major : minor;\n\t\t\t\t\tthis.update(container, shapes, index, x, hh, TOP, w, h, style);\n\t\t\t\t}\n\t\t\t\tfor (let y = size, iy = 1; y < h; y += size, iy += 1, index += 1) {\n\t\t\t\t\tconst style = iy % interval === 0 ? major : minor;\n\t\t\t\t\tthis.update(container, shapes, index, wh, y, LEFT, w, h, style);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Target\n\t\t\tif (isTargetVisible) {\n\t\t\t\tconst values = controller.target.values;\n\t\t\t\tconst target = this._target;\n\t\t\t\tfor (let i = 0, imax = values.length; i < imax; i += 1, index += 1) {\n\t\t\t\t\tconst value = values[i];\n\t\t\t\t\tconst position = value.position;\n\t\t\t\t\tif (value.type === ESnapperTargetValueType.VERTICAL) {\n\t\t\t\t\t\tthis.update(container, shapes, index, position, hh, TOP, w, h, target);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.update(container, shapes, index, wh, position, LEFT, w, h, target);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (let i = index, imax = shapes.length; i < imax; ++i) {\n\t\t\t\tshapes[i].visible = false;\n\t\t\t}\n\n\t\t\tcontainer.visible = true;\n\t\t} else {\n\t\t\tcontainer.visible = false;\n\t\t}\n\t}\n\n\tprotected update(\n\t\tcontainer: EShapeContainer,\n\t\tshapes: EShapeBar[],\n\t\tindex: number,\n\t\tx: number,\n\t\ty: number,\n\t\tposition: EShapeBarPosition,\n\t\tw: number,\n\t\th: number,\n\t\tstyle:\n\t\t\t| DDiagramCanvasEditorSnapGridMajor\n\t\t\t| DDiagramCanvasEditorSnapGridMinor\n\t\t\t| DDiagramCanvasEditorSnapTarget\n\t): void {\n\t\tlet shape = null;\n\t\tif (index < shapes.length) {\n\t\t\tshape = shapes[index];\n\t\t\tshape.lock(EShapeLockPart.UPLOADED);\n\t\t\tshape.points.position = position;\n\t\t\tshape.transform.position.set(x, y);\n\t\t\tshape.stroke.set(\n\t\t\t\ttrue,\n\t\t\t\tstyle.color,\n\t\t\t\tstyle.alpha,\n\t\t\t\tstyle.width,\n\t\t\t\tundefined,\n\t\t\t\tundefined,\n\t\t\t\tstyle.style\n\t\t\t);\n\t\t\tshape.size.set(w, h);\n\t\t\tshape.visible = true;\n\t\t\tshape.unlock(EShapeLockPart.UPLOADED, true);\n\t\t} else {\n\t\t\tshape = new EShapeBar();\n\t\t\tshape.lock(EShapeLockPart.UPLOADED);\n\t\t\tshape.points.position = position;\n\t\t\tshape.transform.position.set(x, y);\n\t\t\tshape.stroke.set(\n\t\t\t\ttrue,\n\t\t\t\tstyle.color,\n\t\t\t\tstyle.alpha,\n\t\t\t\tstyle.width,\n\t\t\t\tundefined,\n\t\t\t\tundefined,\n\t\t\t\tstyle.style\n\t\t\t);\n\t\t\tshape.size.set(w, h);\n\t\t\tshape.visible = true;\n\t\t\tshape.unlock(EShapeLockPart.UPLOADED, true);\n\t\t\tshape.attach(container);\n\t\t}\n\t}\n}\n"]}
1
+ {"version":3,"file":"d-diagram-canvas-editor-snap.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-diagram-canvas-editor-snap.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAE5D,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAEzE,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAkGnE;IAeC,kCACC,MAAsC,EACtC,KAAoC,EACpC,OAAwC;QAHzC,iBAgCC;QA3BA,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QAErB,aAAa;QACb,IAAM,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;QACtC,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;QAC9B,IAAM,aAAa,GAAG;YACrB,KAAI,CAAC,QAAQ,EAAE,CAAC;QACjB,CAAC,CAAC;QACF,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;QAC5C,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC,QAAQ,EAAE,aAAa,CAAC,CA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AK,CAAC,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;YACnC,KAAK,CAAC,MAAM,CAAC,GAAG,CACf,IAAI,EACJ,KAAK,CAAC,KAAK,EACX,KAAK,CAAC,KAAK,EACX,KAAK,CAAC,KAAK,EACX,SAAS,EACT,SAAS,EACT,KAAK,CAAC,KAAK,CACX,CAAC;YACF,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;YACrB,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC;YACrB,KAAK,CAAC,MAAM,CAAC,cAAc,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;YAC5C,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;SACxB;IACF,CAAC;IACF,+BAAC;AAAD,CAAC,AArSD,IAqSC","sourcesContent":["/*\n * Copyright (C) 2021 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { Container } from \"pixi.js\";\nimport { DApplications } from \"./d-applications\";\nimport { DDiagramSerializedSnap } from \"./d-diagram-serialized\";\nimport { EShapeContainer } from \"./shape/e-shape-container\";\nimport { EShapeStrokeStyle } from \"./shape/e-shape-stroke-style\";\nimport { EShapeBar } from \"./shape/variant/e-shape-bar\";\nimport { EShapeBarPosition } from \"./shape/variant/e-shape-bar-position\";\nimport { ESnapper } from \"./snapper/e-snapper\";\nimport { ESnapperTargetValueType } from \"./snapper/e-snapper-target-value\";\nimport { EShapeLockPart } from \"./shape/variant/e-shape-lock-part\";\n\nexport interface DDiagramCanvasEditorSnapGridMajorOptions {\n\tinterval?: number;\n\tcolor?: number;\n\talpha?: number;\n\twidth?: number;\n\tstyle?: EShapeStrokeStyle;\n}\n\nexport interface DDiagramCanvasEditorSnapGridMinorOptions {\n\tcolor?: number;\n\talpha?: number;\n\twidth?: number;\n\tstyle?: EShapeStrokeStyle;\n}\n\nexport type DDiagramCanvasEditorSnapGridSize = (\n\tgiven: number,\n\twidth: number,\n\theight: number,\n\tscale: number\n) => number;\n\nexport interface DDiagramCanvasEditorSnapGridOptions {\n\tmajor?: DDiagramCanvasEditorSnapGridMajorOptions;\n\tminor?: DDiagramCanvasEditorSnapGridMinorOptions;\n\tsize?: DDiagramCanvasEditorSnapGridSize;\n\tadaptive?: boolean;\n}\n\nexport interface DDiagramCanvasEditorSnapTargetOptions {\n\tcolor?: number;\n\talpha?: number;\n\twidth?: number;\n\tstyle?: EShapeStrokeStyle;\n}\n\nexport interface DDiagramCanvasEditorSnapOptions {\n\tcontroller: ESnapper;\n\tgrid?: DDiagramCanvasEditorSnapGridOptions;\n\ttarget?: DDiagramCanvasEditorSnapTargetOptions;\n}\n\nexport interface DThemeDiagramCanvasEditorSnap {\n\tgetSnapGridMajorInterval(): number;\n\tgetSnapGridMajorColor(): number;\n\tgetSnapGridMajorAlpha(): number;\n\tgetSnapGridMajorWidth(): number;\n\tgetSnapGridMajorStyle(): EShapeStrokeStyle;\n\n\tgetSnapGridMinorColor(): number;\n\tgetSnapGridMinorAlpha(): number;\n\tgetSnapGridMinorWidth(): number;\n\tgetSnapGridMinorStyle(): EShapeStrokeStyle;\n\n\tgetSnapGridSize(): DDiagramCanvasEditorSnapGridSize;\n\n\tgetSnapTargetColor(): number;\n\tgetSnapTargetAlpha(): number;\n\tgetSnapTargetWidth(): number;\n\tgetSnapTargetStyle(): EShapeStrokeStyle;\n}\n\nexport interface DDiagramCanvasEditorSnapParent extends Container {\n\treadonly width: number;\n\treadonly height: number;\n\ttoDirty(): void;\n}\n\nexport interface DDiagramCanvasEditorSnapGridMajor {\n\tinterval: number;\n\tcolor: number;\n\talpha: number;\n\twidth: number;\n\tstyle: EShapeStrokeStyle;\n}\n\nexport interface DDiagramCanvasEditorSnapGridMinor {\n\tcolor: number;\n\talpha: number;\n\twidth: number;\n\tstyle: EShapeStrokeStyle;\n}\n\nexport interface DDiagramCanvasEditorSnapGrid {\n\tmajor: DDiagramCanvasEditorSnapGridMajor;\n\tminor: DDiagramCanvasEditorSnapGridMinor;\n\tsize: DDiagramCanvasEditorSnapGridSize;\n}\n\nexport interface DDiagramCanvasEditorSnapTarget {\n\tcolor: number;\n\talpha: number;\n\twidth: number;\n\tstyle: EShapeStrokeStyle;\n}\n\nexport class DDiagramCanvasEditorSnap {\n\tprotected _parent: DDiagramCanvasEditorSnapParent;\n\tprotected _controller: ESnapper;\n\tprotected _container: EShapeContainer;\n\n\tprotected _isDirty: boolean;\n\n\tprotected _grid: DDiagramCanvasEditorSnapGrid;\n\tprotected _gridParentWidth: number;\n\tprotected _gridParentHeight: number;\n\tprotected _gridParentScale: number;\n\tprotected _gridSize: number;\n\n\tprotected _target: DDiagramCanvasEditorSnapTarget;\n\n\tconstructor(\n\t\tparent: DDiagramCanvasEditorSnapParent,\n\t\ttheme: DThemeDiagramCanvasEditorSnap,\n\t\toptions: DDiagramCanvasEditorSnapOptions\n\t) {\n\t\tthis._parent = parent;\n\t\tthis._isDirty = true;\n\n\t\t// Controller\n\t\tconst controller = options.controller;\n\t\tthis._controller = controller;\n\t\tconst onChangeBound = (): void => {\n\t\t\tthis.onChange();\n\t\t};\n\t\tcontroller.grid.on(\"change\", onChangeBound);\n\t\tcontroller.target.on(\"change\", onChangeBound);\n\n\t\t// Container\n\t\tconst container = new EShapeContainer();\n\t\tcontainer.visible = false;\n\t\tthis._container = container;\n\t\tparent.addChildAt(container, parent.children.length - 1);\n\n\t\t// Grid\n\t\tthis._grid = this.toGrid(theme, options.grid);\n\t\tthis._gridParentWidth = parent.width;\n\t\tthis._gridParentHeight = parent.height;\n\t\tthis._gridParentScale = parent.scale.x;\n\t\tthis._gridSize = this.newGridSize();\n\n\t\t// Target\n\t\tthis._target = this.toTarget(theme, options.target);\n\t}\n\n\tprotected toGrid(\n\t\ttheme: DThemeDiagramCanvasEditorSnap,\n\t\toptions?: DDiagramCanvasEditorSnapGridOptions\n\t): DDiagramCanvasEditorSnapGrid {\n\t\tif (options != null) {\n\t\t\treturn {\n\t\t\t\tmajor: this.toGridMajor(theme, options.major),\n\t\t\t\tminor: this.toGridMinor(theme, options.minor),\n\t\t\t\tsize: options.size ?? theme.getSnapGridSize()\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\tmajor: this.toGridMajor(theme),\n\t\t\tminor: this.toGridMinor(theme),\n\t\t\tsize: theme.getSnapGridSize()\n\t\t};\n\t}\n\n\tprotected toGridMajor(\n\t\ttheme: DThemeDiagramCanvasEditorSnap,\n\t\toptions?: DDiagramCanvasEditorSnapGridMajorOptions\n\t): DDiagramCanvasEditorSnapGridMajor {\n\t\tif (options != null) {\n\t\t\treturn {\n\t\t\t\tinterval: options.interval ?? theme.getSnapGridMajorInterval(),\n\t\t\t\tcolor: options.color ?? theme.getSnapGridMajorColor(),\n\t\t\t\talpha: options.alpha ?? theme.getSnapGridMajorAlpha(),\n\t\t\t\twidth: options.width ?? theme.getSnapGridMajorWidth(),\n\t\t\t\tstyle: options.style ?? theme.getSnapGridMajorStyle()\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\tinterval: theme.getSnapGridMajorInterval(),\n\t\t\tcolor: theme.getSnapGridMajorColor(),\n\t\t\talpha: theme.getSnapGridMajorAlpha(),\n\t\t\twidth: theme.getSnapGridMajorWidth(),\n\t\t\tstyle: theme.getSnapGridMajorStyle()\n\t\t};\n\t}\n\n\tprotected toGridMinor(\n\t\ttheme: DThemeDiagramCanvasEditorSnap,\n\t\toptions?: DDiagramCanvasEditorSnapGridMinorOptions\n\t): DDiagramCanvasEditorSnapGridMinor {\n\t\tif (options != null) {\n\t\t\treturn {\n\t\t\t\tcolor: options.color ?? theme.getSnapGridMinorColor(),\n\t\t\t\talpha: options.alpha ?? theme.getSnapGridMinorAlpha(),\n\t\t\t\twidth: options.width ?? theme.getSnapGridMinorWidth(),\n\t\t\t\tstyle: options.style ?? theme.getSnapGridMinorStyle()\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\tcolor: theme.getSnapGridMinorColor(),\n\t\t\talpha: theme.getSnapGridMinorAlpha(),\n\t\t\twidth: theme.getSnapGridMinorWidth(),\n\t\t\tstyle: theme.getSnapGridMinorStyle()\n\t\t};\n\t}\n\n\tprotected toTarget(\n\t\ttheme: DThemeDiagramCanvasEditorSnap,\n\t\toptions?: DDiagramCanvasEditorSnapTargetOptions\n\t): DDiagramCanvasEditorSnapTarget {\n\t\tif (options != null) {\n\t\t\treturn {\n\t\t\t\tcolor: options.color ?? theme.getSnapTargetColor(),\n\t\t\t\talpha: options.alpha ?? theme.getSnapTargetAlpha(),\n\t\t\t\twidth: options.width ?? theme.getSnapTargetWidth(),\n\t\t\t\tstyle: options.style ?? theme.getSnapTargetStyle()\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\tcolor: theme.getSnapTargetColor(),\n\t\t\talpha: theme.getSnapTargetAlpha(),\n\t\t\twidth: theme.getSnapTargetWidth(),\n\t\t\tstyle: theme.getSnapTargetStyle()\n\t\t};\n\t}\n\n\tprotected onChange(): void {\n\t\tthis._isDirty = true;\n\t\tDApplications.update(this._parent);\n\t}\n\n\tget container(): EShapeContainer {\n\t\treturn this._container;\n\t}\n\n\tserialize(): DDiagramSerializedSnap {\n\t\treturn this._controller.serialize();\n\t}\n\n\tonResize(newWidth: number, newHeight: number, oldWidth: number, oldHeight: number): void {\n\t\tif (this._gridParentWidth !== newWidth || this._gridParentHeight !== newHeight) {\n\t\t\tthis._gridParentWidth = newWidth;\n\t\t\tthis._gridParentHeight = newHeight;\n\t\t\tthis._isDirty = true;\n\t\t\tthis.updateGridSize();\n\t\t}\n\t}\n\n\tonScale(newX: number, newY: number, oldX: number, oldY: number): void {\n\t\tif (this._gridParentScale !== newX) {\n\t\t\tthis._gridParentScale = newX;\n\t\t\tthis.updateGridSize();\n\t\t}\n\t}\n\n\tprotected updateGridSize(): void {\n\t\tconst gridSize = this.newGridSize();\n\t\tif (this._gridSize !== gridSize) {\n\t\t\tthis._gridSize = gridSize;\n\t\t\tthis._isDirty = true;\n\t\t}\n\t}\n\n\tprotected newGridSize(): number {\n\t\treturn this._grid.size(\n\t\t\tthis._controller.grid.size,\n\t\t\tthis._gridParentWidth,\n\t\t\tthis._gridParentHeight,\n\t\t\tthis._gridParentScale\n\t\t);\n\t}\n\n\tonRender(): void {\n\t\tif (this._isDirty) {\n\t\t\tthis._isDirty = false;\n\t\t\tthis.updateAll();\n\t\t}\n\t}\n\n\tprotected updateAll(): void {\n\t\tconst container = this._container;\n\t\tconst controller = this._controller;\n\n\t\tconst isGridVisible = controller.grid.visible;\n\t\tconst isTargetVisible = controller.target.visible;\n\t\tif (isGridVisible || isTargetVisible) {\n\t\t\tconst w = this._gridParentWidth;\n\t\t\tconst h = this._gridParentHeight;\n\t\t\tconst wh = 0.5 * w;\n\t\t\tconst hh = 0.5 * h;\n\t\t\tconst TOP = EShapeBarPosition.TOP;\n\t\t\tconst LEFT = EShapeBarPosition.LEFT;\n\n\t\t\tconst shapes = container.children as EShapeBar[];\n\t\t\tlet index = 0;\n\n\t\t\t// Grid\n\t\t\tif (isGridVisible) {\n\t\t\t\tconst grid = this._grid;\n\t\t\t\tconst major = grid.major;\n\t\t\t\tconst minor = grid.minor;\n\t\t\t\tconst interval = major.interval;\n\t\t\t\tconst size = this._gridSize;\n\t\t\t\tfor (let x = size, ix = 1; x < w; x += size, ix += 1, index += 1) {\n\t\t\t\t\tconst style = ix % interval === 0 ? major : minor;\n\t\t\t\t\tthis.update(container, shapes, index, x, hh, TOP, w, h, style);\n\t\t\t\t}\n\t\t\t\tfor (let y = size, iy = 1; y < h; y += size, iy += 1, index += 1) {\n\t\t\t\t\tconst style = iy % interval === 0 ? major : minor;\n\t\t\t\t\tthis.update(container, shapes, index, wh, y, LEFT, w, h, style);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Target\n\t\t\tif (isTargetVisible) {\n\t\t\t\tconst values = controller.target.values;\n\t\t\t\tconst target = this._target;\n\t\t\t\tfor (let i = 0, imax = values.length; i < imax; i += 1, index += 1) {\n\t\t\t\t\tconst value = values[i];\n\t\t\t\t\tconst position = value.position;\n\t\t\t\t\tif (value.type === ESnapperTargetValueType.VERTICAL) {\n\t\t\t\t\t\tthis.update(container, shapes, index, position, hh, TOP, w, h, target);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.update(container, shapes, index, wh, position, LEFT, w, h, target);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (let i = index, imax = shapes.length; i < imax; ++i) {\n\t\t\t\tshapes[i].visible = false;\n\t\t\t}\n\n\t\t\tcontainer.visible = true;\n\t\t} else {\n\t\t\tcontainer.visible = false;\n\t\t}\n\t}\n\n\tprotected update(\n\t\tcontainer: EShapeContainer,\n\t\tshapes: EShapeBar[],\n\t\tindex: number,\n\t\tx: number,\n\t\ty: number,\n\t\tposition: EShapeBarPosition,\n\t\tw: number,\n\t\th: number,\n\t\tstyle:\n\t\t\t| DDiagramCanvasEditorSnapGridMajor\n\t\t\t| DDiagramCanvasEditorSnapGridMinor\n\t\t\t| DDiagramCanvasEditorSnapTarget\n\t): void {\n\t\tlet shape = null;\n\t\tif (index < shapes.length) {\n\t\t\tshape = shapes[index];\n\t\t\tshape.lock(EShapeLockPart.UPLOADED);\n\t\t\tshape.points.position = position;\n\t\t\tshape.transform.position.set(x, y);\n\t\t\tshape.stroke.set(\n\t\t\t\ttrue,\n\t\t\t\tstyle.color,\n\t\t\t\tstyle.alpha,\n\t\t\t\tstyle.width,\n\t\t\t\tundefined,\n\t\t\t\tundefined,\n\t\t\t\tstyle.style\n\t\t\t);\n\t\t\tshape.size.set(w, h);\n\t\t\tshape.visible = true;\n\t\t\tshape.unlock(EShapeLockPart.UPLOADED, true);\n\t\t} else {\n\t\t\tshape = new EShapeBar();\n\t\t\tshape.lock(EShapeLockPart.UPLOADED);\n\t\t\tshape.points.position = position;\n\t\t\tshape.transform.position.set(x, y);\n\t\t\tshape.stroke.set(\n\t\t\t\ttrue,\n\t\t\t\tstyle.color,\n\t\t\t\tstyle.alpha,\n\t\t\t\tstyle.width,\n\t\t\t\tundefined,\n\t\t\t\tundefined,\n\t\t\t\tstyle.style\n\t\t\t);\n\t\t\tshape.size.set(w, h);\n\t\t\tshape.visible = true;\n\t\t\tshape.unlock(EShapeLockPart.UPLOADED, true);\n\t\t\tshape.attach(container);\n\t\t}\n\t}\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.435.0
2
+ Winter Cardinal UI v0.436.0
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.435.0
2
+ Winter Cardinal UI v0.436.0
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.435.0
2
+ Winter Cardinal UI v0.436.0
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.435.0
2
+ Winter Cardinal UI v0.436.0
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.435.0
2
+ Winter Cardinal UI v0.436.0
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.435.0
2
+ Winter Cardinal UI v0.436.0
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.435.0
2
+ Winter Cardinal UI v0.436.0
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.435.0
2
+ Winter Cardinal UI v0.436.0
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.435.0
2
+ Winter Cardinal UI v0.436.0
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.435.0
2
+ Winter Cardinal UI v0.436.0
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.435.0
2
+ Winter Cardinal UI v0.436.0
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.435.0
2
+ Winter Cardinal UI v0.436.0
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.435.0
2
+ Winter Cardinal UI v0.436.0
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -87488,13 +87488,18 @@ var DDiagramCanvasEditorSnap = /** @class */ (function () {
87488
87488
  return this._controller.serialize();
87489
87489
  };
87490
87490
  DDiagramCanvasEditorSnap.prototype.onResize = function (newWidth, newHeight, oldWidth, oldHeight) {
87491
- this._gridParentWidth = newWidth;
87492
- this._gridParentHeight = newHeight;
87493
- this.updateGridSize();
87491
+ if (this._gridParentWidth !== newWidth || this._gridParentHeight !== newHeight) {
87492
+ this._gridParentWidth = newWidth;
87493
+ this._gridParentHeight = newHeight;
87494
+ this._isDirty = true;
87495
+ this.updateGridSize();
87496
+ }
87494
87497
  };
87495
87498
  DDiagramCanvasEditorSnap.prototype.onScale = function (newX, newY, oldX, oldY) {
87496
- this._gridParentScale = newX;
87497
- this.updateGridSize();
87499
+ if (this._gridParentScale !== newX) {
87500
+ this._gridParentScale = newX;
87501
+ this.updateGridSize();
87502
+ }
87498
87503
  };
87499
87504
  DDiagramCanvasEditorSnap.prototype.updateGridSize = function () {
87500
87505
  var gridSize = this.newGridSize();
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.435.0
2
+ Winter Cardinal UI v0.436.0
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -66247,13 +66247,18 @@
66247
66247
  return this._controller.serialize();
66248
66248
  };
66249
66249
  DDiagramCanvasEditorSnap.prototype.onResize = function (newWidth, newHeight, oldWidth, oldHeight) {
66250
- this._gridParentWidth = newWidth;
66251
- this._gridParentHeight = newHeight;
66252
- this.updateGridSize();
66250
+ if (this._gridParentWidth !== newWidth || this._gridParentHeight !== newHeight) {
66251
+ this._gridParentWidth = newWidth;
66252
+ this._gridParentHeight = newHeight;
66253
+ this._isDirty = true;
66254
+ this.updateGridSize();
66255
+ }
66253
66256
  };
66254
66257
  DDiagramCanvasEditorSnap.prototype.onScale = function (newX, newY, oldX, oldY) {
66255
- this._gridParentScale = newX;
66256
- this.updateGridSize();
66258
+ if (this._gridParentScale !== newX) {
66259
+ this._gridParentScale = newX;
66260
+ this.updateGridSize();
66261
+ }
66257
66262
  };
66258
66263
  DDiagramCanvasEditorSnap.prototype.updateGridSize = function () {
66259
66264
  var gridSize = this.newGridSize();