@wcardinal/wcardinal-ui 0.443.0 → 0.445.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.
- package/dist/types/wcardinal/ui/util/index.d.ts +1 -0
- package/dist/types/wcardinal/ui/util/util-extract.d.ts +13 -2
- package/dist/types/wcardinal/ui/util/util-extractor-canvas.d.ts +18 -0
- package/dist/types/wcardinal/ui/util/util-extractor.d.ts +3 -2
- package/dist/wcardinal/ui/shape/variant/e-shape-base.js +1 -0
- package/dist/wcardinal/ui/shape/variant/e-shape-base.js.map +1 -1
- package/dist/wcardinal/ui/util/index.js +1 -0
- package/dist/wcardinal/ui/util/index.js.map +1 -1
- package/dist/wcardinal/ui/util/util-extract.js +34 -10
- package/dist/wcardinal/ui/util/util-extract.js.map +1 -1
- package/dist/wcardinal/ui/util/util-extractor-canvas.js +110 -0
- package/dist/wcardinal/ui/util/util-extractor-canvas.js.map +1 -0
- package/dist/wcardinal/ui/util/util-extractor.js +45 -20
- package/dist/wcardinal/ui/util/util-extractor.js.map +1 -1
- package/dist/wcardinal-ui-theme-dark-en-us.js +1 -1
- package/dist/wcardinal-ui-theme-dark-en-us.min.js +1 -1
- package/dist/wcardinal-ui-theme-dark-ja-jp.js +1 -1
- package/dist/wcardinal-ui-theme-dark-ja-jp.min.js +1 -1
- package/dist/wcardinal-ui-theme-dark.js +1 -1
- package/dist/wcardinal-ui-theme-dark.min.js +1 -1
- package/dist/wcardinal-ui-theme-white-en-us.js +1 -1
- package/dist/wcardinal-ui-theme-white-en-us.min.js +1 -1
- package/dist/wcardinal-ui-theme-white-ja-jp.js +1 -1
- package/dist/wcardinal-ui-theme-white-ja-jp.min.js +1 -1
- package/dist/wcardinal-ui-theme-white.js +1 -1
- package/dist/wcardinal-ui-theme-white.min.js +1 -1
- package/dist/wcardinal-ui.cjs.js +188 -30
- package/dist/wcardinal-ui.js +188 -30
- package/dist/wcardinal-ui.min.js +2 -2
- package/dist/wcardinal-ui.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -57,6 +57,7 @@ export * from "./util-gesture-tap";
|
|
|
57
57
|
export * from "./util-gesture-target";
|
|
58
58
|
export * from "./util-gesture";
|
|
59
59
|
export * from "./util-extract";
|
|
60
|
+
export * from "./util-extractor-canvas";
|
|
60
61
|
export * from "./util-extractor-pixels";
|
|
61
62
|
export * from "./util-extractor";
|
|
62
63
|
export * from "./util-file-downloader";
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { Renderer, RenderTexture
|
|
1
|
+
import { Renderer, RenderTexture } from "pixi.js";
|
|
2
2
|
import { DApplicationLayerLike } from "../d-application-layer-like";
|
|
3
3
|
import { DApplicationLike } from "../d-application-like";
|
|
4
4
|
import { DBase } from "../d-base";
|
|
5
5
|
import { UtilExtractorPixels } from "./util-extractor-pixels";
|
|
6
|
+
import { UtilExtractorCanvas } from "./util-extractor-canvas";
|
|
6
7
|
export interface UtilExtractTextureResolutionOptions {
|
|
7
8
|
size: number;
|
|
8
9
|
}
|
|
@@ -41,6 +42,7 @@ export interface UtilExtractFileOptions extends UtilExtractBase64Options {
|
|
|
41
42
|
}
|
|
42
43
|
export declare class UtilExtract {
|
|
43
44
|
protected static WORK_RENDER_TEXTURE?: RenderTexture;
|
|
45
|
+
protected static WORK_CANVAS?: UtilExtractorCanvas;
|
|
44
46
|
static texture(options: UtilExtractTextureOptions): RenderTexture;
|
|
45
47
|
/**
|
|
46
48
|
* Extracts pixels from the target.
|
|
@@ -51,7 +53,16 @@ export declare class UtilExtract {
|
|
|
51
53
|
* @returns extracted pixels
|
|
52
54
|
*/
|
|
53
55
|
static pixels(options: UtilExtractPixelsOptions): UtilExtractorPixels;
|
|
54
|
-
static canvas(options: UtilExtractCanvasOptions):
|
|
56
|
+
static canvas(options: UtilExtractCanvasOptions): UtilExtractorCanvas;
|
|
57
|
+
/**
|
|
58
|
+
* Extracts Base64 data URL from the target.
|
|
59
|
+
* This method internally creates a render texture and a canvas render target.
|
|
60
|
+
* They are used to extract pixels from the target.
|
|
61
|
+
* To free the allocated render texture and canvas render target, please call {@link destroy()}.
|
|
62
|
+
*
|
|
63
|
+
* @param options an extraction options
|
|
64
|
+
* @returns extracted Base64 data URL
|
|
65
|
+
*/
|
|
55
66
|
static base64(options: UtilExtractBase64Options): string;
|
|
56
67
|
static file(options: UtilExtractFileOptions): void;
|
|
57
68
|
/**
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare class UtilExtractorCanvas {
|
|
2
|
+
protected _element: HTMLCanvasElement | null;
|
|
3
|
+
protected _context: CanvasRenderingContext2D | null;
|
|
4
|
+
constructor(width: number, height: number);
|
|
5
|
+
get element(): HTMLCanvasElement;
|
|
6
|
+
getElement(): HTMLCanvasElement | null;
|
|
7
|
+
get canvas(): HTMLCanvasElement;
|
|
8
|
+
get context(): CanvasRenderingContext2D;
|
|
9
|
+
getContext(): CanvasRenderingContext2D | null;
|
|
10
|
+
get resolution(): number;
|
|
11
|
+
get width(): number;
|
|
12
|
+
set width(width: number);
|
|
13
|
+
get height(): number;
|
|
14
|
+
set height(height: number);
|
|
15
|
+
clear(): void;
|
|
16
|
+
resize(width: number, height: number): void;
|
|
17
|
+
destroy(): void;
|
|
18
|
+
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { Renderer, RenderTexture
|
|
1
|
+
import { Renderer, RenderTexture } from "pixi.js";
|
|
2
2
|
import { DBase } from "../d-base";
|
|
3
3
|
import { UtilExtractorPixels } from "./util-extractor-pixels";
|
|
4
|
+
import { UtilExtractorCanvas } from "./util-extractor-canvas";
|
|
4
5
|
export declare class UtilExtractor {
|
|
5
6
|
static toTexture(target: DBase, resolution?: number, clear?: boolean, skipUpdateTransform?: boolean): RenderTexture;
|
|
6
7
|
static toPixels(renderTexture: RenderTexture, renderer: Renderer): UtilExtractorPixels;
|
|
7
|
-
static toCanvas(pixels: UtilExtractorPixels, scale?: number, ignorePremutipliedAlpha?: boolean):
|
|
8
|
+
static toCanvas(pixels: UtilExtractorPixels, scale?: number, ignorePremutipliedAlpha?: boolean, result?: UtilExtractorCanvas): UtilExtractorCanvas;
|
|
8
9
|
static toBase64(canvas: HTMLCanvasElement, format?: string, quality?: number): string;
|
|
9
10
|
}
|
|
@@ -731,6 +731,7 @@ var EShapeBase = /** @class */ (function (_super) {
|
|
|
731
731
|
if (part & EShapeCopyPart.ACTION) {
|
|
732
732
|
this.action.clearAndAddAll(source.action.values);
|
|
733
733
|
this.interactive = source.interactive;
|
|
734
|
+
this.title = source.title;
|
|
734
735
|
this.cursor = source.cursor;
|
|
735
736
|
this.shortcut = source.shortcut;
|
|
736
737
|
}
|
|
@@ -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;AAIxD,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;AAE9C,OAAO,EAAE,6BAA6B,EAAE,MAAM,sCAAsC,CAAC;AACrF,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,UAAU,E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K,EAAE,CAAC;iBACnB;aACD;SACD;QACD,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QACtC,OAAO,IAAI,CAAC;IACb,CAAC;IACF,iBAAC;AAAD,CAAC,AA93BD,CAAyC,KAAK,CAAC,YAAY,GA83B1D","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 { EShapeImageLike } from \"../e-shape-image-like\";\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 { 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\tabstract image?: EShapeImageLike;\n\ttexture?: Texture;\n\tabstract gradient?: EShapeGradientLike;\n\tabstract readonly text: EShapeText;\n\t/** @deprecated in favor of {@link data} */\n\tabstract readonly tag: EShapeData;\n\tabstract readonly data: EShapeData;\n\treadonly action: EShapeAction;\n\tcursor?: string;\n\tinteractive: boolean;\n\tshortcut?: string;\n\ttitle?: string;\n\n\tprotected _connector?: EShapeConnectorContainer;\n\n\tprotected _visible: boolean;\n\n\tprotected _lockTransformChild: EShapeLock;\n\tprotected _lockTransformThis: EShapeLock;\n\tprotected _lockTransformParent: EShapeLock;\n\tprotected _lockUploaded: EShapeLock;\n\n\tprotected _bounds?: Rectangle;\n\tprotected _boundsTransformId: number;\n\tprotected _boundsInternal?: Rectangle;\n\tprotected _boundsInternalTransformId: number;\n\tprotected _boundsLocal?: Rectangle;\n\tprotected _boundsLocalTransformId: number;\n\n\tprotected _state?: EShapeStateSet;\n\tprotected _capability?: EShapeCapabilityContainer;\n\n\t// Hierarchy\n\tparent: EShapeContainer | EShape | null;\n\tchildren: EShape[];\n\tlayout?: EShapeLayout;\n\n\t// Working space\n\tindex: number; // A work space for sorting.\n\tselected: boolean;\n\treference: number; // Count of references from commands\n\n\t// Working space for the viewer\n\truntime?: EShapeRuntime;\n\n\t// Working space for the editor\n\teditor?: EShapeEditor;\n\n\t// Working space for the renderer\n\tuploaded?: EShapeUploaded;\n\n\tconstructor(type: EShapeType) {\n\t\tsuper();\n\t\tthis.id = \"\";\n\t\tthis.uuid = 0;\n\t\tthis.type = type;\n\t\tthis.transform = this.newTransform();\n\t\tthis.action = new EShapeAction();\n\t\tthis._visible = true;\n\n\t\tthis._lockTransformChild = new EShapeLock();\n\t\tthis._lockTransformThis = new EShapeLock();\n\t\tthis._lockTransformParent = new EShapeLock();\n\t\tthis._lockUploaded = new EShapeLock();\n\n\t\tthis._boundsTransformId = -1;\n\t\tthis._boundsInternalTransformId = -1;\n\t\tthis._boundsLocalTransformId = -1;\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 = -1;\n\t\tthis._boundsInternalTransformId = -1;\n\t\tthis._boundsLocalTransformId = -1;\n\n\t\tif (!this._lockTransformChild.isLocked()) {\n\t\t\tthis.callChildTransformChange();\n\t\t}\n\t\tconst points = this._points;\n\t\tif (points != null) {\n\t\t\tpoints.onSizeChange();\n\t\t}\n\t\tthis.updateUploaded();\n\n\t\tconst connector = this._connector;\n\t\tif (connector != null) {\n\t\t\tconnector.fit(true);\n\t\t}\n\n\t\tconst runtime = this.runtime;\n\t\tif (runtime != null) {\n\t\t\truntime.onResize(this);\n\t\t}\n\t}\n\n\tonTransformChange(): void {\n\t\tif (!this._lockTransformChild.isLocked()) {\n\t\t\tthis.callChildTransformChange();\n\t\t}\n\t\tif (!this._lockTransformThis.isLocked()) {\n\t\t\tthis.onThisTransformChange();\n\t\t}\n\t\tif (!this._lockTransformParent.isLocked()) {\n\t\t\tthis.callParentTransformChange();\n\t\t}\n\t}\n\n\tprotected callChildTransformChange(): void {\n\t\tconst parent = this.parent;\n\t\tif (parent != null) {\n\t\t\tparent.onChildTransformChange();\n\t\t}\n\t}\n\n\tprotected onThisTransformChange(): void {\n\t\tthis.updateUploaded();\n\t\tconst connector = this._connector;\n\t\tif (connector != null) {\n\t\t\tconnector.fit(true);\n\t\t}\n\t}\n\n\tprotected callParentTransformChange(): void {\n\t\tconst children = this.children;\n\t\tfor (let i = 0, imax = children.length; i < imax; ++i) {\n\t\t\tchildren[i].onParentTransformChange();\n\t\t}\n\t}\n\n\tonParentTransformChange(): void {\n\t\tif (!this._lockTransformThis.isLocked()) {\n\t\t\tthis.onThisTransformChange();\n\t\t}\n\t\tif (!this._lockTransformParent.isLocked()) {\n\t\t\tthis.callParentTransformChange();\n\t\t}\n\t}\n\n\tlock(part: EShapeLockPart): this {\n\t\tif (part & EShapeLockPart.UPLOADED) {\n\t\t\tthis._lockUploaded.lock();\n\t\t}\n\t\tif (part & EShapeLockPart.TRANSFORM_PARENT) {\n\t\t\tthis._lockTransformParent.lock();\n\t\t}\n\t\tif (part & EShapeLockPart.TRANSFORM_THIS) {\n\t\t\tthis._lockTransformThis.lock();\n\t\t}\n\t\tif (part & EShapeLockPart.TRANSFORM_CHILD) {\n\t\t\tthis._lockTransformChild.lock();\n\t\t}\n\t\treturn this;\n\t}\n\n\tunlock(part: EShapeLockPart, invoke: boolean): this {\n\t\tif (part & EShapeLockPart.TRANSFORM_CHILD) {\n\t\t\tif (this._lockTransformChild.unlock() && invoke) {\n\t\t\t\tconst parent = this.parent;\n\t\t\t\tif (parent != null) {\n\t\t\t\t\tparent.onChildTransformChange();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (part & EShapeLockPart.TRANSFORM_THIS) {\n\t\t\tif (this._lockTransformThis.unlock() && invoke) {\n\t\t\t\tthis.onThisTransformChange();\n\t\t\t}\n\t\t}\n\t\tif (part & EShapeLockPart.TRANSFORM_PARENT) {\n\t\t\tif (this._lockTransformParent.unlock() && invoke) {\n\t\t\t\tconst children = this.children;\n\t\t\t\tfor (let i = 0, imax = children.length; i < imax; ++i) {\n\t\t\t\t\tchildren[i].onParentTransformChange();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (part & EShapeLockPart.UPLOADED) {\n\t\t\tconst lockUploaded = this._lockUploaded;\n\t\t\tif (lockUploaded.unlock() && invoke) {\n\t\t\t\tthis.updateUploaded(lockUploaded.isHigh());\n\t\t\t}\n\t\t}\n\t\treturn this;\n\t}\n\n\tonChildTransformChange(): void {\n\t\t//\n\t}\n\n\tupdateUploaded(recursively?: boolean): void {\n\t\tif (this._lockUploaded.isLocked(recursively)) {\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 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\tabstract serializeImage(manager: EShapeResourceManagerSerialization): number;\n\n\tabstract serializeGradient(manager: EShapeResourceManagerSerialization): number;\n\n\tserializeState(manager: EShapeResourceManagerSerialization): number {\n\t\tconst state = this.state;\n\t\treturn (this.interactive ? 1 : 0) | (state.isFocusable ? 0 : 2) | (state.isActive ? 4 : 0);\n\t}\n\n\tserialize(manager: EShapeResourceManagerSerialization): DDiagramSerializedItem {\n\t\tconst transform = this.transform;\n\t\tconst position = transform.position;\n\t\tconst pivot = transform.pivot;\n\t\tconst size = this.size;\n\t\tconst shortcut = this.shortcut;\n\t\tconst shortcutId = shortcut != null ? manager.addResource(shortcut) : -1;\n\t\tconst cursor = this.cursor;\n\t\tconst cursorId = cursor != null ? manager.addResource(cursor) : -1;\n\t\tconst title = this.title;\n\t\tconst titleId = title != null ? manager.addResource(title) : -1;\n\t\tlet capabilitiesAdded: EShapeCapability = EShapeCapability.NONE;\n\t\tlet capabilitiesRemoved: EShapeCapability = EShapeCapability.NONE;\n\t\tlet capabilitiesLocked: EShapeCapability = EShapeCapability.NONE;\n\t\tconst capability = this._capability;\n\t\tif (capability != null) {\n\t\t\tcapabilitiesAdded = capability.added;\n\t\t\tcapabilitiesRemoved = capability.removed;\n\t\t\tcapabilitiesLocked = capability.locked;\n\t\t}\n\t\treturn [\n\t\t\tthis.type,\n\t\t\tmanager.addResource(this.id),\n\t\t\tposition.x,\n\t\t\tposition.y,\n\t\t\tsize.x,\n\t\t\tsize.y,\n\t\t\ttransform.rotation,\n\t\t\ttransform.skew.x,\n\t\t\tthis.fill.serialize(manager),\n\t\t\tthis.stroke.serialize(manager),\n\t\t\tcursorId,\n\t\t\tthis.text.serialize(manager),\n\t\t\tthis.data.serialize(manager),\n\t\t\tthis.radius,\n\t\t\tthis.corner,\n\t\t\t-1,\n\t\t\t-1,\n\t\t\tthis.action.serialize(manager),\n\t\t\tthis.serializeImage(manager),\n\t\t\tthis.serializeGradient(manager),\n\t\t\tthis.serializeChildren(manager),\n\t\t\tpivot.x,\n\t\t\tpivot.y,\n\t\t\tthis.serializeState(manager),\n\t\t\tshortcutId,\n\t\t\ttitleId,\n\t\t\tthis.uuid,\n\t\t\tcapabilitiesAdded,\n\t\t\tcapabilitiesRemoved,\n\t\t\tcapabilitiesLocked\n\t\t];\n\t}\n\n\taddUuid(manager: EShapeResourceManagerSerialization): void {\n\t\tthis.uuid = manager.addUuid(this.uuid);\n\t\tconst children = this.children;\n\t\tfor (let i = 0, imax = children.length; i < imax; ++i) {\n\t\t\tchildren[i].addUuid(manager);\n\t\t}\n\t}\n\n\tupdateUuid(manager: EShapeResourceManagerSerialization): void {\n\t\tthis.uuid = manager.updateUuid(this.uuid);\n\t\tconst children = this.children;\n\t\tfor (let i = 0, imax = children.length; i < imax; ++i) {\n\t\t\tchildren[i].updateUuid(manager);\n\t\t}\n\t}\n\n\t// Hit test\n\tprotected getShapeScale(): number {\n\t\tconst container = this.root.parent as any;\n\t\tif (container != null && container.getShapeScale != null) {\n\t\t\treturn container.getShapeScale();\n\t\t}\n\t\treturn 1.0;\n\t}\n\n\tprotected getStrokeWidthScale(style: EShapeStrokeStyle): number {\n\t\tif (style & EShapeStrokeStyle.NON_EXPANDING_WIDTH) {\n\t\t\tif (style & EShapeStrokeStyle.NON_SHRINKING_WIDTH) {\n\t\t\t\treturn this.getShapeScale();\n\t\t\t} else {\n\t\t\t\treturn Math.min(1.0, this.getShapeScale());\n\t\t\t}\n\t\t} else {\n\t\t\tif (style & EShapeStrokeStyle.NON_SHRINKING_WIDTH) {\n\t\t\t\treturn Math.max(1.0, this.getShapeScale());\n\t\t\t} else {\n\t\t\t\treturn 1.0;\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected getHitTestSize(result: EShapeBaseHitTestData): EShapeBaseHitTestData {\n\t\tconst size = this.size;\n\t\tresult.width = 0.5 * size.x;\n\t\tresult.height = 0.5 * size.y;\n\t\treturn result;\n\t}\n\n\ttoHitTestData(x: number, y: number): EShapeBaseHitTestData {\n\t\tconst result = this.getHitTestSize(\n\t\t\t(EShapeBase.WORK_HIT_TEST_DATA ??= new EShapeBaseHitTestData())\n\t\t);\n\t\tconst sx = result.width;\n\t\tconst sy = result.height;\n\t\tconst pivot = this.transform.pivot;\n\t\tconst dx = x - pivot.x;\n\t\tconst dy = y - pivot.y;\n\t\tconst stroke = this.stroke;\n\t\tconst strokeWidth = stroke.enable ? stroke.width : 0;\n\t\tconst strokeScale = this.getStrokeWidthScale(stroke.style);\n\t\tconst strokeAlign = stroke.align;\n\t\tconst s = strokeWidth * strokeScale * strokeAlign;\n\t\treturn result.set(\n\t\t\t0 <= sx ? +dx : -dx,\n\t\t\t0 <= sy ? +dy : -dy,\n\t\t\tMath.abs(sx) + s,\n\t\t\tMath.abs(sy) + s,\n\t\t\tstrokeWidth,\n\t\t\tstrokeScale,\n\t\t\tstrokeAlign\n\t\t);\n\t}\n\n\tcontains(x: number, y: number): EShape | null {\n\t\tconst data = this.toHitTestData(x, y);\n\t\tif (\n\t\t\tthis.containsAbs(\n\t\t\t\tdata.x,\n\t\t\t\tdata.y,\n\t\t\t\tdata.width,\n\t\t\t\tdata.height,\n\t\t\t\tdata.strokeWidth,\n\t\t\t\tdata.strokeScale,\n\t\t\t\tdata.strokeAlign\n\t\t\t)\n\t\t) {\n\t\t\treturn this;\n\t\t}\n\t\treturn this.containsText(x, y) || this.containsChildren(x, y);\n\t}\n\n\tprotected containsText(x: number, y: number): EShape | null {\n\t\tconst text = this.text;\n\t\tconst textAtlas = text.atlas;\n\t\tif (textAtlas != null) {\n\t\t\tconst textWorld = text.world;\n\t\t\tif (textWorld != null) {\n\t\t\t\tconst transform = this.transform.internalTransform;\n\t\t\t\tconst tx = transform.a * x + transform.c * y + transform.tx - textWorld[0];\n\t\t\t\tconst ty = transform.b * x + transform.d * y + transform.ty - textWorld[1];\n\t\t\t\tconst th = textWorld[2] * tx + textWorld[3] * ty;\n\t\t\t\tconst tv = textWorld[4] * tx + textWorld[5] * ty;\n\t\t\t\tconst w = textWorld[6];\n\t\t\t\tconst h = textWorld[7];\n\t\t\t\tif (0 <= th && th <= w && 0 <= tv && tv <= h) {\n\t\t\t\t\treturn this;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\tprotected containsChildren(x: number, y: number): EShape | null {\n\t\tconst children = this.children;\n\t\tfor (let i = children.length - 1; 0 <= i; --i) {\n\t\t\tconst child = children[i];\n\t\t\tchild.updateTransform();\n\t\t\tconst localTransform = child.transform.localTransform;\n\t\t\tconst a = localTransform.a;\n\t\t\tconst b = localTransform.b;\n\t\t\tconst c = localTransform.c;\n\t\t\tconst d = localTransform.d;\n\t\t\tconst tx = localTransform.tx;\n\t\t\tconst ty = localTransform.ty;\n\t\t\tconst id = 1 / (a * d - c * b);\n\t\t\tconst lx = (d * x - c * y + ty * c - tx * d) * id;\n\t\t\tconst ly = (a * y - b * x - ty * a + tx * b) * id;\n\t\t\tconst childResult = child.contains(lx, ly);\n\t\t\tif (childResult != null) {\n\t\t\t\treturn childResult;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\tcontainsBBox(x: number, y: number): boolean {\n\t\tconst data = this.toHitTestData(x, y);\n\t\treturn this.containsAbsBBox(data.x, data.y, data.width, data.height);\n\t}\n\n\tcontainsAbs(\n\t\tx: number,\n\t\ty: number,\n\t\tax: number,\n\t\tay: number,\n\t\tsw: number,\n\t\tss: number,\n\t\tsa: number\n\t): boolean {\n\t\treturn this.containsAbsBBox(x, y, ax, ay);\n\t}\n\n\tcontainsAbsBBox(x: number, y: number, ax: number, ay: number): boolean {\n\t\treturn hitTestBBox(x, y, ax, ay);\n\t}\n\n\tselect(point: Point): boolean {\n\t\treturn false;\n\t}\n\n\t//\n\ttoGlobal(position: IPoint, result: Point, skipUpdate?: boolean): Point {\n\t\tif (skipUpdate !== true) {\n\t\t\tthis.updateTransform();\n\t\t}\n\t\tresult.copyFrom(position);\n\t\tthis.transform.worldTransform.apply(result, result);\n\t\treturn result;\n\t}\n\n\ttoLocal(position: IPoint, from?: DisplayObject, result?: Point, skipUpdate?: boolean): Point {\n\t\tif (skipUpdate !== true) {\n\t\t\tthis.updateTransform();\n\t\t}\n\t\tif (result === undefined) {\n\t\t\tresult = new Point();\n\t\t}\n\t\tresult.copyFrom(position);\n\t\tthis.transform.worldTransform.applyInverse(result, result);\n\t\treturn result;\n\t}\n\n\tgetBounds(skipUpdate?: boolean, result?: Rectangle): Rectangle {\n\t\tif (skipUpdate !== true) {\n\t\t\tthis.updateTransform();\n\t\t}\n\t\tconst bounds = this._bounds || new Rectangle();\n\t\tthis._bounds = bounds;\n\t\tconst worldId = this.transform.getWorldId();\n\t\tif (worldId !== this._boundsTransformId) {\n\t\t\tthis._boundsTransformId = worldId;\n\t\t\tthis.getBounds_(this.transform.worldTransform, bounds);\n\t\t}\n\t\tresult ??= new Rectangle();\n\t\tresult.copyFrom(bounds);\n\t\treturn result;\n\t}\n\n\tgetBoundsInternal(skipUpdate?: boolean, result?: Rectangle): Rectangle {\n\t\tif (skipUpdate !== true) {\n\t\t\tthis.updateTransform();\n\t\t}\n\t\tconst boundsInternal = this._boundsInternal || new Rectangle();\n\t\tthis._boundsInternal = boundsInternal;\n\t\tconst currentLocalId = this.transform.getLocalIdCurrent();\n\t\tif (currentLocalId !== this._boundsInternalTransformId) {\n\t\t\tthis._boundsInternalTransformId = currentLocalId;\n\t\t\tthis.getBounds_(this.transform.internalTransform, boundsInternal);\n\t\t}\n\t\tresult ??= new Rectangle();\n\t\tresult.copyFrom(boundsInternal);\n\t\treturn result;\n\t}\n\n\tgetBoundsLocal(skipUpdate?: boolean, result?: Rectangle): Rectangle {\n\t\tif (skipUpdate !== true) {\n\t\t\tthis.updateTransform();\n\t\t}\n\t\tconst boundsLocal = this._boundsLocal || new Rectangle();\n\t\tthis._boundsLocal = boundsLocal;\n\t\tconst currentLocalId = this.transform.getLocalIdCurrent();\n\t\tif (currentLocalId !== this._boundsLocalTransformId) {\n\t\t\tthis._boundsLocalTransformId = currentLocalId;\n\t\t\tthis.getBounds_(this.transform.localTransform, boundsLocal);\n\t\t}\n\t\tresult ??= new Rectangle();\n\t\tresult.copyFrom(boundsLocal);\n\t\treturn result;\n\t}\n\n\tprotected getBoundsSize(): IPoint {\n\t\treturn this.size;\n\t}\n\n\tprotected getBounds_(transform: Matrix, result: Rectangle): Rectangle {\n\t\tconst pivot = this.transform.pivot;\n\t\tconst px = pivot.x;\n\t\tconst py = pivot.y;\n\t\tconst size = this.getBoundsSize();\n\t\tconst sx = 0.5 * size.x;\n\t\tconst sy = 0.5 * size.y;\n\n\t\tconst a = transform.a;\n\t\tconst b = transform.b;\n\t\tconst c = transform.c;\n\t\tconst d = transform.d;\n\n\t\tlet x = -sx + px;\n\t\tlet y = -sy + py;\n\t\tconst x0 = a * x + c * y;\n\t\tconst y0 = b * x + d * y;\n\n\t\tx = +sx + px;\n\t\ty = -sy + py;\n\t\tconst x1 = a * x + c * y;\n\t\tconst y1 = b * x + d * y;\n\n\t\tx = -sx + px;\n\t\ty = +sy + py;\n\t\tconst x2 = a * x + c * y;\n\t\tconst y2 = b * x + d * y;\n\n\t\tx = +sx + px;\n\t\ty = +sy + py;\n\t\tconst x3 = a * x + c * y;\n\t\tconst y3 = b * x + d * y;\n\n\t\tconst xmin = Math.min(x0, x1, x2, x3);\n\t\tconst ymin = Math.min(y0, y1, y2, y3);\n\t\tconst xmax = Math.max(x0, x1, x2, x3);\n\t\tconst ymax = Math.max(y0, y1, y2, y3);\n\t\tresult.x = xmin + transform.tx;\n\t\tresult.y = ymin + transform.ty;\n\t\tresult.width = xmax - xmin;\n\t\tresult.height = ymax - ymin;\n\t\treturn result;\n\t}\n\n\t//\n\tdestroy(): void {\n\t\tconst children = this.children;\n\t\tfor (let i = children.length - 1; 0 <= i; --i) {\n\t\t\tchildren[i].destroy();\n\t\t}\n\t\tchildren.length = 0;\n\t}\n\n\t//\n\tprotected onStateChange(newState: DBaseStateSet, oldState: DBaseStateSet): void {\n\t\tconst runtime = this.runtime;\n\t\tif (runtime != null) {\n\t\t\truntime.onStateChange(this, newState, oldState);\n\t\t}\n\n\t\tconst children = this.children;\n\t\tfor (let i = 0, imax = children.length; i < imax; ++i) {\n\t\t\tconst child = children[i];\n\t\t\tif (child instanceof EShapeBase) {\n\t\t\t\tchild.state.onParentChange(newState, oldState);\n\t\t\t}\n\t\t}\n\t}\n\n\tget state(): EShapeStateSet {\n\t\tlet result = this._state;\n\t\tif (result == null) {\n\t\t\tresult = new EShapeStateSetImplObservable((newState, oldState): void => {\n\t\t\t\tthis.onStateChange(newState, oldState);\n\t\t\t});\n\t\t\tthis._state = result;\n\t\t}\n\t\treturn result;\n\t}\n\n\tget capability(): EShapeCapabilityContainer {\n\t\tlet result = this._capability;\n\t\tif (result == null) {\n\t\t\tresult = new EShapeCapabilityContainerImpl();\n\t\t\tthis._capability = result;\n\t\t}\n\t\treturn result;\n\t}\n\n\tgetCapability(): EShapeCapabilityContainer | undefined {\n\t\treturn this._capability;\n\t}\n\n\tfocus(): this {\n\t\tthis.setFocused(true);\n\t\treturn this;\n\t}\n\n\tblur(): this {\n\t\tthis.setFocused(false);\n\t\treturn this;\n\t}\n\n\tprotected setFocused(isFocused: boolean): void {\n\t\tif (this.state.isFocused !== isFocused) {\n\t\t\tconst layer = DApplications.getLayer(this);\n\t\t\tif (layer) {\n\t\t\t\tlayer.getFocusController().set(this, isFocused);\n\t\t\t}\n\t\t}\n\t}\n\n\tonKeyDown(e: KeyboardEvent): boolean {\n\t\tconst runtime = this.runtime;\n\t\tif (runtime) {\n\t\t\treturn runtime.onKeyDown(this, e);\n\t\t}\n\t\treturn false;\n\t}\n\n\tonKeyUp(e: KeyboardEvent): boolean {\n\t\tconst runtime = this.runtime;\n\t\tif (runtime) {\n\t\t\treturn runtime.onKeyUp(this, e);\n\t\t}\n\t\treturn false;\n\t}\n\n\t//\n\tupdate(time: number): void {\n\t\tconst runtime = this.runtime;\n\t\tif (runtime) {\n\t\t\truntime.update(this, time);\n\t\t}\n\t}\n\n\tonRender(time: number, renderer: Renderer): void {\n\t\tconst runtime = this.runtime;\n\t\tif (runtime) {\n\t\t\truntime.onRender(this, time, renderer);\n\t\t}\n\t}\n\n\tcopy(source: EShape, part: EShapeCopyPart = EShapeCopyPart.ALL): this {\n\t\tthis.lock(EShapeLockPart.ALL);\n\t\tthis.id = source.id;\n\t\tthis.uuid = source.uuid;\n\t\tthis.visible = source.visible;\n\t\tif (part & EShapeCopyPart.TRANSFORM) {\n\t\t\tconst transform = this.transform;\n\t\t\tconst sourceTransform = source.transform;\n\t\t\ttransform.position.copyFrom(sourceTransform.position);\n\t\t\ttransform.rotation = sourceTransform.rotation;\n\t\t\ttransform.skew.copyFrom(sourceTransform.skew);\n\t\t\ttransform.pivot.copyFrom(sourceTransform.pivot);\n\t\t\ttransform.scale.copyFrom(sourceTransform.scale);\n\t\t}\n\t\tif (part & EShapeCopyPart.SIZE) {\n\t\t\tthis.size.copyFrom(source.size);\n\t\t}\n\t\tif (part & EShapeCopyPart.STYLE) {\n\t\t\tthis.fill.copy(source.fill);\n\t\t\tthis.stroke.copy(source.stroke);\n\t\t\tthis.text.copy(source.text);\n\t\t\tthis.radius = source.radius;\n\t\t\tthis.corner = source.corner;\n\t\t}\n\t\tif (part & EShapeCopyPart.DATA) {\n\t\t\tthis.data.copy(source.data);\n\t\t}\n\t\tif (part & EShapeCopyPart.IMAGE) {\n\t\t\tthis.image = source.image;\n\t\t}\n\t\tif (part & EShapeCopyPart.ACTION) {\n\t\t\tthis.action.clearAndAddAll(source.action.values);\n\t\t\tthis.interactive = source.interactive;\n\t\t\tthis.cursor = source.cursor;\n\t\t\tthis.shortcut = source.shortcut;\n\t\t}\n\t\tif (part & EShapeCopyPart.POINTS) {\n\t\t\tconst sourcePoints = source.points;\n\t\t\tif (sourcePoints != null) {\n\t\t\t\tconst points = this.points;\n\t\t\t\tif (points != null) {\n\t\t\t\t\tpoints.copy(sourcePoints);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (part & EShapeCopyPart.STATE) {\n\t\t\tthis.state.lock(false).copy(source.state).unlock();\n\t\t}\n\t\tif (part & EShapeCopyPart.CONNECTOR) {\n\t\t\tif (source instanceof EShapeBase) {\n\t\t\t\tconst sourceConnector = source._connector;\n\t\t\t\tif (sourceConnector) {\n\t\t\t\t\tthis.connector.copy(sourceConnector);\n\t\t\t\t} else {\n\t\t\t\t\tconst connector = this._connector;\n\t\t\t\t\tif (connector) {\n\t\t\t\t\t\tconnector.clear();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tconst connector = this._connector;\n\t\t\t\tif (connector) {\n\t\t\t\t\tconnector.clear();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (part & EShapeCopyPart.CAPABILITY) {\n\t\t\tconst sourceCapability = source.getCapability();\n\t\t\tif (sourceCapability != null) {\n\t\t\t\tthis.capability.copy(sourceCapability);\n\t\t\t} else {\n\t\t\t\tconst capability = this._capability;\n\t\t\t\tif (capability != null) {\n\t\t\t\t\tcapability.clear();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tthis.unlock(EShapeLockPart.ALL, true);\n\t\treturn this;\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"e-shape-base.js","sourceRoot":"","sources":["../../../../../src/main/typescript/wcardinal/ui/shape/variant/e-shape-base.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAEH,OAAO,EAIN,KAAK,EACL,SAAS,EAGT,SAAS,EACT,KAAK,EACL,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAGrD,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAIxD,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;AAE9C,OAAO,EAAE,6BAA6B,EAAE,MAAM,sCAAsC,CAAC;AACrF,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD;IAAyC,8BAAkB;IA+D1D,oBAAY,IAAgB;QAA5B,YACC,iBAAO,SA2BP;QA1BA,KAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QACb,KAAI,CAAC,IAAI,GAAG,CAAC,CAAC;QACd,KAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,KAAI,CAAC,SAAS,GAAG,KAA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X-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 { EShapeImageLike } from \"../e-shape-image-like\";\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 { 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\tabstract image?: EShapeImageLike;\n\ttexture?: Texture;\n\tabstract gradient?: EShapeGradientLike;\n\tabstract readonly text: EShapeText;\n\t/** @deprecated in favor of {@link data} */\n\tabstract readonly tag: EShapeData;\n\tabstract readonly data: EShapeData;\n\treadonly action: EShapeAction;\n\tcursor?: string;\n\tinteractive: boolean;\n\tshortcut?: string;\n\ttitle?: string;\n\n\tprotected _connector?: EShapeConnectorContainer;\n\n\tprotected _visible: boolean;\n\n\tprotected _lockTransformChild: EShapeLock;\n\tprotected _lockTransformThis: EShapeLock;\n\tprotected _lockTransformParent: EShapeLock;\n\tprotected _lockUploaded: EShapeLock;\n\n\tprotected _bounds?: Rectangle;\n\tprotected _boundsTransformId: number;\n\tprotected _boundsInternal?: Rectangle;\n\tprotected _boundsInternalTransformId: number;\n\tprotected _boundsLocal?: Rectangle;\n\tprotected _boundsLocalTransformId: number;\n\n\tprotected _state?: EShapeStateSet;\n\tprotected _capability?: EShapeCapabilityContainer;\n\n\t// Hierarchy\n\tparent: EShapeContainer | EShape | null;\n\tchildren: EShape[];\n\tlayout?: EShapeLayout;\n\n\t// Working space\n\tindex: number; // A work space for sorting.\n\tselected: boolean;\n\treference: number; // Count of references from commands\n\n\t// Working space for the viewer\n\truntime?: EShapeRuntime;\n\n\t// Working space for the editor\n\teditor?: EShapeEditor;\n\n\t// Working space for the renderer\n\tuploaded?: EShapeUploaded;\n\n\tconstructor(type: EShapeType) {\n\t\tsuper();\n\t\tthis.id = \"\";\n\t\tthis.uuid = 0;\n\t\tthis.type = type;\n\t\tthis.transform = this.newTransform();\n\t\tthis.action = new EShapeAction();\n\t\tthis._visible = true;\n\n\t\tthis._lockTransformChild = new EShapeLock();\n\t\tthis._lockTransformThis = new EShapeLock();\n\t\tthis._lockTransformParent = new EShapeLock();\n\t\tthis._lockUploaded = new EShapeLock();\n\n\t\tthis._boundsTransformId = -1;\n\t\tthis._boundsInternalTransformId = -1;\n\t\tthis._boundsLocalTransformId = -1;\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 = -1;\n\t\tthis._boundsInternalTransformId = -1;\n\t\tthis._boundsLocalTransformId = -1;\n\n\t\tif (!this._lockTransformChild.isLocked()) {\n\t\t\tthis.callChildTransformChange();\n\t\t}\n\t\tconst points = this._points;\n\t\tif (points != null) {\n\t\t\tpoints.onSizeChange();\n\t\t}\n\t\tthis.updateUploaded();\n\n\t\tconst connector = this._connector;\n\t\tif (connector != null) {\n\t\t\tconnector.fit(true);\n\t\t}\n\n\t\tconst runtime = this.runtime;\n\t\tif (runtime != null) {\n\t\t\truntime.onResize(this);\n\t\t}\n\t}\n\n\tonTransformChange(): void {\n\t\tif (!this._lockTransformChild.isLocked()) {\n\t\t\tthis.callChildTransformChange();\n\t\t}\n\t\tif (!this._lockTransformThis.isLocked()) {\n\t\t\tthis.onThisTransformChange();\n\t\t}\n\t\tif (!this._lockTransformParent.isLocked()) {\n\t\t\tthis.callParentTransformChange();\n\t\t}\n\t}\n\n\tprotected callChildTransformChange(): void {\n\t\tconst parent = this.parent;\n\t\tif (parent != null) {\n\t\t\tparent.onChildTransformChange();\n\t\t}\n\t}\n\n\tprotected onThisTransformChange(): void {\n\t\tthis.updateUploaded();\n\t\tconst connector = this._connector;\n\t\tif (connector != null) {\n\t\t\tconnector.fit(true);\n\t\t}\n\t}\n\n\tprotected callParentTransformChange(): void {\n\t\tconst children = this.children;\n\t\tfor (let i = 0, imax = children.length; i < imax; ++i) {\n\t\t\tchildren[i].onParentTransformChange();\n\t\t}\n\t}\n\n\tonParentTransformChange(): void {\n\t\tif (!this._lockTransformThis.isLocked()) {\n\t\t\tthis.onThisTransformChange();\n\t\t}\n\t\tif (!this._lockTransformParent.isLocked()) {\n\t\t\tthis.callParentTransformChange();\n\t\t}\n\t}\n\n\tlock(part: EShapeLockPart): this {\n\t\tif (part & EShapeLockPart.UPLOADED) {\n\t\t\tthis._lockUploaded.lock();\n\t\t}\n\t\tif (part & EShapeLockPart.TRANSFORM_PARENT) {\n\t\t\tthis._lockTransformParent.lock();\n\t\t}\n\t\tif (part & EShapeLockPart.TRANSFORM_THIS) {\n\t\t\tthis._lockTransformThis.lock();\n\t\t}\n\t\tif (part & EShapeLockPart.TRANSFORM_CHILD) {\n\t\t\tthis._lockTransformChild.lock();\n\t\t}\n\t\treturn this;\n\t}\n\n\tunlock(part: EShapeLockPart, invoke: boolean): this {\n\t\tif (part & EShapeLockPart.TRANSFORM_CHILD) {\n\t\t\tif (this._lockTransformChild.unlock() && invoke) {\n\t\t\t\tconst parent = this.parent;\n\t\t\t\tif (parent != null) {\n\t\t\t\t\tparent.onChildTransformChange();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (part & EShapeLockPart.TRANSFORM_THIS) {\n\t\t\tif (this._lockTransformThis.unlock() && invoke) {\n\t\t\t\tthis.onThisTransformChange();\n\t\t\t}\n\t\t}\n\t\tif (part & EShapeLockPart.TRANSFORM_PARENT) {\n\t\t\tif (this._lockTransformParent.unlock() && invoke) {\n\t\t\t\tconst children = this.children;\n\t\t\t\tfor (let i = 0, imax = children.length; i < imax; ++i) {\n\t\t\t\t\tchildren[i].onParentTransformChange();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (part & EShapeLockPart.UPLOADED) {\n\t\t\tconst lockUploaded = this._lockUploaded;\n\t\t\tif (lockUploaded.unlock() && invoke) {\n\t\t\t\tthis.updateUploaded(lockUploaded.isHigh());\n\t\t\t}\n\t\t}\n\t\treturn this;\n\t}\n\n\tonChildTransformChange(): void {\n\t\t//\n\t}\n\n\tupdateUploaded(recursively?: boolean): void {\n\t\tif (this._lockUploaded.isLocked(recursively)) {\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 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\tabstract serializeImage(manager: EShapeResourceManagerSerialization): number;\n\n\tabstract serializeGradient(manager: EShapeResourceManagerSerialization): number;\n\n\tserializeState(manager: EShapeResourceManagerSerialization): number {\n\t\tconst state = this.state;\n\t\treturn (this.interactive ? 1 : 0) | (state.isFocusable ? 0 : 2) | (state.isActive ? 4 : 0);\n\t}\n\n\tserialize(manager: EShapeResourceManagerSerialization): DDiagramSerializedItem {\n\t\tconst transform = this.transform;\n\t\tconst position = transform.position;\n\t\tconst pivot = transform.pivot;\n\t\tconst size = this.size;\n\t\tconst shortcut = this.shortcut;\n\t\tconst shortcutId = shortcut != null ? manager.addResource(shortcut) : -1;\n\t\tconst cursor = this.cursor;\n\t\tconst cursorId = cursor != null ? manager.addResource(cursor) : -1;\n\t\tconst title = this.title;\n\t\tconst titleId = title != null ? manager.addResource(title) : -1;\n\t\tlet capabilitiesAdded: EShapeCapability = EShapeCapability.NONE;\n\t\tlet capabilitiesRemoved: EShapeCapability = EShapeCapability.NONE;\n\t\tlet capabilitiesLocked: EShapeCapability = EShapeCapability.NONE;\n\t\tconst capability = this._capability;\n\t\tif (capability != null) {\n\t\t\tcapabilitiesAdded = capability.added;\n\t\t\tcapabilitiesRemoved = capability.removed;\n\t\t\tcapabilitiesLocked = capability.locked;\n\t\t}\n\t\treturn [\n\t\t\tthis.type,\n\t\t\tmanager.addResource(this.id),\n\t\t\tposition.x,\n\t\t\tposition.y,\n\t\t\tsize.x,\n\t\t\tsize.y,\n\t\t\ttransform.rotation,\n\t\t\ttransform.skew.x,\n\t\t\tthis.fill.serialize(manager),\n\t\t\tthis.stroke.serialize(manager),\n\t\t\tcursorId,\n\t\t\tthis.text.serialize(manager),\n\t\t\tthis.data.serialize(manager),\n\t\t\tthis.radius,\n\t\t\tthis.corner,\n\t\t\t-1,\n\t\t\t-1,\n\t\t\tthis.action.serialize(manager),\n\t\t\tthis.serializeImage(manager),\n\t\t\tthis.serializeGradient(manager),\n\t\t\tthis.serializeChildren(manager),\n\t\t\tpivot.x,\n\t\t\tpivot.y,\n\t\t\tthis.serializeState(manager),\n\t\t\tshortcutId,\n\t\t\ttitleId,\n\t\t\tthis.uuid,\n\t\t\tcapabilitiesAdded,\n\t\t\tcapabilitiesRemoved,\n\t\t\tcapabilitiesLocked\n\t\t];\n\t}\n\n\taddUuid(manager: EShapeResourceManagerSerialization): void {\n\t\tthis.uuid = manager.addUuid(this.uuid);\n\t\tconst children = this.children;\n\t\tfor (let i = 0, imax = children.length; i < imax; ++i) {\n\t\t\tchildren[i].addUuid(manager);\n\t\t}\n\t}\n\n\tupdateUuid(manager: EShapeResourceManagerSerialization): void {\n\t\tthis.uuid = manager.updateUuid(this.uuid);\n\t\tconst children = this.children;\n\t\tfor (let i = 0, imax = children.length; i < imax; ++i) {\n\t\t\tchildren[i].updateUuid(manager);\n\t\t}\n\t}\n\n\t// Hit test\n\tprotected getShapeScale(): number {\n\t\tconst container = this.root.parent as any;\n\t\tif (container != null && container.getShapeScale != null) {\n\t\t\treturn container.getShapeScale();\n\t\t}\n\t\treturn 1.0;\n\t}\n\n\tprotected getStrokeWidthScale(style: EShapeStrokeStyle): number {\n\t\tif (style & EShapeStrokeStyle.NON_EXPANDING_WIDTH) {\n\t\t\tif (style & EShapeStrokeStyle.NON_SHRINKING_WIDTH) {\n\t\t\t\treturn this.getShapeScale();\n\t\t\t} else {\n\t\t\t\treturn Math.min(1.0, this.getShapeScale());\n\t\t\t}\n\t\t} else {\n\t\t\tif (style & EShapeStrokeStyle.NON_SHRINKING_WIDTH) {\n\t\t\t\treturn Math.max(1.0, this.getShapeScale());\n\t\t\t} else {\n\t\t\t\treturn 1.0;\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected getHitTestSize(result: EShapeBaseHitTestData): EShapeBaseHitTestData {\n\t\tconst size = this.size;\n\t\tresult.width = 0.5 * size.x;\n\t\tresult.height = 0.5 * size.y;\n\t\treturn result;\n\t}\n\n\ttoHitTestData(x: number, y: number): EShapeBaseHitTestData {\n\t\tconst result = this.getHitTestSize(\n\t\t\t(EShapeBase.WORK_HIT_TEST_DATA ??= new EShapeBaseHitTestData())\n\t\t);\n\t\tconst sx = result.width;\n\t\tconst sy = result.height;\n\t\tconst pivot = this.transform.pivot;\n\t\tconst dx = x - pivot.x;\n\t\tconst dy = y - pivot.y;\n\t\tconst stroke = this.stroke;\n\t\tconst strokeWidth = stroke.enable ? stroke.width : 0;\n\t\tconst strokeScale = this.getStrokeWidthScale(stroke.style);\n\t\tconst strokeAlign = stroke.align;\n\t\tconst s = strokeWidth * strokeScale * strokeAlign;\n\t\treturn result.set(\n\t\t\t0 <= sx ? +dx : -dx,\n\t\t\t0 <= sy ? +dy : -dy,\n\t\t\tMath.abs(sx) + s,\n\t\t\tMath.abs(sy) + s,\n\t\t\tstrokeWidth,\n\t\t\tstrokeScale,\n\t\t\tstrokeAlign\n\t\t);\n\t}\n\n\tcontains(x: number, y: number): EShape | null {\n\t\tconst data = this.toHitTestData(x, y);\n\t\tif (\n\t\t\tthis.containsAbs(\n\t\t\t\tdata.x,\n\t\t\t\tdata.y,\n\t\t\t\tdata.width,\n\t\t\t\tdata.height,\n\t\t\t\tdata.strokeWidth,\n\t\t\t\tdata.strokeScale,\n\t\t\t\tdata.strokeAlign\n\t\t\t)\n\t\t) {\n\t\t\treturn this;\n\t\t}\n\t\treturn this.containsText(x, y) || this.containsChildren(x, y);\n\t}\n\n\tprotected containsText(x: number, y: number): EShape | null {\n\t\tconst text = this.text;\n\t\tconst textAtlas = text.atlas;\n\t\tif (textAtlas != null) {\n\t\t\tconst textWorld = text.world;\n\t\t\tif (textWorld != null) {\n\t\t\t\tconst transform = this.transform.internalTransform;\n\t\t\t\tconst tx = transform.a * x + transform.c * y + transform.tx - textWorld[0];\n\t\t\t\tconst ty = transform.b * x + transform.d * y + transform.ty - textWorld[1];\n\t\t\t\tconst th = textWorld[2] * tx + textWorld[3] * ty;\n\t\t\t\tconst tv = textWorld[4] * tx + textWorld[5] * ty;\n\t\t\t\tconst w = textWorld[6];\n\t\t\t\tconst h = textWorld[7];\n\t\t\t\tif (0 <= th && th <= w && 0 <= tv && tv <= h) {\n\t\t\t\t\treturn this;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\tprotected containsChildren(x: number, y: number): EShape | null {\n\t\tconst children = this.children;\n\t\tfor (let i = children.length - 1; 0 <= i; --i) {\n\t\t\tconst child = children[i];\n\t\t\tchild.updateTransform();\n\t\t\tconst localTransform = child.transform.localTransform;\n\t\t\tconst a = localTransform.a;\n\t\t\tconst b = localTransform.b;\n\t\t\tconst c = localTransform.c;\n\t\t\tconst d = localTransform.d;\n\t\t\tconst tx = localTransform.tx;\n\t\t\tconst ty = localTransform.ty;\n\t\t\tconst id = 1 / (a * d - c * b);\n\t\t\tconst lx = (d * x - c * y + ty * c - tx * d) * id;\n\t\t\tconst ly = (a * y - b * x - ty * a + tx * b) * id;\n\t\t\tconst childResult = child.contains(lx, ly);\n\t\t\tif (childResult != null) {\n\t\t\t\treturn childResult;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\tcontainsBBox(x: number, y: number): boolean {\n\t\tconst data = this.toHitTestData(x, y);\n\t\treturn this.containsAbsBBox(data.x, data.y, data.width, data.height);\n\t}\n\n\tcontainsAbs(\n\t\tx: number,\n\t\ty: number,\n\t\tax: number,\n\t\tay: number,\n\t\tsw: number,\n\t\tss: number,\n\t\tsa: number\n\t): boolean {\n\t\treturn this.containsAbsBBox(x, y, ax, ay);\n\t}\n\n\tcontainsAbsBBox(x: number, y: number, ax: number, ay: number): boolean {\n\t\treturn hitTestBBox(x, y, ax, ay);\n\t}\n\n\tselect(point: Point): boolean {\n\t\treturn false;\n\t}\n\n\t//\n\ttoGlobal(position: IPoint, result: Point, skipUpdate?: boolean): Point {\n\t\tif (skipUpdate !== true) {\n\t\t\tthis.updateTransform();\n\t\t}\n\t\tresult.copyFrom(position);\n\t\tthis.transform.worldTransform.apply(result, result);\n\t\treturn result;\n\t}\n\n\ttoLocal(position: IPoint, from?: DisplayObject, result?: Point, skipUpdate?: boolean): Point {\n\t\tif (skipUpdate !== true) {\n\t\t\tthis.updateTransform();\n\t\t}\n\t\tif (result === undefined) {\n\t\t\tresult = new Point();\n\t\t}\n\t\tresult.copyFrom(position);\n\t\tthis.transform.worldTransform.applyInverse(result, result);\n\t\treturn result;\n\t}\n\n\tgetBounds(skipUpdate?: boolean, result?: Rectangle): Rectangle {\n\t\tif (skipUpdate !== true) {\n\t\t\tthis.updateTransform();\n\t\t}\n\t\tconst bounds = this._bounds || new Rectangle();\n\t\tthis._bounds = bounds;\n\t\tconst worldId = this.transform.getWorldId();\n\t\tif (worldId !== this._boundsTransformId) {\n\t\t\tthis._boundsTransformId = worldId;\n\t\t\tthis.getBounds_(this.transform.worldTransform, bounds);\n\t\t}\n\t\tresult ??= new Rectangle();\n\t\tresult.copyFrom(bounds);\n\t\treturn result;\n\t}\n\n\tgetBoundsInternal(skipUpdate?: boolean, result?: Rectangle): Rectangle {\n\t\tif (skipUpdate !== true) {\n\t\t\tthis.updateTransform();\n\t\t}\n\t\tconst boundsInternal = this._boundsInternal || new Rectangle();\n\t\tthis._boundsInternal = boundsInternal;\n\t\tconst currentLocalId = this.transform.getLocalIdCurrent();\n\t\tif (currentLocalId !== this._boundsInternalTransformId) {\n\t\t\tthis._boundsInternalTransformId = currentLocalId;\n\t\t\tthis.getBounds_(this.transform.internalTransform, boundsInternal);\n\t\t}\n\t\tresult ??= new Rectangle();\n\t\tresult.copyFrom(boundsInternal);\n\t\treturn result;\n\t}\n\n\tgetBoundsLocal(skipUpdate?: boolean, result?: Rectangle): Rectangle {\n\t\tif (skipUpdate !== true) {\n\t\t\tthis.updateTransform();\n\t\t}\n\t\tconst boundsLocal = this._boundsLocal || new Rectangle();\n\t\tthis._boundsLocal = boundsLocal;\n\t\tconst currentLocalId = this.transform.getLocalIdCurrent();\n\t\tif (currentLocalId !== this._boundsLocalTransformId) {\n\t\t\tthis._boundsLocalTransformId = currentLocalId;\n\t\t\tthis.getBounds_(this.transform.localTransform, boundsLocal);\n\t\t}\n\t\tresult ??= new Rectangle();\n\t\tresult.copyFrom(boundsLocal);\n\t\treturn result;\n\t}\n\n\tprotected getBoundsSize(): IPoint {\n\t\treturn this.size;\n\t}\n\n\tprotected getBounds_(transform: Matrix, result: Rectangle): Rectangle {\n\t\tconst pivot = this.transform.pivot;\n\t\tconst px = pivot.x;\n\t\tconst py = pivot.y;\n\t\tconst size = this.getBoundsSize();\n\t\tconst sx = 0.5 * size.x;\n\t\tconst sy = 0.5 * size.y;\n\n\t\tconst a = transform.a;\n\t\tconst b = transform.b;\n\t\tconst c = transform.c;\n\t\tconst d = transform.d;\n\n\t\tlet x = -sx + px;\n\t\tlet y = -sy + py;\n\t\tconst x0 = a * x + c * y;\n\t\tconst y0 = b * x + d * y;\n\n\t\tx = +sx + px;\n\t\ty = -sy + py;\n\t\tconst x1 = a * x + c * y;\n\t\tconst y1 = b * x + d * y;\n\n\t\tx = -sx + px;\n\t\ty = +sy + py;\n\t\tconst x2 = a * x + c * y;\n\t\tconst y2 = b * x + d * y;\n\n\t\tx = +sx + px;\n\t\ty = +sy + py;\n\t\tconst x3 = a * x + c * y;\n\t\tconst y3 = b * x + d * y;\n\n\t\tconst xmin = Math.min(x0, x1, x2, x3);\n\t\tconst ymin = Math.min(y0, y1, y2, y3);\n\t\tconst xmax = Math.max(x0, x1, x2, x3);\n\t\tconst ymax = Math.max(y0, y1, y2, y3);\n\t\tresult.x = xmin + transform.tx;\n\t\tresult.y = ymin + transform.ty;\n\t\tresult.width = xmax - xmin;\n\t\tresult.height = ymax - ymin;\n\t\treturn result;\n\t}\n\n\t//\n\tdestroy(): void {\n\t\tconst children = this.children;\n\t\tfor (let i = children.length - 1; 0 <= i; --i) {\n\t\t\tchildren[i].destroy();\n\t\t}\n\t\tchildren.length = 0;\n\t}\n\n\t//\n\tprotected onStateChange(newState: DBaseStateSet, oldState: DBaseStateSet): void {\n\t\tconst runtime = this.runtime;\n\t\tif (runtime != null) {\n\t\t\truntime.onStateChange(this, newState, oldState);\n\t\t}\n\n\t\tconst children = this.children;\n\t\tfor (let i = 0, imax = children.length; i < imax; ++i) {\n\t\t\tconst child = children[i];\n\t\t\tif (child instanceof EShapeBase) {\n\t\t\t\tchild.state.onParentChange(newState, oldState);\n\t\t\t}\n\t\t}\n\t}\n\n\tget state(): EShapeStateSet {\n\t\tlet result = this._state;\n\t\tif (result == null) {\n\t\t\tresult = new EShapeStateSetImplObservable((newState, oldState): void => {\n\t\t\t\tthis.onStateChange(newState, oldState);\n\t\t\t});\n\t\t\tthis._state = result;\n\t\t}\n\t\treturn result;\n\t}\n\n\tget capability(): EShapeCapabilityContainer {\n\t\tlet result = this._capability;\n\t\tif (result == null) {\n\t\t\tresult = new EShapeCapabilityContainerImpl();\n\t\t\tthis._capability = result;\n\t\t}\n\t\treturn result;\n\t}\n\n\tgetCapability(): EShapeCapabilityContainer | undefined {\n\t\treturn this._capability;\n\t}\n\n\tfocus(): this {\n\t\tthis.setFocused(true);\n\t\treturn this;\n\t}\n\n\tblur(): this {\n\t\tthis.setFocused(false);\n\t\treturn this;\n\t}\n\n\tprotected setFocused(isFocused: boolean): void {\n\t\tif (this.state.isFocused !== isFocused) {\n\t\t\tconst layer = DApplications.getLayer(this);\n\t\t\tif (layer) {\n\t\t\t\tlayer.getFocusController().set(this, isFocused);\n\t\t\t}\n\t\t}\n\t}\n\n\tonKeyDown(e: KeyboardEvent): boolean {\n\t\tconst runtime = this.runtime;\n\t\tif (runtime) {\n\t\t\treturn runtime.onKeyDown(this, e);\n\t\t}\n\t\treturn false;\n\t}\n\n\tonKeyUp(e: KeyboardEvent): boolean {\n\t\tconst runtime = this.runtime;\n\t\tif (runtime) {\n\t\t\treturn runtime.onKeyUp(this, e);\n\t\t}\n\t\treturn false;\n\t}\n\n\t//\n\tupdate(time: number): void {\n\t\tconst runtime = this.runtime;\n\t\tif (runtime) {\n\t\t\truntime.update(this, time);\n\t\t}\n\t}\n\n\tonRender(time: number, renderer: Renderer): void {\n\t\tconst runtime = this.runtime;\n\t\tif (runtime) {\n\t\t\truntime.onRender(this, time, renderer);\n\t\t}\n\t}\n\n\tcopy(source: EShape, part: EShapeCopyPart = EShapeCopyPart.ALL): this {\n\t\tthis.lock(EShapeLockPart.ALL);\n\t\tthis.id = source.id;\n\t\tthis.uuid = source.uuid;\n\t\tthis.visible = source.visible;\n\t\tif (part & EShapeCopyPart.TRANSFORM) {\n\t\t\tconst transform = this.transform;\n\t\t\tconst sourceTransform = source.transform;\n\t\t\ttransform.position.copyFrom(sourceTransform.position);\n\t\t\ttransform.rotation = sourceTransform.rotation;\n\t\t\ttransform.skew.copyFrom(sourceTransform.skew);\n\t\t\ttransform.pivot.copyFrom(sourceTransform.pivot);\n\t\t\ttransform.scale.copyFrom(sourceTransform.scale);\n\t\t}\n\t\tif (part & EShapeCopyPart.SIZE) {\n\t\t\tthis.size.copyFrom(source.size);\n\t\t}\n\t\tif (part & EShapeCopyPart.STYLE) {\n\t\t\tthis.fill.copy(source.fill);\n\t\t\tthis.stroke.copy(source.stroke);\n\t\t\tthis.text.copy(source.text);\n\t\t\tthis.radius = source.radius;\n\t\t\tthis.corner = source.corner;\n\t\t}\n\t\tif (part & EShapeCopyPart.DATA) {\n\t\t\tthis.data.copy(source.data);\n\t\t}\n\t\tif (part & EShapeCopyPart.IMAGE) {\n\t\t\tthis.image = source.image;\n\t\t}\n\t\tif (part & EShapeCopyPart.ACTION) {\n\t\t\tthis.action.clearAndAddAll(source.action.values);\n\t\t\tthis.interactive = source.interactive;\n\t\t\tthis.title = source.title;\n\t\t\tthis.cursor = source.cursor;\n\t\t\tthis.shortcut = source.shortcut;\n\t\t}\n\t\tif (part & EShapeCopyPart.POINTS) {\n\t\t\tconst sourcePoints = source.points;\n\t\t\tif (sourcePoints != null) {\n\t\t\t\tconst points = this.points;\n\t\t\t\tif (points != null) {\n\t\t\t\t\tpoints.copy(sourcePoints);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (part & EShapeCopyPart.STATE) {\n\t\t\tthis.state.lock(false).copy(source.state).unlock();\n\t\t}\n\t\tif (part & EShapeCopyPart.CONNECTOR) {\n\t\t\tif (source instanceof EShapeBase) {\n\t\t\t\tconst sourceConnector = source._connector;\n\t\t\t\tif (sourceConnector) {\n\t\t\t\t\tthis.connector.copy(sourceConnector);\n\t\t\t\t} else {\n\t\t\t\t\tconst connector = this._connector;\n\t\t\t\t\tif (connector) {\n\t\t\t\t\t\tconnector.clear();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tconst connector = this._connector;\n\t\t\t\tif (connector) {\n\t\t\t\t\tconnector.clear();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (part & EShapeCopyPart.CAPABILITY) {\n\t\t\tconst sourceCapability = source.getCapability();\n\t\t\tif (sourceCapability != null) {\n\t\t\t\tthis.capability.copy(sourceCapability);\n\t\t\t} else {\n\t\t\t\tconst capability = this._capability;\n\t\t\t\tif (capability != null) {\n\t\t\t\t\tcapability.clear();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tthis.unlock(EShapeLockPart.ALL, true);\n\t\treturn this;\n\t}\n}\n"]}
|
|
@@ -61,6 +61,7 @@ export * from "./util-gesture-tap";
|
|
|
61
61
|
export * from "./util-gesture-target";
|
|
62
62
|
export * from "./util-gesture";
|
|
63
63
|
export * from "./util-extract";
|
|
64
|
+
export * from "./util-extractor-canvas";
|
|
64
65
|
export * from "./util-extractor-pixels";
|
|
65
66
|
export * from "./util-extractor";
|
|
66
67
|
export * from "./util-file-downloader";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/main/typescript/wcardinal/ui/util/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iCAAiC,CAAC;AAChD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,wCAAwC,CAAC;AACvD,cAAc,qCAAqC,CAAC;AACpD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,iCAAiC,CAAC;AAChD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B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AAClC,cAAc,oBAAoB,CAAC","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport * from \"./format-node\";\nexport * from \"./character\";\nexport * from \"./deep-partial\";\nexport * from \"./dynamic-atlas-item-empty\";\nexport * from \"./dynamic-atlas-item-font-atlas\";\nexport * from \"./dynamic-atlas-item-image\";\nexport * from \"./dynamic-atlas-item-text\";\nexport * from \"./dynamic-atlas-item-white\";\nexport * from \"./dynamic-atlas-item\";\nexport * from \"./dynamic-atlas\";\nexport * from \"./dynamic-font-atlas-chaaracter-origin\";\nexport * from \"./dynamic-font-atlas-character-type\";\nexport * from \"./dynamic-font-atlas-character\";\nexport * from \"./dynamic-font-atlas-characters\";\nexport * from \"./dynamic-font-atlas-font\";\nexport * from \"./dynamic-font-atlas\";\nexport * from \"./dynamic-font-atlases\";\nexport * from \"./dynamic-sdf-font-atlas-font\";\nexport * from \"./dynamic-sdf-font-atlas\";\nexport * from \"./dynamic-sdf-font-atlases\";\nexport * from \"./dynamic-sdf-font-generator\";\nexport * from \"./is-array\";\nexport * from \"./is-function\";\nexport * from \"./is-nan\";\nexport * from \"./is-number\";\nexport * from \"./is-object\";\nexport * from \"./is-string\";\nexport * from \"./lazy\";\nexport * from \"./number-formatter-function\";\nexport * from \"./number-formatter-impl\";\nexport * from \"./number-formatter\";\nexport * from \"./number-formatters\";\nexport * from \"./to-ceiling-index\";\nexport * from \"./to-cloned\";\nexport * from \"./to-enum\";\nexport * from \"./to-id\";\nexport * from \"./to-index-of\";\nexport * from \"./to-label\";\nexport * from \"./to-merged\";\nexport * from \"./to-padded\";\nexport * from \"./to-string\";\nexport * from \"./to-svg-texture\";\nexport * from \"./to-svg-url\";\nexport * from \"./util-alpha\";\nexport * from \"./util-svg-atlas-builder\";\nexport * from \"./util-attach\";\nexport * from \"./util-character-iterator\";\nexport * from \"./util-click-outside\";\nexport * from \"./util-clipboard\";\nexport * from \"./util-gesture-data\";\nexport * from \"./util-gesture-easing-history\";\nexport * from \"./util-gesture-easing\";\nexport * from \"./util-gesture-mode\";\nexport * from \"./util-gesture-modifier\";\nexport * from \"./util-gesture-modifiers\";\nexport * from \"./util-gesture-tap\";\nexport * from \"./util-gesture-target\";\nexport * from \"./util-gesture\";\nexport * from \"./util-extract\";\nexport * from \"./util-extractor-pixels\";\nexport * from \"./util-extractor\";\nexport * from \"./util-file-downloader\";\nexport * from \"./util-file-opener\";\nexport * from \"./util-font\";\nexport * from \"./util-hsv\";\nexport * from \"./util-html-element-clipper-ex-impl\";\nexport * from \"./util-html-element-clipper-ex-rects-impl\";\nexport * from \"./util-html-element-clipper-ex-rects\";\nexport * from \"./util-html-element-clipper-ex\";\nexport * from \"./util-html-element-when\";\nexport * from \"./util-html-element\";\nexport * from \"./util-input-input\";\nexport * from \"./util-input-number\";\nexport * from \"./util-input-text-area\";\nexport * from \"./util-input-text\";\nexport * from \"./util-input\";\nexport * from \"./util-keyboard-event\";\nexport * from \"./util-name\";\nexport * from \"./util-overlay\";\nexport * from \"./util-pointer-event\";\nexport * from \"./util-rgb\";\nexport * from \"./util-rgba\";\nexport * from \"./util-state-blinker\";\nexport * from \"./util-transition\";\nexport * from \"./util-wheel-event\";\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/main/typescript/wcardinal/ui/util/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iCAAiC,CAAC;AAChD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,wCAAwC,CAAC;AACvD,cAAc,qCAAqC,CAAC;AACpD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,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BAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,qCAAqC,CAAC;AACpD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,sCAAsC,CAAC;AACrD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,uBAAuB,CAAC;AACtC,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport * from \"./format-node\";\nexport * from \"./character\";\nexport * from \"./deep-partial\";\nexport * from \"./dynamic-atlas-item-empty\";\nexport * from \"./dynamic-atlas-item-font-atlas\";\nexport * from \"./dynamic-atlas-item-image\";\nexport * from \"./dynamic-atlas-item-text\";\nexport * from \"./dynamic-atlas-item-white\";\nexport * from \"./dynamic-atlas-item\";\nexport * from \"./dynamic-atlas\";\nexport * from \"./dynamic-font-atlas-chaaracter-origin\";\nexport * from \"./dynamic-font-atlas-character-type\";\nexport * from \"./dynamic-font-atlas-character\";\nexport * from \"./dynamic-font-atlas-characters\";\nexport * from \"./dynamic-font-atlas-font\";\nexport * from \"./dynamic-font-atlas\";\nexport * from \"./dynamic-font-atlases\";\nexport * from \"./dynamic-sdf-font-atlas-font\";\nexport * from \"./dynamic-sdf-font-atlas\";\nexport * from \"./dynamic-sdf-font-atlases\";\nexport * from \"./dynamic-sdf-font-generator\";\nexport * from \"./is-array\";\nexport * from \"./is-function\";\nexport * from \"./is-nan\";\nexport * from \"./is-number\";\nexport * from \"./is-object\";\nexport * from \"./is-string\";\nexport * from \"./lazy\";\nexport * from \"./number-formatter-function\";\nexport * from \"./number-formatter-impl\";\nexport * from \"./number-formatter\";\nexport * from \"./number-formatters\";\nexport * from \"./to-ceiling-index\";\nexport * from \"./to-cloned\";\nexport * from \"./to-enum\";\nexport * from \"./to-id\";\nexport * from \"./to-index-of\";\nexport * from \"./to-label\";\nexport * from \"./to-merged\";\nexport * from \"./to-padded\";\nexport * from \"./to-string\";\nexport * from \"./to-svg-texture\";\nexport * from \"./to-svg-url\";\nexport * from \"./util-alpha\";\nexport * from \"./util-svg-atlas-builder\";\nexport * from \"./util-attach\";\nexport * from \"./util-character-iterator\";\nexport * from \"./util-click-outside\";\nexport * from \"./util-clipboard\";\nexport * from \"./util-gesture-data\";\nexport * from \"./util-gesture-easing-history\";\nexport * from \"./util-gesture-easing\";\nexport * from \"./util-gesture-mode\";\nexport * from \"./util-gesture-modifier\";\nexport * from \"./util-gesture-modifiers\";\nexport * from \"./util-gesture-tap\";\nexport * from \"./util-gesture-target\";\nexport * from \"./util-gesture\";\nexport * from \"./util-extract\";\nexport * from \"./util-extractor-canvas\";\nexport * from \"./util-extractor-pixels\";\nexport * from \"./util-extractor\";\nexport * from \"./util-file-downloader\";\nexport * from \"./util-file-opener\";\nexport * from \"./util-font\";\nexport * from \"./util-hsv\";\nexport * from \"./util-html-element-clipper-ex-impl\";\nexport * from \"./util-html-element-clipper-ex-rects-impl\";\nexport * from \"./util-html-element-clipper-ex-rects\";\nexport * from \"./util-html-element-clipper-ex\";\nexport * from \"./util-html-element-when\";\nexport * from \"./util-html-element\";\nexport * from \"./util-input-input\";\nexport * from \"./util-input-number\";\nexport * from \"./util-input-text-area\";\nexport * from \"./util-input-text\";\nexport * from \"./util-input\";\nexport * from \"./util-keyboard-event\";\nexport * from \"./util-name\";\nexport * from \"./util-overlay\";\nexport * from \"./util-pointer-event\";\nexport * from \"./util-rgb\";\nexport * from \"./util-rgba\";\nexport * from \"./util-state-blinker\";\nexport * from \"./util-transition\";\nexport * from \"./util-wheel-event\";\n"]}
|
|
@@ -7,6 +7,7 @@ import { DApplications } from "../d-applications";
|
|
|
7
7
|
import { isNumber } from "./is-number";
|
|
8
8
|
import { UtilExtractor } from "./util-extractor";
|
|
9
9
|
import { UtilFileDownloader } from "./util-file-downloader";
|
|
10
|
+
import { UtilExtractorCanvas } from "./util-extractor-canvas";
|
|
10
11
|
var toResolution = function (options) {
|
|
11
12
|
var _a;
|
|
12
13
|
var target = options.target;
|
|
@@ -76,8 +77,15 @@ var UtilExtract = /** @class */ (function () {
|
|
|
76
77
|
// Create a render texture
|
|
77
78
|
var target = options.target;
|
|
78
79
|
var scale = target.transform.scale;
|
|
79
|
-
var width = Math.
|
|
80
|
-
var height = Math.
|
|
80
|
+
var width = Math.ceil(target.width * scale.x);
|
|
81
|
+
var height = Math.ceil(target.height * scale.y);
|
|
82
|
+
if (width <= 0 || height <= 0) {
|
|
83
|
+
return {
|
|
84
|
+
width: width,
|
|
85
|
+
height: height,
|
|
86
|
+
array: new Uint8Array(0)
|
|
87
|
+
};
|
|
88
|
+
}
|
|
81
89
|
var resolution = toResolution(options);
|
|
82
90
|
var renderTexture = UtilExtract.WORK_RENDER_TEXTURE;
|
|
83
91
|
if (renderTexture == null) {
|
|
@@ -125,16 +133,27 @@ var UtilExtract = /** @class */ (function () {
|
|
|
125
133
|
var scale = toScale(pixels, options);
|
|
126
134
|
return UtilExtractor.toCanvas(pixels, scale, ignorePremutipliedAlpha);
|
|
127
135
|
};
|
|
136
|
+
/**
|
|
137
|
+
* Extracts Base64 data URL from the target.
|
|
138
|
+
* This method internally creates a render texture and a canvas render target.
|
|
139
|
+
* They are used to extract pixels from the target.
|
|
140
|
+
* To free the allocated render texture and canvas render target, please call {@link destroy()}.
|
|
141
|
+
*
|
|
142
|
+
* @param options an extraction options
|
|
143
|
+
* @returns extracted Base64 data URL
|
|
144
|
+
*/
|
|
128
145
|
UtilExtract.base64 = function (options) {
|
|
129
|
-
var
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
146
|
+
var _a, _b, _c;
|
|
147
|
+
var pixels = this.pixels(options);
|
|
148
|
+
var ignorePremutipliedAlpha = (_b = (_a = options.alpha) === null || _a === void 0 ? void 0 : _a.premultiplied) === null || _b === void 0 ? void 0 : _b.ignore;
|
|
149
|
+
var scale = toScale(pixels, options);
|
|
150
|
+
var canvas = ((_c = this.WORK_CANVAS) !== null && _c !== void 0 ? _c : (this.WORK_CANVAS = new UtilExtractorCanvas(pixels.width, pixels.height)));
|
|
151
|
+
UtilExtractor.toCanvas(pixels, scale, ignorePremutipliedAlpha, canvas);
|
|
152
|
+
var element = canvas.getElement();
|
|
153
|
+
if (element != null) {
|
|
154
|
+
return UtilExtractor.toBase64(element, options.format, options.quality);
|
|
137
155
|
}
|
|
156
|
+
return "data:,";
|
|
138
157
|
};
|
|
139
158
|
UtilExtract.file = function (options) {
|
|
140
159
|
UtilFileDownloader.downloadUrl(options.filename, this.base64(options));
|
|
@@ -148,6 +167,11 @@ var UtilExtract = /** @class */ (function () {
|
|
|
148
167
|
this.WORK_RENDER_TEXTURE = undefined;
|
|
149
168
|
texture.destroy(true);
|
|
150
169
|
}
|
|
170
|
+
var canvas = this.WORK_CANVAS;
|
|
171
|
+
if (canvas != null) {
|
|
172
|
+
this.WORK_CANVAS = undefined;
|
|
173
|
+
canvas.destroy();
|
|
174
|
+
}
|
|
151
175
|
};
|
|
152
176
|
return UtilExtract;
|
|
153
177
|
}());
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util-extract.js","sourceRoot":"","sources":["../../../../src/main/typescript/wcardinal/ui/util/util-extract.ts"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,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QACpC,IAAI;YACH,OAAO,aAAa,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;SAC9E;gBAAS;YACT,IAAI,MAAM,EAAE;gBACX,MAAM,CAAC,OAAO,EAAE,CAAC;aACjB;SACD;IACF,CAAC;IAEM,gBAAI,GAAX,UAAY,OAA+B;QAC1C,kBAAkB,CAAC,WAAW,CAAC,OAAO,CAAC,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;IACxE,CAAC;IAED;;OAEG;IACI,mBAAO,GAAd;QACC,IAAM,OAAO,GAAG,IAAI,CAAC,mBAAmB,CAAC;QACzC,IAAI,OAAO,IAAI,IAAI,EAAE;YACpB,IAAI,CAAC,mBAAmB,GAAG,SAAS,CAAC;YACrC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;SACtB;IACF,CAAC;IACF,kBAAC;AAAD,CAAC,AA1GD,IA0GC","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { Matrix, Renderer, RenderTexture, SCALE_MODES, utils } from \"pixi.js\";\nimport { DApplicationLayerLike } from \"../d-application-layer-like\";\nimport { DApplicationLike } from \"../d-application-like\";\nimport { DApplications } from \"../d-applications\";\nimport { DBase } from \"../d-base\";\nimport { isNumber } from \"./is-number\";\nimport { UtilExtractor } from \"./util-extractor\";\nimport { UtilExtractorPixels } from \"./util-extractor-pixels\";\nimport { UtilFileDownloader } from \"./util-file-downloader\";\n\nexport interface UtilExtractTextureResolutionOptions {\n\tsize: number;\n}\n\nexport interface UtilExtractTextureTransformOptions {\n\tupdate?: boolean;\n}\n\nexport interface UtilExtractTextureOptions {\n\ttarget: DBase;\n\tresolution?: number | UtilExtractTextureResolutionOptions;\n\ttransform?: UtilExtractTextureTransformOptions;\n\tclear?: boolean;\n}\n\nexport interface UtilExtractPixelsOptions extends UtilExtractTextureOptions {\n\trenderer?: Renderer;\n\tapplication?: DApplicationLike;\n\tlayer?: DApplicationLayerLike;\n}\n\nexport interface UtilExtractCanvasScaleOptions {\n\tsize: number;\n}\n\nexport interface UtilExtractCanvasAlphaOptions {\n\tpremultiplied?: {\n\t\tignore?: boolean;\n\t};\n}\n\nexport interface UtilExtractCanvasOptions extends UtilExtractPixelsOptions {\n\tscale?: number | UtilExtractCanvasScaleOptions;\n\talpha?: UtilExtractCanvasAlphaOptions;\n}\n\nexport interface UtilExtractBase64Options extends UtilExtractCanvasOptions {\n\tformat?: string;\n\tquality?: number;\n}\n\nexport interface UtilExtractFileOptions extends UtilExtractBase64Options {\n\tfilename: string;\n}\n\nconst toResolution = (options: UtilExtractTextureOptions): number => {\n\tconst target = options.target;\n\tconst resolution = options.resolution;\n\tif (resolution != null) {\n\t\tif (isNumber(resolution)) {\n\t\t\treturn resolution;\n\t\t} else {\n\t\t\tconst scale = target.transform.scale;\n\t\t\tconst size = Math.max(target.width * scale.x, target.height * scale.y);\n\t\t\treturn Math.min(1, resolution.size / size);\n\t\t}\n\t} else {\n\t\treturn window.devicePixelRatio ?? 1;\n\t}\n};\n\nconst toScale = (\n\tpixels: UtilExtractorPixels,\n\toptions: UtilExtractCanvasOptions\n): number | undefined => {\n\tconst scale = options.scale;\n\tif (scale != null) {\n\t\tif (isNumber(scale)) {\n\t\t\treturn scale;\n\t\t} else {\n\t\t\tconst size = scale.size;\n\t\t\treturn Math.min(1, size / pixels.width, size / pixels.height);\n\t\t}\n\t}\n};\n\nconst toRenderer = (options: UtilExtractPixelsOptions): Renderer => {\n\tconst renderer = options.renderer;\n\tif (renderer) {\n\t\treturn renderer;\n\t}\n\tconst application = options.application;\n\tif (application) {\n\t\treturn application.getLayerBase().renderer;\n\t}\n\tconst layer = options.layer || DApplications.getLayer(options.target);\n\tif (layer) {\n\t\treturn layer.renderer;\n\t}\n\tthrow new Error(\"No renderer / application / layer found.\");\n};\n\nexport class UtilExtract {\n\tprotected static WORK_RENDER_TEXTURE?: RenderTexture;\n\n\tstatic texture(options: UtilExtractTextureOptions): RenderTexture {\n\t\tconst target = options.target;\n\t\tconst resolution = toResolution(options);\n\t\tconst skipUpdateTransform = options.transform?.update;\n\t\treturn UtilExtractor.toTexture(target, resolution, options.clear, skipUpdateTransform);\n\t}\n\n\t/**\n\t * Extracts pixels from the target.\n\t * This method internally creates one render texture and use that to extract pixels from the target.\n\t * To free the allocated render texture, please call {@link destroy()}.\n\t *\n\t * @param options an extraction options\n\t * @returns extracted pixels\n\t */\n\tstatic pixels(options: UtilExtractPixelsOptions): UtilExtractorPixels {\n\t\tconst renderer = toRenderer(options);\n\n\t\t// Create a render texture\n\t\tconst target = options.target;\n\t\tconst scale = target.transform.scale;\n\t\tconst width = Math.floor(target.width * scale.x);\n\t\tconst height = Math.floor(target.height * scale.y);\n\t\tconst resolution = toResolution(options);\n\t\tlet renderTexture = UtilExtract.WORK_RENDER_TEXTURE;\n\t\tif (renderTexture == null) {\n\t\t\trenderTexture = RenderTexture.create({\n\t\t\t\twidth,\n\t\t\t\theight,\n\t\t\t\tscaleMode: SCALE_MODES.LINEAR,\n\t\t\t\tresolution\n\t\t\t});\n\t\t\tUtilExtract.WORK_RENDER_TEXTURE = renderTexture;\n\t\t} else {\n\t\t\tconst baseTexture = renderTexture.baseTexture;\n\t\t\tconst baseTextureWidth = baseTexture.width;\n\t\t\tconst baseTextureHeight = baseTexture.height;\n\t\t\tconst isWidthDirty = baseTextureWidth < width;\n\t\t\tconst isHeightDirty = baseTextureHeight < height;\n\t\t\tconst isResolutionDirty = renderTexture.resolution !== resolution;\n\t\t\tif (isResolutionDirty || isWidthDirty || isHeightDirty) {\n\t\t\t\tif (isResolutionDirty) {\n\t\t\t\t\tbaseTexture.resolution = resolution;\n\t\t\t\t}\n\t\t\t\trenderTexture.resize(\n\t\t\t\t\tMath.max(width, baseTextureWidth),\n\t\t\t\t\tMath.max(height, baseTextureHeight),\n\t\t\t\t\ttrue\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// Render to the render texture\n\t\tconst frame = renderTexture.frame;\n\t\tif (frame.x !== 0 || frame.y !== 0 || frame.width !== width || frame.height !== height) {\n\t\t\tframe.x = 0;\n\t\t\tframe.y = 0;\n\t\t\tframe.width = width;\n\t\t\tframe.height = height;\n\t\t\trenderTexture.frame = frame;\n\t\t}\n\n\t\tconst targetPosition = target.position;\n\t\tconst matrix = new Matrix(1, 0, 0, 1, -targetPosition.x, -targetPosition.y);\n\n\t\trenderer.render(target, renderTexture, options.clear, matrix, options.transform?.update);\n\n\t\t// Extract pixels\n\t\treturn UtilExtractor.toPixels(renderTexture, renderer);\n\t}\n\n\tstatic canvas(options: UtilExtractCanvasOptions): utils.CanvasRenderTarget {\n\t\tconst pixels = this.pixels(options);\n\t\tconst ignorePremutipliedAlpha = options.alpha?.premultiplied?.ignore;\n\t\tconst scale = toScale(pixels, options);\n\t\treturn UtilExtractor.toCanvas(pixels, scale, ignorePremutipliedAlpha);\n\t}\n\n\tstatic base64(options: UtilExtractBase64Options): string {\n\t\tconst canvas = this.canvas(options);\n\t\ttry {\n\t\t\treturn UtilExtractor.toBase64(canvas.canvas, options.format, options.quality);\n\t\t} finally {\n\t\t\tif (canvas) {\n\t\t\t\tcanvas.destroy();\n\t\t\t}\n\t\t}\n\t}\n\n\tstatic file(options: UtilExtractFileOptions): void {\n\t\tUtilFileDownloader.downloadUrl(options.filename, this.base64(options));\n\t}\n\n\t/**\n\t * Clears all the memories.\n\t */\n\tstatic destroy(): void {\n\t\tconst texture = this.WORK_RENDER_TEXTURE;\n\t\tif (texture != null) {\n\t\t\tthis.WORK_RENDER_TEXTURE = undefined;\n\t\t\ttexture.destroy(true);\n\t\t}\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"util-extract.js","sourceRoot":"","sources":["../../../../src/main/typescript/wcardinal/ui/util/util-extract.ts"],"names":[],"mappings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ACrC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;SACtB;QAED,IAAM,MAAM,GAAG,IAAI,CAAC,WAAW,CAAC;QAChC,IAAI,MAAM,IAAI,IAAI,EAAE;YACnB,IAAI,CAAC,WAAW,GAAG,SAAS,CAAC;YAC7B,MAAM,CAAC,OAAO,EAAE,CAAC;SACjB;IACF,CAAC;IACF,kBAAC;AAAD,CAAC,AApID,IAoIC","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { Matrix, Renderer, RenderTexture, SCALE_MODES } from \"pixi.js\";\nimport { DApplicationLayerLike } from \"../d-application-layer-like\";\nimport { DApplicationLike } from \"../d-application-like\";\nimport { DApplications } from \"../d-applications\";\nimport { DBase } from \"../d-base\";\nimport { isNumber } from \"./is-number\";\nimport { UtilExtractor } from \"./util-extractor\";\nimport { UtilExtractorPixels } from \"./util-extractor-pixels\";\nimport { UtilFileDownloader } from \"./util-file-downloader\";\nimport { UtilExtractorCanvas } from \"./util-extractor-canvas\";\n\nexport interface UtilExtractTextureResolutionOptions {\n\tsize: number;\n}\n\nexport interface UtilExtractTextureTransformOptions {\n\tupdate?: boolean;\n}\n\nexport interface UtilExtractTextureOptions {\n\ttarget: DBase;\n\tresolution?: number | UtilExtractTextureResolutionOptions;\n\ttransform?: UtilExtractTextureTransformOptions;\n\tclear?: boolean;\n}\n\nexport interface UtilExtractPixelsOptions extends UtilExtractTextureOptions {\n\trenderer?: Renderer;\n\tapplication?: DApplicationLike;\n\tlayer?: DApplicationLayerLike;\n}\n\nexport interface UtilExtractCanvasScaleOptions {\n\tsize: number;\n}\n\nexport interface UtilExtractCanvasAlphaOptions {\n\tpremultiplied?: {\n\t\tignore?: boolean;\n\t};\n}\n\nexport interface UtilExtractCanvasOptions extends UtilExtractPixelsOptions {\n\tscale?: number | UtilExtractCanvasScaleOptions;\n\talpha?: UtilExtractCanvasAlphaOptions;\n}\n\nexport interface UtilExtractBase64Options extends UtilExtractCanvasOptions {\n\tformat?: string;\n\tquality?: number;\n}\n\nexport interface UtilExtractFileOptions extends UtilExtractBase64Options {\n\tfilename: string;\n}\n\nconst toResolution = (options: UtilExtractTextureOptions): number => {\n\tconst target = options.target;\n\tconst resolution = options.resolution;\n\tif (resolution != null) {\n\t\tif (isNumber(resolution)) {\n\t\t\treturn resolution;\n\t\t} else {\n\t\t\tconst scale = target.transform.scale;\n\t\t\tconst size = Math.max(target.width * scale.x, target.height * scale.y);\n\t\t\treturn Math.min(1, resolution.size / size);\n\t\t}\n\t} else {\n\t\treturn window.devicePixelRatio ?? 1;\n\t}\n};\n\nconst toScale = (\n\tpixels: UtilExtractorPixels,\n\toptions: UtilExtractCanvasOptions\n): number | undefined => {\n\tconst scale = options.scale;\n\tif (scale != null) {\n\t\tif (isNumber(scale)) {\n\t\t\treturn scale;\n\t\t} else {\n\t\t\tconst size = scale.size;\n\t\t\treturn Math.min(1, size / pixels.width, size / pixels.height);\n\t\t}\n\t}\n};\n\nconst toRenderer = (options: UtilExtractPixelsOptions): Renderer => {\n\tconst renderer = options.renderer;\n\tif (renderer) {\n\t\treturn renderer;\n\t}\n\tconst application = options.application;\n\tif (application) {\n\t\treturn application.getLayerBase().renderer;\n\t}\n\tconst layer = options.layer || DApplications.getLayer(options.target);\n\tif (layer) {\n\t\treturn layer.renderer;\n\t}\n\tthrow new Error(\"No renderer / application / layer found.\");\n};\n\nexport class UtilExtract {\n\tprotected static WORK_RENDER_TEXTURE?: RenderTexture;\n\tprotected static WORK_CANVAS?: UtilExtractorCanvas;\n\n\tstatic texture(options: UtilExtractTextureOptions): RenderTexture {\n\t\tconst target = options.target;\n\t\tconst resolution = toResolution(options);\n\t\tconst skipUpdateTransform = options.transform?.update;\n\t\treturn UtilExtractor.toTexture(target, resolution, options.clear, skipUpdateTransform);\n\t}\n\n\t/**\n\t * Extracts pixels from the target.\n\t * This method internally creates one render texture and use that to extract pixels from the target.\n\t * To free the allocated render texture, please call {@link destroy()}.\n\t *\n\t * @param options an extraction options\n\t * @returns extracted pixels\n\t */\n\tstatic pixels(options: UtilExtractPixelsOptions): UtilExtractorPixels {\n\t\tconst renderer = toRenderer(options);\n\n\t\t// Create a render texture\n\t\tconst target = options.target;\n\t\tconst scale = target.transform.scale;\n\t\tconst width = Math.ceil(target.width * scale.x);\n\t\tconst height = Math.ceil(target.height * scale.y);\n\t\tif (width <= 0 || height <= 0) {\n\t\t\treturn {\n\t\t\t\twidth,\n\t\t\t\theight,\n\t\t\t\tarray: new Uint8Array(0)\n\t\t\t};\n\t\t}\n\n\t\tconst resolution = toResolution(options);\n\t\tlet renderTexture = UtilExtract.WORK_RENDER_TEXTURE;\n\t\tif (renderTexture == null) {\n\t\t\trenderTexture = RenderTexture.create({\n\t\t\t\twidth,\n\t\t\t\theight,\n\t\t\t\tscaleMode: SCALE_MODES.LINEAR,\n\t\t\t\tresolution\n\t\t\t});\n\t\t\tUtilExtract.WORK_RENDER_TEXTURE = renderTexture;\n\t\t} else {\n\t\t\tconst baseTexture = renderTexture.baseTexture;\n\t\t\tconst baseTextureWidth = baseTexture.width;\n\t\t\tconst baseTextureHeight = baseTexture.height;\n\t\t\tconst isWidthDirty = baseTextureWidth < width;\n\t\t\tconst isHeightDirty = baseTextureHeight < height;\n\t\t\tconst isResolutionDirty = renderTexture.resolution !== resolution;\n\t\t\tif (isResolutionDirty || isWidthDirty || isHeightDirty) {\n\t\t\t\tif (isResolutionDirty) {\n\t\t\t\t\tbaseTexture.resolution = resolution;\n\t\t\t\t}\n\t\t\t\trenderTexture.resize(\n\t\t\t\t\tMath.max(width, baseTextureWidth),\n\t\t\t\t\tMath.max(height, baseTextureHeight),\n\t\t\t\t\ttrue\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// Render to the render texture\n\t\tconst frame = renderTexture.frame;\n\t\tif (frame.x !== 0 || frame.y !== 0 || frame.width !== width || frame.height !== height) {\n\t\t\tframe.x = 0;\n\t\t\tframe.y = 0;\n\t\t\tframe.width = width;\n\t\t\tframe.height = height;\n\t\t\trenderTexture.frame = frame;\n\t\t}\n\n\t\tconst targetPosition = target.position;\n\t\tconst matrix = new Matrix(1, 0, 0, 1, -targetPosition.x, -targetPosition.y);\n\n\t\trenderer.render(target, renderTexture, options.clear, matrix, options.transform?.update);\n\n\t\t// Extract pixels\n\t\treturn UtilExtractor.toPixels(renderTexture, renderer);\n\t}\n\n\tstatic canvas(options: UtilExtractCanvasOptions): UtilExtractorCanvas {\n\t\tconst pixels = this.pixels(options);\n\t\tconst ignorePremutipliedAlpha = options.alpha?.premultiplied?.ignore;\n\t\tconst scale = toScale(pixels, options);\n\t\treturn UtilExtractor.toCanvas(pixels, scale, ignorePremutipliedAlpha);\n\t}\n\n\t/**\n\t * Extracts Base64 data URL from the target.\n\t * This method internally creates a render texture and a canvas render target.\n\t * They are used to extract pixels from the target.\n\t * To free the allocated render texture and canvas render target, please call {@link destroy()}.\n\t *\n\t * @param options an extraction options\n\t * @returns extracted Base64 data URL\n\t */\n\tstatic base64(options: UtilExtractBase64Options): string {\n\t\tconst pixels = this.pixels(options);\n\t\tconst ignorePremutipliedAlpha = options.alpha?.premultiplied?.ignore;\n\t\tconst scale = toScale(pixels, options);\n\t\tconst canvas = (this.WORK_CANVAS ??= new UtilExtractorCanvas(pixels.width, pixels.height));\n\t\tUtilExtractor.toCanvas(pixels, scale, ignorePremutipliedAlpha, canvas);\n\t\tconst element = canvas.getElement();\n\t\tif (element != null) {\n\t\t\treturn UtilExtractor.toBase64(element, options.format, options.quality);\n\t\t}\n\t\treturn \"data:,\";\n\t}\n\n\tstatic file(options: UtilExtractFileOptions): void {\n\t\tUtilFileDownloader.downloadUrl(options.filename, this.base64(options));\n\t}\n\n\t/**\n\t * Clears all the memories.\n\t */\n\tstatic destroy(): void {\n\t\tconst texture = this.WORK_RENDER_TEXTURE;\n\t\tif (texture != null) {\n\t\t\tthis.WORK_RENDER_TEXTURE = undefined;\n\t\t\ttexture.destroy(true);\n\t\t}\n\n\t\tconst canvas = this.WORK_CANVAS;\n\t\tif (canvas != null) {\n\t\t\tthis.WORK_CANVAS = undefined;\n\t\t\tcanvas.destroy();\n\t\t}\n\t}\n}\n"]}
|