@wcardinal/wcardinal-ui 0.459.0-beta.0 → 0.459.0-beta.2
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/shape/e-shape-boundary.d.ts +10 -0
- package/dist/types/wcardinal/ui/shape/e-shape-points-formatted.d.ts +3 -3
- package/dist/types/wcardinal/ui/shape/e-shape-points-formatters.d.ts +2 -1
- package/dist/types/wcardinal/ui/shape/e-shape-points-style.d.ts +4 -2
- package/dist/types/wcardinal/ui/shape/index.d.ts +1 -0
- package/dist/types/wcardinal/ui/shape/variant/build-polygon.d.ts +4 -1
- package/dist/types/wcardinal/ui/shape/variant/e-shape-line-points.d.ts +3 -2
- package/dist/types/wcardinal/ui/shape/variant/e-shape-polygon-triangulated-impl.d.ts +5 -2
- package/dist/types/wcardinal/ui/shape/variant/e-shape-polygon-triangulated.d.ts +11 -9
- package/dist/wcardinal/ui/shape/e-shape-boundary.js +6 -0
- package/dist/wcardinal/ui/shape/e-shape-boundary.js.map +1 -0
- package/dist/wcardinal/ui/shape/e-shape-points-formatted.js.map +1 -1
- package/dist/wcardinal/ui/shape/e-shape-points-formatters.js +2 -2
- package/dist/wcardinal/ui/shape/e-shape-points-formatters.js.map +1 -1
- package/dist/wcardinal/ui/shape/e-shape-points-style.js +4 -2
- package/dist/wcardinal/ui/shape/e-shape-points-style.js.map +1 -1
- package/dist/wcardinal/ui/shape/index.js +1 -0
- package/dist/wcardinal/ui/shape/index.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/build-polygon.js +27 -36
- package/dist/wcardinal/ui/shape/variant/build-polygon.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/builder-polygon.js +1 -2
- package/dist/wcardinal/ui/shape/variant/builder-polygon.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/e-shape-line-points.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/e-shape-polygon-triangulated-impl.js +25 -9
- package/dist/wcardinal/ui/shape/variant/e-shape-polygon-triangulated-impl.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/e-shape-polygon-triangulated.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/hit-test-polygon.js +58 -34
- package/dist/wcardinal/ui/shape/variant/hit-test-polygon.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 +118 -86
- package/dist/wcardinal-ui.js +118 -86
- package/dist/wcardinal-ui.min.js +2 -2
- package/dist/wcardinal-ui.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { EShapeBoundary } from "./e-shape-boundary";
|
|
1
2
|
import { EShapePointsStyle } from "./e-shape-points-style";
|
|
2
3
|
export type EShapePointsFormatted = EShapePointsFormattedWithBoundary | EShapePointsFormattedWithoutBoundary;
|
|
3
|
-
export type EShapePointsFormattedBoundary = [number, number, number, number];
|
|
4
4
|
export interface EShapePointsFormattedWithoutBoundary {
|
|
5
5
|
length: number;
|
|
6
6
|
/** Peak length */
|
|
@@ -10,6 +10,6 @@ export interface EShapePointsFormattedWithoutBoundary {
|
|
|
10
10
|
style: EShapePointsStyle;
|
|
11
11
|
}
|
|
12
12
|
export interface EShapePointsFormattedWithBoundary extends EShapePointsFormattedWithoutBoundary {
|
|
13
|
-
boundary:
|
|
13
|
+
boundary: EShapeBoundary;
|
|
14
14
|
}
|
|
15
|
-
export declare const toPointsBoundary: (values: number[], result:
|
|
15
|
+
export declare const toPointsBoundary: (values: number[], result: EShapeBoundary) => EShapeBoundary;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { EShapePointsFormatterDatum } from "./e-shape-points-formatter-datum";
|
|
2
2
|
import { EShapePointsStyle } from "./e-shape-points-style";
|
|
3
3
|
export interface EThemeShapePointsFormatter {
|
|
4
|
+
/** @deprecated in favor of {@link getCurveBezierQuadraticLabel}. */
|
|
4
5
|
getCurveSplineLabel(): string;
|
|
5
6
|
getCurveBezierQuadraticLabel(): string;
|
|
6
7
|
}
|
|
7
8
|
export declare class EShapePointsFormatters {
|
|
8
9
|
private static data?;
|
|
9
10
|
static set(id: number, datum: EShapePointsFormatterDatum): void;
|
|
10
|
-
static get(
|
|
11
|
+
static get(id: number): EShapePointsFormatterDatum | undefined;
|
|
11
12
|
static each(iteratee: (id: number, datum: EShapePointsFormatterDatum) => void): void;
|
|
12
13
|
static find(style: EShapePointsStyle): EShapePointsFormatterDatum | undefined;
|
|
13
14
|
private static newData;
|
|
@@ -31,16 +31,18 @@ export declare const EShapePointsStyle: {
|
|
|
31
31
|
readonly DASHED_LOOSELY: 512;
|
|
32
32
|
/** @deprecated in favor of EShapeStrokeStyle. */
|
|
33
33
|
readonly DASHED_MASK: number;
|
|
34
|
-
/** @deprecated in favor of
|
|
34
|
+
/** @deprecated in favor of {@link CURVE_BEZIER_QUADRATIC}. */
|
|
35
35
|
readonly CURVE: number;
|
|
36
|
+
/** @deprecated in favor of {@link CURVE_BEZIER_QUADRATIC}. */
|
|
36
37
|
readonly CURVE_SPLINE: number;
|
|
37
38
|
readonly CURVE_BEZIER_QUADRATIC: number;
|
|
38
39
|
readonly FORMATTER_SHIFT: 10;
|
|
39
40
|
readonly FORMATTER_MASK: 1047552;
|
|
40
41
|
readonly FORMATTER_EXTENSION_LOWEST: 512;
|
|
41
42
|
readonly FORMATTER_EXTENSION_HIGHEST: 1023;
|
|
42
|
-
/** @deprecated in favor of
|
|
43
|
+
/** @deprecated in favor of {@link FORMATTER_CURVE_BEZIER_QUADRATIC}. */
|
|
43
44
|
readonly FORMATTER_CURVE: 1;
|
|
45
|
+
/** @deprecated in favor of {@link FORMATTER_CURVE_BEZIER_QUADRATIC}. */
|
|
44
46
|
readonly FORMATTER_CURVE_SPLINE: 1;
|
|
45
47
|
readonly FORMATTER_CURVE_BEZIER_QUADRATIC: 2;
|
|
46
48
|
};
|
|
@@ -10,6 +10,7 @@ export * from "./e-shape-acceptor-impl";
|
|
|
10
10
|
export * from "./e-shape-acceptor-type";
|
|
11
11
|
export * from "./e-shape-acceptor";
|
|
12
12
|
export * from "./e-shape-acceptors";
|
|
13
|
+
export * from "./e-shape-boundary";
|
|
13
14
|
export * from "./e-shape-buffer-unit-builder";
|
|
14
15
|
export * from "./e-shape-buffer-unit";
|
|
15
16
|
export * from "./e-shape-buffer";
|
|
@@ -2,6 +2,7 @@ import { Matrix, TextureUvs } from "pixi.js";
|
|
|
2
2
|
import { EShapeStrokeStyle } from "../e-shape-stroke-style";
|
|
3
3
|
import { EShapeStrokeSide } from "../e-shape-stroke-side";
|
|
4
4
|
import { EShapeFillDirection } from "../e-shape-fill-direction";
|
|
5
|
+
import { EShapeBoundary } from "../e-shape-boundary";
|
|
5
6
|
/**
|
|
6
7
|
* Build index buffer for polygons.
|
|
7
8
|
*/
|
|
@@ -13,7 +14,9 @@ export declare const buildPolygonVertex: (vertices: Float32Array, polygonVertice
|
|
|
13
14
|
/**
|
|
14
15
|
* Build step buffer for polygons.
|
|
15
16
|
*/
|
|
16
|
-
export declare const buildPolygonStep: (steps: Float32Array, polygonDistances: number[], polygonLengths: number[], polygonClippings: number[], polygonUvs: number[],
|
|
17
|
+
export declare const buildPolygonStep: (steps: Float32Array, polygonDistances: number[], polygonLengths: number[], polygonClippings: number[], polygonUvs: number[], polygonBoundary: EShapeBoundary, voffset: number, vertexCount: number, fillDirection: EShapeFillDirection, fillPercent: number, strokeWidth: number, strokeSide: EShapeStrokeSide, strokeStyle: EShapeStrokeStyle) => void;
|
|
18
|
+
export declare const buildPolygonStepX: (steps: Float32Array, polygonDistances: number[], polygonLengths: number[], polygonClippings: number[], polygonUvs: number[], voffset: number, vertexCount: number, strokeWidth: number, e: number, afp: number, fp: number) => void;
|
|
19
|
+
export declare const buildPolygonStepY: (steps: Float32Array, polygonDistances: number[], polygonLengths: number[], polygonClippings: number[], polygonUvs: number[], voffset: number, vertexCount: number, strokeWidth: number, e: number, afp: number, fp: number) => void;
|
|
17
20
|
/**
|
|
18
21
|
* Build UV buffer for polygons.
|
|
19
22
|
*/
|
|
@@ -4,11 +4,12 @@ import { EShapePoints } from "../e-shape-points";
|
|
|
4
4
|
import { EShapePointsStyle } from "../e-shape-points-style";
|
|
5
5
|
import { EShapeResourceManagerSerialization } from "../e-shape-resource-manager-serialization";
|
|
6
6
|
import { EShapePointsFormatter } from "../e-shape-points-formatter";
|
|
7
|
-
import { EShapePointsFormatted,
|
|
7
|
+
import { EShapePointsFormatted, EShapePointsFormattedWithBoundary } from "../e-shape-points-formatted";
|
|
8
8
|
import { EShapeLineBasePointsHitTester } from "./e-shape-line-base-points-hit-tester";
|
|
9
9
|
import { EShapeLineBasePointsHitTesterToRange } from "./e-shape-line-base-points-hit-tester-to-range";
|
|
10
10
|
import { EShapeResourceManagerDeserialization } from "../e-shape-resource-manager-deserialization";
|
|
11
11
|
import { EShapePointsMarkerContainer } from "../e-shape-points-marker-container";
|
|
12
|
+
import { EShapeBoundary } from "../e-shape-boundary";
|
|
12
13
|
export type EShapeLinePointsSerialized = [number[], number[], number, number?];
|
|
13
14
|
export declare class EShapeLinePoints implements EShapePoints {
|
|
14
15
|
protected static WORK_RANGE: [number, number];
|
|
@@ -53,7 +54,7 @@ export declare class EShapeLinePoints implements EShapePoints {
|
|
|
53
54
|
get formatter(): EShapePointsFormatter | null;
|
|
54
55
|
set formatter(formatter: EShapePointsFormatter | null);
|
|
55
56
|
get formatted(): EShapePointsFormatted;
|
|
56
|
-
protected toScaled(values: number[], valuesBase: number[], boundary:
|
|
57
|
+
protected toScaled(values: number[], valuesBase: number[], boundary: EShapeBoundary, boundaryBase: EShapeBoundary): void;
|
|
57
58
|
copy(source: EShapePoints): this;
|
|
58
59
|
set(newValues?: number[], newSegments?: number[], newStyle?: EShapePointsStyle): this;
|
|
59
60
|
protected toDirty(revalidate: boolean): void;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { EShapeBoundary } from "../e-shape-boundary";
|
|
1
2
|
import { EShapeResourceManagerDeserialization } from "../e-shape-resource-manager-deserialization";
|
|
2
3
|
import { EShapeResourceManagerSerialization } from "../e-shape-resource-manager-serialization";
|
|
3
4
|
import type { EShapePolygon } from "./e-shape-polygon";
|
|
4
|
-
import { EShapePolygonTriangulated } from "./e-shape-polygon-triangulated";
|
|
5
|
+
import type { EShapePolygonTriangulated } from "./e-shape-polygon-triangulated";
|
|
5
6
|
export type EShapePolygonTriangulatedExtensionSerialized = [
|
|
6
7
|
number,
|
|
7
8
|
number,
|
|
@@ -22,6 +23,7 @@ export declare class EShapePolygonTriangulatedImpl implements EShapePolygonTrian
|
|
|
22
23
|
protected _uvs: number[];
|
|
23
24
|
protected _indices: number[];
|
|
24
25
|
protected _nindices: number;
|
|
26
|
+
protected _boundary: EShapeBoundary;
|
|
25
27
|
constructor(parent: EShapePolygon);
|
|
26
28
|
get id(): number;
|
|
27
29
|
get vertices(): number[];
|
|
@@ -32,9 +34,10 @@ export declare class EShapePolygonTriangulatedImpl implements EShapePolygonTrian
|
|
|
32
34
|
get uvs(): number[];
|
|
33
35
|
get indices(): number[];
|
|
34
36
|
get nindices(): number;
|
|
37
|
+
get boundary(): EShapeBoundary;
|
|
35
38
|
set(parentPointsId?: number, vertices?: number[], distances?: number[], lengths?: number[], clippings?: number[], uvs?: number[], indices?: number[]): this;
|
|
36
39
|
protected triangulate(): void;
|
|
37
|
-
protected toUvs(vertices: number[]): number[];
|
|
40
|
+
protected toUvs(vertices: number[], boundary: EShapeBoundary): number[];
|
|
38
41
|
copy(source: EShapePolygonTriangulated): this;
|
|
39
42
|
serialize(manager: EShapeResourceManagerSerialization): number;
|
|
40
43
|
deserialize(resourceId: number, manager: EShapeResourceManagerDeserialization): void;
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
+
import { EShapeBoundary } from "../e-shape-boundary";
|
|
1
2
|
import { EShapeResourceManagerDeserialization } from "../e-shape-resource-manager-deserialization";
|
|
2
3
|
import { EShapeResourceManagerSerialization } from "../e-shape-resource-manager-serialization";
|
|
3
4
|
export interface EShapePolygonTriangulated {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
5
|
+
readonly id: number;
|
|
6
|
+
readonly vertices: number[];
|
|
7
|
+
readonly nvertices: number;
|
|
8
|
+
readonly distances: number[];
|
|
9
|
+
readonly lengths: number[];
|
|
10
|
+
readonly clippings: number[];
|
|
11
|
+
readonly uvs: number[];
|
|
12
|
+
readonly indices: number[];
|
|
13
|
+
readonly nindices: number;
|
|
14
|
+
readonly boundary: EShapeBoundary;
|
|
13
15
|
set(parentId?: number, vertices?: number[], distances?: number[], lengths?: number[], clippings?: number[], uvs?: number[], indices?: number[]): this;
|
|
14
16
|
copy(source: EShapePolygonTriangulated): this;
|
|
15
17
|
serialize(manager: EShapeResourceManagerSerialization): number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"e-shape-boundary.js","sourceRoot":"","sources":["../../../../src/main/typescript/wcardinal/ui/shape/e-shape-boundary.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport interface EShapeBoundary extends Array<number> {\n\t/** Minimum X coordinate */\n\t[0]: number;\n\t/** Minimum Y coordinate */\n\t[1]: number;\n\t/** Maximum X coordinate */\n\t[2]: number;\n\t/** Maximum Y coordinate */\n\t[3]: number;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"e-shape-points-formatted.js","sourceRoot":"","sources":["../../../../src/main/typescript/wcardinal/ui/shape/e-shape-points-formatted.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"e-shape-points-formatted.js","sourceRoot":"","sources":["../../../../src/main/typescript/wcardinal/ui/shape/e-shape-points-formatted.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAsBH,MAAM,CAAC,IAAM,gBAAgB,GAAG,UAAC,MAAgB,EAAE,MAAsB;IACxE,IAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC;IACnC,IAAI,CAAC,IAAI,YAAY,EAAE,CAAC;QACvB,IAAI,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;QACrB,IAAI,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;QACrB,IAAI,IAAI,GAAG,IAAI,CAAC;QAChB,IAAI,IAAI,GAAG,IAAI,CAAC;QAChB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;YACxD,IAAM,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;YACpB,IAAM,CAAC,GAAG,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;YACxB,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;YACzB,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;YACzB,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;YACzB,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;QAC1B,CAAC;QACD,MAAM,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;QACjB,MAAM,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;QACjB,MAAM,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;QACjB,MAAM,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;IAClB,CAAC;SAAM,CAAC;QACP,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;QACd,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;QACd,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;QACd,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IACf,CAAC;IACD,OAAO,MAAM,CAAC;AACf,CAAC,CAAC","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { EShapeBoundary } from \"./e-shape-boundary\";\nimport { EShapePointsStyle } from \"./e-shape-points-style\";\n\nexport type EShapePointsFormatted =\n\t| EShapePointsFormattedWithBoundary\n\t| EShapePointsFormattedWithoutBoundary;\n\nexport interface EShapePointsFormattedWithoutBoundary {\n\tlength: number;\n\t/** Peak length */\n\tplength: number;\n\tvalues: number[];\n\tsegments: number[];\n\tstyle: EShapePointsStyle;\n}\n\nexport interface EShapePointsFormattedWithBoundary extends EShapePointsFormattedWithoutBoundary {\n\tboundary: EShapeBoundary;\n}\n\nexport const toPointsBoundary = (values: number[], result: EShapeBoundary): EShapeBoundary => {\n\tconst valuesLength = values.length;\n\tif (2 <= valuesLength) {\n\t\tlet xmin = values[0];\n\t\tlet ymin = values[1];\n\t\tlet xmax = xmin;\n\t\tlet ymax = ymin;\n\t\tfor (let i = 2, imax = values.length; i < imax; i += 2) {\n\t\t\tconst x = values[i];\n\t\t\tconst y = values[i + 1];\n\t\t\txmin = Math.min(xmin, x);\n\t\t\tymin = Math.min(ymin, y);\n\t\t\txmax = Math.max(xmax, x);\n\t\t\tymax = Math.max(ymax, y);\n\t\t}\n\t\tresult[0] = xmin;\n\t\tresult[1] = ymin;\n\t\tresult[2] = xmax;\n\t\tresult[3] = ymax;\n\t} else {\n\t\tresult[0] = 0;\n\t\tresult[1] = 0;\n\t\tresult[2] = 0;\n\t\tresult[3] = 0;\n\t}\n\treturn result;\n};\n"]}
|
|
@@ -15,11 +15,11 @@ var EShapePointsFormatters = /** @class */ (function () {
|
|
|
15
15
|
}
|
|
16
16
|
this.data.set(id, datum);
|
|
17
17
|
};
|
|
18
|
-
EShapePointsFormatters.get = function (
|
|
18
|
+
EShapePointsFormatters.get = function (id) {
|
|
19
19
|
if (this.data == null) {
|
|
20
20
|
this.data = this.newData();
|
|
21
21
|
}
|
|
22
|
-
return this.data.get(
|
|
22
|
+
return this.data.get(id);
|
|
23
23
|
};
|
|
24
24
|
EShapePointsFormatters.each = function (iteratee) {
|
|
25
25
|
if (this.data == null) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"e-shape-points-formatters.js","sourceRoot":"","sources":["../../../../src/main/typescript/wcardinal/ui/shape/e-shape-points-formatters.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAC;AAC9E,OAAO,EAAE,yCAAyC,EAAE,MAAM,mDAAmD,CAAC;AAE9G,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"e-shape-points-formatters.js","sourceRoot":"","sources":["../../../../src/main/typescript/wcardinal/ui/shape/e-shape-points-formatters.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAC;AAC9E,OAAO,EAAE,yCAAy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,CAAC,GAAG,CAAC,iBAAiB,CAAC,sBAAsB,EAAE;YACpD,KAAK,EAAE,KAAK,CAAC,mBAAmB,EAAE;YAClC,SAAS,EAAE,0BAA0B;SACrC,CAAC,CAAC;QACH,MAAM,CAAC,GAAG,CAAC,iBAAiB,CAAC,gCAAgC,EAAE;YAC9D,KAAK,EAAE,KAAK,CAAC,4BAA4B,EAAE;YAC3C,SAAS,EAAE,yCAAyC;SACpD,CAAC,CAAC;QACH,OAAO,MAAM,CAAC;IACf,CAAC;IACF,6BAAC;AAAD,CAAC,AA7CD,IA6CC","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { DThemes } from \"../theme/d-themes\";\nimport { eShapePointsFormatterCurve } from \"./e-shape-points-formatter-curve\";\nimport { eShapePointsFormatterCurveBezierQuadratic } from \"./e-shape-points-formatter-curve-bezier-quadratic\";\nimport { EShapePointsFormatterDatum } from \"./e-shape-points-formatter-datum\";\nimport { EShapePointsStyle } from \"./e-shape-points-style\";\n\nexport interface EThemeShapePointsFormatter {\n\t/** @deprecated in favor of {@link getCurveBezierQuadraticLabel}. */\n\tgetCurveSplineLabel(): string;\n\tgetCurveBezierQuadraticLabel(): string;\n}\n\nexport class EShapePointsFormatters {\n\tprivate static data?: Map<number, EShapePointsFormatterDatum>;\n\n\tstatic set(id: number, datum: EShapePointsFormatterDatum): void {\n\t\tif (this.data == null) {\n\t\t\tthis.data = this.newData();\n\t\t}\n\t\tthis.data.set(id, datum);\n\t}\n\n\tstatic get(id: number): EShapePointsFormatterDatum | undefined {\n\t\tif (this.data == null) {\n\t\t\tthis.data = this.newData();\n\t\t}\n\t\treturn this.data.get(id);\n\t}\n\n\tstatic each(iteratee: (id: number, datum: EShapePointsFormatterDatum) => void): void {\n\t\tif (this.data == null) {\n\t\t\tthis.data = this.newData();\n\t\t}\n\t\tthis.data.forEach((datum, id) => {\n\t\t\titeratee(id, datum);\n\t\t});\n\t}\n\n\tstatic find(style: EShapePointsStyle): EShapePointsFormatterDatum | undefined {\n\t\treturn this.get(\n\t\t\t(style & EShapePointsStyle.FORMATTER_MASK) >> EShapePointsStyle.FORMATTER_SHIFT\n\t\t);\n\t}\n\n\tprivate static newData(): Map<number, EShapePointsFormatterDatum> {\n\t\tconst result = new Map<number, EShapePointsFormatterDatum>();\n\t\tconst theme = DThemes.get<EThemeShapePointsFormatter>(\"EShapePointsFormatter\");\n\t\tresult.set(EShapePointsStyle.FORMATTER_CURVE_SPLINE, {\n\t\t\tlabel: theme.getCurveSplineLabel(),\n\t\t\tformatter: eShapePointsFormatterCurve\n\t\t});\n\t\tresult.set(EShapePointsStyle.FORMATTER_CURVE_BEZIER_QUADRATIC, {\n\t\t\tlabel: theme.getCurveBezierQuadraticLabel(),\n\t\t\tformatter: eShapePointsFormatterCurveBezierQuadratic\n\t\t});\n\t\treturn result;\n\t}\n}\n"]}
|
|
@@ -53,16 +53,18 @@ export var EShapePointsStyle = {
|
|
|
53
53
|
DASHED_LOOSELY: DASHED_LOOSELY,
|
|
54
54
|
/** @deprecated in favor of EShapeStrokeStyle. */
|
|
55
55
|
DASHED_MASK: DASHED | DASHED_DENSELY | DASHED_LOOSELY,
|
|
56
|
-
/** @deprecated in favor of
|
|
56
|
+
/** @deprecated in favor of {@link CURVE_BEZIER_QUADRATIC}. */
|
|
57
57
|
CURVE: CURVE_SPLINE,
|
|
58
|
+
/** @deprecated in favor of {@link CURVE_BEZIER_QUADRATIC}. */
|
|
58
59
|
CURVE_SPLINE: CURVE_SPLINE,
|
|
59
60
|
CURVE_BEZIER_QUADRATIC: CURVE_BEZIER_QUADRATIC,
|
|
60
61
|
FORMATTER_SHIFT: FORMATTER_SHIFT,
|
|
61
62
|
FORMATTER_MASK: FORMATTER_MASK,
|
|
62
63
|
FORMATTER_EXTENSION_LOWEST: FORMATTER_EXTENSION_LOWEST,
|
|
63
64
|
FORMATTER_EXTENSION_HIGHEST: FORMATTER_EXTENSION_HIGHEST,
|
|
64
|
-
/** @deprecated in favor of
|
|
65
|
+
/** @deprecated in favor of {@link FORMATTER_CURVE_BEZIER_QUADRATIC}. */
|
|
65
66
|
FORMATTER_CURVE: FORMATTER_CURVE_SPLINE,
|
|
67
|
+
/** @deprecated in favor of {@link FORMATTER_CURVE_BEZIER_QUADRATIC}. */
|
|
66
68
|
FORMATTER_CURVE_SPLINE: FORMATTER_CURVE_SPLINE,
|
|
67
69
|
FORMATTER_CURVE_BEZIER_QUADRATIC: FORMATTER_CURVE_BEZIER_QUADRATIC
|
|
68
70
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"e-shape-points-style.js","sourceRoot":"","sources":["../../../../src/main/typescript/wcardinal/ui/shape/e-shape-points-style.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,IAAM,MAAM,GAAG,CAAC,CAAC;AAEjB,IAAM,mBAAmB,GAAG,CAAC,CAAC;AAC9B,IAAM,mBAAmB,GAAG,CAAC,CAAC;AAC9B,IAAM,wBAAwB,GAAG,CAAC,CAAC;AAEnC,IAAM,MAAM,GAAG,EAAE,CAAC;AAClB,IAAM,cAAc,GAAG,EAAE,CAAC;AAC1B,IAAM,cAAc,GAAG,EAAE,CAAC;AAE1B,IAAM,MAAM,GAAG,GAAG,CAAC;AACnB,IAAM,cAAc,GAAG,GAAG,CAAC;AAC3B,IAAM,cAAc,GAAG,GAAG,CAAC;AAE3B,IAAM,eAAe,GAAG,EAAE,CAAC;AAE3B,IAAM,cAAc,GAAG,OAAO,CAAC;AAE/B,IAAM,0BAA0B,GAAG,GAAG,CAAC;AAEvC,IAAM,2BAA2B,GAAG,IAAI,CAAC;AAEzC,IAAM,sBAAsB,GAAG,CAAC,CAAC;AACjC,IAAM,gCAAgC,GAAG,CAAC,CAAC;AAE3C,IAAM,YAAY,GAAG,sBAAsB,IAAI,eAAe,CAAC;AAC/D,IAAM,sBAAsB,GAAG,gCAAgC,IAAI,eAAe,CAAC;AAEnF;;;;;GAKG;AACH,MAAM,CAAC,IAAM,iBAAiB,GAAG;IAChC,IAAI,EAAE,CAAC;IAEP,MAAM,QAAA;IAEN,iDAAiD;IACjD,mBAAmB,qBAAA;IAEnB,iDAAiD;IACjD,mBAAmB,qBAAA;IAEnB,iDAAiD;IACjD,wBAAwB,0BAAA;IAExB,iDAAiD;IACjD,gBAAgB,EAAE,mBAAmB,GAAG,mBAAmB,GAAG,wBAAwB;IAEtF,iDAAiD;IACjD,MAAM,QAAA;IAEN,iDAAiD;IACjD,cAAc,gBAAA;IAEd,iDAAiD;IACjD,cAAc,gBAAA;IAEd,iDAAiD;IACjD,WAAW,EAAE,MAAM,GAAG,cAAc,GAAG,cAAc;IAErD,iDAAiD;IACjD,MAAM,QAAA;IAEN,iDAAiD;IACjD,cAAc,gBAAA;IAEd,iDAAiD;IACjD,cAAc,gBAAA;IAEd,iDAAiD;IACjD,WAAW,EAAE,MAAM,GAAG,cAAc,GAAG,cAAc;IAErD,
|
|
1
|
+
{"version":3,"file":"e-shape-points-style.js","sourceRoot":"","sources":["../../../../src/main/typescript/wcardinal/ui/shape/e-shape-points-style.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,IAAM,MAAM,GAAG,CAAC,CAAC;AAEjB,IAAM,mBAAmB,GAAG,CAAC,CAAC;AAC9B,IAAM,mBAAmB,GAAG,CAAC,CAAC;AAC9B,IAAM,wBAAwB,GAAG,CAAC,CAAC;AAEnC,IAAM,MAAM,GAAG,EAAE,CAAC;AAClB,IAAM,cAAc,GAAG,EAAE,CAAC;AAC1B,IAAM,cAAc,GAAG,EAAE,CAAC;AAE1B,IAAM,MAAM,GAAG,GAAG,CAAC;AACnB,IAAM,cAAc,GAAG,GAAG,CAAC;AAC3B,IAAM,cAAc,GAAG,GAAG,CAAC;AAE3B,IAAM,eAAe,GAAG,EAAE,CAAC;AAE3B,IAAM,cAAc,GAAG,OAAO,CAAC;AAE/B,IAAM,0BAA0B,GAAG,GAAG,CAAC;AAEvC,IAAM,2BAA2B,GAAG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nconst NON_SHRINKING_WIDTH = 4;\nconst NON_SCALING_DOT_AND_DASH = 8;\n\nconst DOTTED = 16;\nconst DOTTED_DENSELY = 32;\nconst DOTTED_LOOSELY = 64;\n\nconst DASHED = 128;\nconst DASHED_DENSELY = 256;\nconst DASHED_LOOSELY = 512;\n\nconst FORMATTER_SHIFT = 10;\n\nconst FORMATTER_MASK = 0xffc00;\n\nconst FORMATTER_EXTENSION_LOWEST = 512;\n\nconst FORMATTER_EXTENSION_HIGHEST = 1023;\n\nconst FORMATTER_CURVE_SPLINE = 1;\nconst FORMATTER_CURVE_BEZIER_QUADRATIC = 2;\n\nconst CURVE_SPLINE = FORMATTER_CURVE_SPLINE << FORMATTER_SHIFT;\nconst CURVE_BEZIER_QUADRATIC = FORMATTER_CURVE_BEZIER_QUADRATIC << FORMATTER_SHIFT;\n\n/**\n * EShape point style.\n *\n * * Bits 0 to 9: Bit field of styles.\n * * Bits 10 to 19: Formatter ID.\n */\nexport const EShapePointsStyle = {\n\tNONE: 0,\n\n\tCLOSED,\n\n\t/** @deprecated in favor of EShapeStrokeStyle. */\n\tNON_EXPANDING_WIDTH,\n\n\t/** @deprecated in favor of EShapeStrokeStyle. */\n\tNON_SHRINKING_WIDTH,\n\n\t/** @deprecated in favor of EShapeStrokeStyle. */\n\tNON_SCALING_DOT_AND_DASH,\n\n\t/** @deprecated in favor of EShapeStrokeStyle. */\n\tNON_SCALING_MASK: NON_EXPANDING_WIDTH | NON_SHRINKING_WIDTH | NON_SCALING_DOT_AND_DASH,\n\n\t/** @deprecated in favor of EShapeStrokeStyle. */\n\tDOTTED,\n\n\t/** @deprecated in favor of EShapeStrokeStyle. */\n\tDOTTED_DENSELY,\n\n\t/** @deprecated in favor of EShapeStrokeStyle. */\n\tDOTTED_LOOSELY,\n\n\t/** @deprecated in favor of EShapeStrokeStyle. */\n\tDOTTED_MASK: DOTTED | DOTTED_DENSELY | DOTTED_LOOSELY,\n\n\t/** @deprecated in favor of EShapeStrokeStyle. */\n\tDASHED,\n\n\t/** @deprecated in favor of EShapeStrokeStyle. */\n\tDASHED_DENSELY,\n\n\t/** @deprecated in favor of EShapeStrokeStyle. */\n\tDASHED_LOOSELY,\n\n\t/** @deprecated in favor of EShapeStrokeStyle. */\n\tDASHED_MASK: DASHED | DASHED_DENSELY | DASHED_LOOSELY,\n\n\t/** @deprecated in favor of {@link CURVE_BEZIER_QUADRATIC}. */\n\tCURVE: CURVE_SPLINE,\n\n\t/** @deprecated in favor of {@link CURVE_BEZIER_QUADRATIC}. */\n\tCURVE_SPLINE: CURVE_SPLINE,\n\n\tCURVE_BEZIER_QUADRATIC: CURVE_BEZIER_QUADRATIC,\n\n\tFORMATTER_SHIFT,\n\n\tFORMATTER_MASK,\n\n\tFORMATTER_EXTENSION_LOWEST,\n\n\tFORMATTER_EXTENSION_HIGHEST,\n\n\t/** @deprecated in favor of {@link FORMATTER_CURVE_BEZIER_QUADRATIC}. */\n\tFORMATTER_CURVE: FORMATTER_CURVE_SPLINE,\n\n\t/** @deprecated in favor of {@link FORMATTER_CURVE_BEZIER_QUADRATIC}. */\n\tFORMATTER_CURVE_SPLINE,\n\n\tFORMATTER_CURVE_BEZIER_QUADRATIC\n} as const;\n\nexport type EShapePointsStyle = number;\n"]}
|
|
@@ -14,6 +14,7 @@ export * from "./e-shape-acceptor-impl";
|
|
|
14
14
|
export * from "./e-shape-acceptor-type";
|
|
15
15
|
export * from "./e-shape-acceptor";
|
|
16
16
|
export * from "./e-shape-acceptors";
|
|
17
|
+
export * from "./e-shape-boundary";
|
|
17
18
|
export * from "./e-shape-buffer-unit-builder";
|
|
18
19
|
export * from "./e-shape-buffer-unit";
|
|
19
20
|
export * from "./e-shape-buffer";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/main/typescript/wcardinal/ui/shape/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACv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mB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qCAAqC,CAAC;AACpD,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iCAAiC,CAAC;AAChD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gCAAgC,CAAC;AAC/C,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wBAAwB,CAAC;AACvC,cAAc,WAAW,CAAC","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport * from \"./action\";\nexport * from \"./load\";\nexport * from \"./variant\";\nexport * from \"./e-shape-acceptor-edge-normal\";\nexport * from \"./e-shape-acceptor-edge-side\";\nexport * from \"./e-shape-acceptor-edge-size\";\nexport * from \"./e-shape-acceptor-edge-type\";\nexport * from \"./e-shape-acceptor-edge\";\nexport * from \"./e-shape-acceptor-impl\";\nexport * from \"./e-shape-acceptor-type\";\nexport * from \"./e-shape-acceptor\";\nexport * from \"./e-shape-acceptors\";\nexport * from \"./e-shape-buffer-unit-builder\";\nexport * from \"./e-shape-buffer-unit\";\nexport * from \"./e-shape-buffer\";\nexport * from \"./e-shape-capabilities\";\nexport * from \"./e-shape-capability-container-impl\";\nexport * from \"./e-shape-capability-container\";\nexport * from \"./e-shape-capability\";\nexport * from \"./e-shape-connector-bodies\";\nexport * from \"./e-shape-connector-body-impl\";\nexport * from \"./e-shape-connector-body\";\nexport * from \"./e-shape-connector-container-impl\";\nexport * from \"./e-shape-connector-container\";\nexport * from \"./e-shape-connector-edge-acceptor-impl\";\nexport * from \"./e-shape-connector-edge-acceptor\";\nexport * from \"./e-shape-connector-edge-container-impl\";\nexport * from \"./e-shape-connector-edge-container\";\nexport * from \"./e-shape-connector-edge-impl\";\nexport * from \"./e-shape-connector-edge\";\nexport * from \"./e-shape-connector\";\nexport * from \"./e-shape-connectors\";\nexport * from \"./e-shape-container\";\nexport * from \"./e-shape-copy-part\";\nexport * from \"./e-shape-corner\";\nexport * from \"./e-shape-data-impl\";\nexport * from \"./e-shape-data-mapper-impl\";\nexport * from \"./e-shape-data-mapper\";\nexport * from \"./e-shape-data-mapping-impl\";\nexport * from \"./e-shape-data-mapping\";\nexport * from \"./e-shape-data-scoped-impl\";\nexport * from \"./e-shape-data-scoped\";\nexport * from \"./e-shape-data-system-impl\";\nexport * from \"./e-shape-data-system\";\nexport * from \"./e-shape-data-value-extension\";\nexport * from \"./e-shape-data-value-extensions\";\nexport * from \"./e-shape-data-value-formatter\";\nexport * from \"./e-shape-data-value-impl\";\nexport * from \"./e-shape-data-value-order\";\nexport * from \"./e-shape-data-value-range-impl\";\nexport * from \"./e-shape-data-value-range\";\nexport * from \"./e-shape-data-value-scope\";\nexport * from \"./e-shape-data-value-state\";\nexport * from \"./e-shape-data-value-type\";\nexport * from \"./e-shape-data-value\";\nexport * from \"./e-shape-data\";\nexport * from \"./e-shape-defaults\";\nexport * from \"./e-shape-deserializers\";\nexport * from \"./e-shape-editor\";\nexport * from \"./e-shape-fill-direction\";\nexport * from \"./e-shape-fill\";\nexport * from \"./e-shape-gradient\";\nexport * from \"./e-shape-image-like\";\nexport * from \"./e-shape-layer-container\";\nexport * from \"./e-shape-layer-state\";\nexport * from \"./e-shape-layer\";\nexport * from \"./e-shape-layout\";\nexport * from \"./e-shape-points-formatted\";\nexport * from \"./e-shape-points-formatter-curve-bezier-quadratic\";\nexport * from \"./e-shape-points-formatter-curve\";\nexport * from \"./e-shape-points-formatter\";\nexport * from \"./e-shape-points-formatter-datum\";\nexport * from \"./e-shape-points-formatters\";\nexport * from \"./e-shape-points-marker-base\";\nexport * from \"./e-shape-points-marker-container-impl-noop\";\nexport * from \"./e-shape-points-marker-container-impl\";\nexport * from \"./e-shape-points-marker-container\";\nexport * from \"./e-shape-points-marker-head\";\nexport * from \"./e-shape-points-marker-noop\";\nexport * from \"./e-shape-points-marker-tail\";\nexport * from \"./e-shape-points-marker-type\";\nexport * from \"./e-shape-points-marker\";\nexport * from \"./e-shape-points-style\";\nexport * from \"./e-shape-points-styles\";\nexport * from \"./e-shape-points\";\nexport * from \"./e-shape-renderer-iterator-datum\";\nexport * from \"./e-shape-renderer-iterator\";\nexport * from \"./e-shape-renderer\";\nexport * from \"./e-shape-resource-manager-deserialization-mode\";\nexport * from \"./e-shape-resource-manager-deserialization\";\nexport * from \"./e-shape-resource-manager-serialization\";\nexport * from \"./e-shape-runtime-impl\";\nexport * from \"./e-shape-runtime-reset\";\nexport * from \"./e-shape-runtime\";\nexport * from \"./e-shape-runtimes\";\nexport * from \"./e-shape-state-set-impl-observable\";\nexport * from \"./e-shape-state-set\";\nexport * from \"./e-shape-state\";\nexport * from \"./e-shape-stroke-side\";\nexport * from \"./e-shape-stroke-style\";\nexport * from \"./e-shape-stroke\";\nexport * from \"./e-shape-text-align-horizontal\";\nexport * from \"./e-shape-text-align-vertical\";\nexport * from \"./e-shape-text-align\";\nexport * from \"./e-shape-text-direction\";\nexport * from \"./e-shape-text-offset\";\nexport * from \"./e-shape-text-outline\";\nexport * from \"./e-shape-text\";\nexport * from \"./e-shape-transform-parent\";\nexport * from \"./e-shape-transform\";\nexport * from \"./e-shape-type\";\nexport * from \"./e-shape-uploaded-constructor\";\nexport * from \"./e-shape-uploaded\";\nexport * from \"./e-shape-uploadeds\";\nexport * from \"./e-shape-uuid-mapping-impl\";\nexport * from \"./e-shape-uuid-mapping\";\nexport * from \"./e-shape\";\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/main/typescript/wcardinal/ui/shape/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,gCAAgC,CAAC;AAC/C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,qCAAqC,CAAC;AACpD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,sBAAsB,CAAC;AACrC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,0BAA0B,CAAC;AACzC,cAAc,oCAAoC,CAAC;AACnD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,wCAAwC,CAAC;AACvD,cAAc,mCAAmC,CAAC;AAClD,cAAc,yCAAyC,CAAC;AACxD,cAAc,oCAAoC,CAAC;AACnD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AACtC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAA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6BAA6B,CAAC;AAC5C,cAAc,oBAAoB,CAAC;AACnC,cAAc,iDAAiD,CAAC;AAChE,cAAc,4CAA4C,CAAC;AAC3D,cAAc,0CAA0C,CAAC;AACzD,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qCAAqC,CAAC;AACpD,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iCAAiC,CAAC;AAChD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gCAAgC,CAAC;AAC/C,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wBAAwB,CAAC;AACvC,cAAc,WAAW,CAAC","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport * from \"./action\";\nexport * from \"./load\";\nexport * from \"./variant\";\nexport * from \"./e-shape-acceptor-edge-normal\";\nexport * from \"./e-shape-acceptor-edge-side\";\nexport * from \"./e-shape-acceptor-edge-size\";\nexport * from \"./e-shape-acceptor-edge-type\";\nexport * from \"./e-shape-acceptor-edge\";\nexport * from \"./e-shape-acceptor-impl\";\nexport * from \"./e-shape-acceptor-type\";\nexport * from \"./e-shape-acceptor\";\nexport * from \"./e-shape-acceptors\";\nexport * from \"./e-shape-boundary\";\nexport * from \"./e-shape-buffer-unit-builder\";\nexport * from \"./e-shape-buffer-unit\";\nexport * from \"./e-shape-buffer\";\nexport * from \"./e-shape-capabilities\";\nexport * from \"./e-shape-capability-container-impl\";\nexport * from \"./e-shape-capability-container\";\nexport * from \"./e-shape-capability\";\nexport * from \"./e-shape-connector-bodies\";\nexport * from \"./e-shape-connector-body-impl\";\nexport * from \"./e-shape-connector-body\";\nexport * from \"./e-shape-connector-container-impl\";\nexport * from \"./e-shape-connector-container\";\nexport * from \"./e-shape-connector-edge-acceptor-impl\";\nexport * from \"./e-shape-connector-edge-acceptor\";\nexport * from \"./e-shape-connector-edge-container-impl\";\nexport * from \"./e-shape-connector-edge-container\";\nexport * from \"./e-shape-connector-edge-impl\";\nexport * from \"./e-shape-connector-edge\";\nexport * from \"./e-shape-connector\";\nexport * from \"./e-shape-connectors\";\nexport * from \"./e-shape-container\";\nexport * from \"./e-shape-copy-part\";\nexport * from \"./e-shape-corner\";\nexport * from \"./e-shape-data-impl\";\nexport * from \"./e-shape-data-mapper-impl\";\nexport * from \"./e-shape-data-mapper\";\nexport * from \"./e-shape-data-mapping-impl\";\nexport * from \"./e-shape-data-mapping\";\nexport * from \"./e-shape-data-scoped-impl\";\nexport * from \"./e-shape-data-scoped\";\nexport * from \"./e-shape-data-system-impl\";\nexport * from \"./e-shape-data-system\";\nexport * from \"./e-shape-data-value-extension\";\nexport * from \"./e-shape-data-value-extensions\";\nexport * from \"./e-shape-data-value-formatter\";\nexport * from \"./e-shape-data-value-impl\";\nexport * from \"./e-shape-data-value-order\";\nexport * from \"./e-shape-data-value-range-impl\";\nexport * from \"./e-shape-data-value-range\";\nexport * from \"./e-shape-data-value-scope\";\nexport * from \"./e-shape-data-value-state\";\nexport * from \"./e-shape-data-value-type\";\nexport * from \"./e-shape-data-value\";\nexport * from \"./e-shape-data\";\nexport * from \"./e-shape-defaults\";\nexport * from \"./e-shape-deserializers\";\nexport * from \"./e-shape-editor\";\nexport * from \"./e-shape-fill-direction\";\nexport * from \"./e-shape-fill\";\nexport * from \"./e-shape-gradient\";\nexport * from \"./e-shape-image-like\";\nexport * from \"./e-shape-layer-container\";\nexport * from \"./e-shape-layer-state\";\nexport * from \"./e-shape-layer\";\nexport * from \"./e-shape-layout\";\nexport * from \"./e-shape-points-formatted\";\nexport * from \"./e-shape-points-formatter-curve-bezier-quadratic\";\nexport * from \"./e-shape-points-formatter-curve\";\nexport * from \"./e-shape-points-formatter\";\nexport * from \"./e-shape-points-formatter-datum\";\nexport * from \"./e-shape-points-formatters\";\nexport * from \"./e-shape-points-marker-base\";\nexport * from \"./e-shape-points-marker-container-impl-noop\";\nexport * from \"./e-shape-points-marker-container-impl\";\nexport * from \"./e-shape-points-marker-container\";\nexport * from \"./e-shape-points-marker-head\";\nexport * from \"./e-shape-points-marker-noop\";\nexport * from \"./e-shape-points-marker-tail\";\nexport * from \"./e-shape-points-marker-type\";\nexport * from \"./e-shape-points-marker\";\nexport * from \"./e-shape-points-style\";\nexport * from \"./e-shape-points-styles\";\nexport * from \"./e-shape-points\";\nexport * from \"./e-shape-renderer-iterator-datum\";\nexport * from \"./e-shape-renderer-iterator\";\nexport * from \"./e-shape-renderer\";\nexport * from \"./e-shape-resource-manager-deserialization-mode\";\nexport * from \"./e-shape-resource-manager-deserialization\";\nexport * from \"./e-shape-resource-manager-serialization\";\nexport * from \"./e-shape-runtime-impl\";\nexport * from \"./e-shape-runtime-reset\";\nexport * from \"./e-shape-runtime\";\nexport * from \"./e-shape-runtimes\";\nexport * from \"./e-shape-state-set-impl-observable\";\nexport * from \"./e-shape-state-set\";\nexport * from \"./e-shape-state\";\nexport * from \"./e-shape-stroke-side\";\nexport * from \"./e-shape-stroke-style\";\nexport * from \"./e-shape-stroke\";\nexport * from \"./e-shape-text-align-horizontal\";\nexport * from \"./e-shape-text-align-vertical\";\nexport * from \"./e-shape-text-align\";\nexport * from \"./e-shape-text-direction\";\nexport * from \"./e-shape-text-offset\";\nexport * from \"./e-shape-text-outline\";\nexport * from \"./e-shape-text\";\nexport * from \"./e-shape-transform-parent\";\nexport * from \"./e-shape-transform\";\nexport * from \"./e-shape-type\";\nexport * from \"./e-shape-uploaded-constructor\";\nexport * from \"./e-shape-uploaded\";\nexport * from \"./e-shape-uploadeds\";\nexport * from \"./e-shape-uuid-mapping-impl\";\nexport * from \"./e-shape-uuid-mapping\";\nexport * from \"./e-shape\";\n"]}
|
|
@@ -37,58 +37,49 @@ export var buildPolygonVertex = function (vertices, polygonVertices, voffset, in
|
|
|
37
37
|
/**
|
|
38
38
|
* Build step buffer for polygons.
|
|
39
39
|
*/
|
|
40
|
-
export var buildPolygonStep = function (steps, polygonDistances, polygonLengths, polygonClippings, polygonUvs, voffset, vertexCount,
|
|
40
|
+
export var buildPolygonStep = function (steps, polygonDistances, polygonLengths, polygonClippings, polygonUvs, polygonBoundary, voffset, vertexCount, fillDirection, fillPercent, strokeWidth, strokeSide, strokeStyle) {
|
|
41
41
|
var scaleInvariant = toScaleInvariant(strokeStyle);
|
|
42
42
|
var dash = toDash(strokeStyle);
|
|
43
43
|
var w = (strokeSide & EShapeStrokeSide.ALL) === EShapeStrokeSide.ALL ? 1 : 0;
|
|
44
44
|
var e = toPackedI4x64(7 + dash, scaleInvariant, w, 0);
|
|
45
45
|
var fp = Math.max(0, Math.min(1, fillPercent));
|
|
46
|
-
var ax = Math.abs(sizeX);
|
|
47
|
-
var ay = Math.abs(sizeY);
|
|
48
|
-
var is = voffset * 6 - 1;
|
|
49
46
|
switch (fillDirection) {
|
|
50
47
|
case EShapeFillDirection.TOP:
|
|
51
|
-
|
|
52
|
-
steps[++is] = strokeWidth;
|
|
53
|
-
steps[++is] = e;
|
|
54
|
-
steps[++is] = polygonDistances[i];
|
|
55
|
-
steps[++is] = ay * (fp - polygonUvs[j]);
|
|
56
|
-
steps[++is] = toPackedF2x1024(polygonClippings[i], 0);
|
|
57
|
-
steps[++is] = polygonLengths[i];
|
|
58
|
-
}
|
|
48
|
+
buildPolygonStepY(steps, polygonDistances, polygonLengths, polygonClippings, polygonUvs, voffset, vertexCount, strokeWidth, e, polygonBoundary[3] - polygonBoundary[1], fp);
|
|
59
49
|
break;
|
|
60
50
|
case EShapeFillDirection.RIGHT:
|
|
61
|
-
|
|
62
|
-
steps[++is] = strokeWidth;
|
|
63
|
-
steps[++is] = e;
|
|
64
|
-
steps[++is] = polygonDistances[i];
|
|
65
|
-
steps[++is] = ax * (fp - polygonUvs[j]);
|
|
66
|
-
steps[++is] = toPackedF2x1024(polygonClippings[i], 0);
|
|
67
|
-
steps[++is] = polygonLengths[i];
|
|
68
|
-
}
|
|
51
|
+
buildPolygonStepX(steps, polygonDistances, polygonLengths, polygonClippings, polygonUvs, voffset, vertexCount, strokeWidth, e, polygonBoundary[0] - polygonBoundary[2], 1 - fp);
|
|
69
52
|
break;
|
|
70
53
|
case EShapeFillDirection.BOTTOM:
|
|
71
|
-
|
|
72
|
-
steps[++is] = strokeWidth;
|
|
73
|
-
steps[++is] = e;
|
|
74
|
-
steps[++is] = polygonDistances[i];
|
|
75
|
-
steps[++is] = ay * (fp - (1 - polygonUvs[j]));
|
|
76
|
-
steps[++is] = toPackedF2x1024(polygonClippings[i], 0);
|
|
77
|
-
steps[++is] = polygonLengths[i];
|
|
78
|
-
}
|
|
54
|
+
buildPolygonStepY(steps, polygonDistances, polygonLengths, polygonClippings, polygonUvs, voffset, vertexCount, strokeWidth, e, polygonBoundary[1] - polygonBoundary[3], 1 - fp);
|
|
79
55
|
break;
|
|
80
56
|
case EShapeFillDirection.LEFT:
|
|
81
|
-
|
|
82
|
-
steps[++is] = strokeWidth;
|
|
83
|
-
steps[++is] = e;
|
|
84
|
-
steps[++is] = polygonDistances[i];
|
|
85
|
-
steps[++is] = ax * (fp - (1 - polygonUvs[j]));
|
|
86
|
-
steps[++is] = toPackedF2x1024(polygonClippings[i], 0);
|
|
87
|
-
steps[++is] = polygonLengths[i];
|
|
88
|
-
}
|
|
57
|
+
buildPolygonStepX(steps, polygonDistances, polygonLengths, polygonClippings, polygonUvs, voffset, vertexCount, strokeWidth, e, polygonBoundary[2] - polygonBoundary[0], fp);
|
|
89
58
|
break;
|
|
90
59
|
}
|
|
91
60
|
};
|
|
61
|
+
export var buildPolygonStepX = function (steps, polygonDistances, polygonLengths, polygonClippings, polygonUvs, voffset, vertexCount, strokeWidth, e, afp, fp) {
|
|
62
|
+
var is = voffset * 6 - 1;
|
|
63
|
+
for (var i = 0, j = 0; i < vertexCount; i += 1, j += 2) {
|
|
64
|
+
steps[++is] = strokeWidth;
|
|
65
|
+
steps[++is] = e;
|
|
66
|
+
steps[++is] = polygonDistances[i];
|
|
67
|
+
steps[++is] = afp * (fp - polygonUvs[j]);
|
|
68
|
+
steps[++is] = toPackedF2x1024(polygonClippings[i], 0);
|
|
69
|
+
steps[++is] = polygonLengths[i];
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
export var buildPolygonStepY = function (steps, polygonDistances, polygonLengths, polygonClippings, polygonUvs, voffset, vertexCount, strokeWidth, e, afp, fp) {
|
|
73
|
+
var is = voffset * 6 - 1;
|
|
74
|
+
for (var i = 0, j = 1; i < vertexCount; i += 1, j += 2) {
|
|
75
|
+
steps[++is] = strokeWidth;
|
|
76
|
+
steps[++is] = e;
|
|
77
|
+
steps[++is] = polygonDistances[i];
|
|
78
|
+
steps[++is] = afp * (fp - polygonUvs[j]);
|
|
79
|
+
steps[++is] = toPackedF2x1024(polygonClippings[i], 0);
|
|
80
|
+
steps[++is] = polygonLengths[i];
|
|
81
|
+
}
|
|
82
|
+
};
|
|
92
83
|
/**
|
|
93
84
|
* Build UV buffer for polygons.
|
|
94
85
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-polygon.js","sourceRoot":"","sources":["../../../../../src/main/typescript/wcardinal/ui/shape/variant/build-polygon.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAA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: Apache-2.0\n */\n\nimport { Matrix, TextureUvs } from \"pixi.js\";\nimport { EShapeStrokeStyle } from \"../e-shape-stroke-style\";\nimport { toPackedF2x1024, toPackedI4x64 } from \"./to-packed\";\nimport { toScaleInvariant } from \"./to-scale-invariant\";\nimport { EShapeStrokeSide } from \"../e-shape-stroke-side\";\nimport { toDash } from \"./to-dash\";\nimport { EShapeFillDirection } from \"../e-shape-fill-direction\";\n\n/**\n * Build index buffer for polygons.\n */\nexport const buildPolygonIndex = (\n\tindices: Uint16Array | Uint32Array,\n\tpolygonIndices: number[],\n\tvoffset: number,\n\tioffset: number\n): void => {\n\tlet ii = ioffset * 3 - 1;\n\tfor (let i = 0, n = polygonIndices.length; i < n; ++i) {\n\t\tindices[++ii] = voffset + polygonIndices[i];\n\t}\n};\n\n/**\n * Build vertices buffer for polygons.\n */\nexport const buildPolygonVertex = (\n\tvertices: Float32Array,\n\tpolygonVertices: number[],\n\tvoffset: number,\n\tinternalTransform: Matrix\n): void => {\n\tconst a = internalTransform.a;\n\tconst b = internalTransform.b;\n\tconst c = internalTransform.c;\n\tconst d = internalTransform.d;\n\tconst tx = internalTransform.tx;\n\tconst ty = internalTransform.ty;\n\tlet iv = (voffset << 1) - 1;\n\tfor (let i = 0, n = polygonVertices.length; i < n; i += 2) {\n\t\tconst x = polygonVertices[i];\n\t\tconst y = polygonVertices[i + 1];\n\t\tvertices[++iv] = a * x + c * y + tx;\n\t\tvertices[++iv] = b * x + d * y + ty;\n\t}\n};\n\n/**\n * Build step buffer for polygons.\n */\nexport const buildPolygonStep = (\n\tsteps: Float32Array,\n\tpolygonDistances: number[],\n\tpolygonLengths: number[],\n\tpolygonClippings: number[],\n\tpolygonUvs: number[],\n\tvoffset: number,\n\tvertexCount: number,\n\tsizeX: number,\n\tsizeY: number,\n\tfillDirection: EShapeFillDirection,\n\tfillPercent: number,\n\tstrokeWidth: number,\n\tstrokeSide: EShapeStrokeSide,\n\tstrokeStyle: EShapeStrokeStyle\n): void => {\n\tconst scaleInvariant = toScaleInvariant(strokeStyle);\n\tconst dash = toDash(strokeStyle);\n\tconst w = (strokeSide & EShapeStrokeSide.ALL) === EShapeStrokeSide.ALL ? 1 : 0;\n\tconst e = toPackedI4x64(7 + dash, scaleInvariant, w, 0);\n\tconst fp = Math.max(0, Math.min(1, fillPercent));\n\tconst ax = Math.abs(sizeX);\n\tconst ay = Math.abs(sizeY);\n\tlet is = voffset * 6 - 1;\n\tswitch (fillDirection) {\n\t\tcase EShapeFillDirection.TOP:\n\t\t\tfor (let i = 0, j = 1; i < vertexCount; i += 1, j += 2) {\n\t\t\t\tsteps[++is] = strokeWidth;\n\t\t\t\tsteps[++is] = e;\n\t\t\t\tsteps[++is] = polygonDistances[i];\n\t\t\t\tsteps[++is] = ay * (fp - polygonUvs[j]);\n\t\t\t\tsteps[++is] = toPackedF2x1024(polygonClippings[i], 0);\n\t\t\t\tsteps[++is] = polygonLengths[i];\n\t\t\t}\n\t\t\tbreak;\n\t\tcase EShapeFillDirection.RIGHT:\n\t\t\tfor (let i = 0, j = 0; i < vertexCount; i += 1, j += 2) {\n\t\t\t\tsteps[++is] = strokeWidth;\n\t\t\t\tsteps[++is] = e;\n\t\t\t\tsteps[++is] = polygonDistances[i];\n\t\t\t\tsteps[++is] = ax * (fp - polygonUvs[j]);\n\t\t\t\tsteps[++is] = toPackedF2x1024(polygonClippings[i], 0);\n\t\t\t\tsteps[++is] = polygonLengths[i];\n\t\t\t}\n\t\t\tbreak;\n\t\tcase EShapeFillDirection.BOTTOM:\n\t\t\tfor (let i = 0, j = 1; i < vertexCount; i += 1, j += 2) {\n\t\t\t\tsteps[++is] = strokeWidth;\n\t\t\t\tsteps[++is] = e;\n\t\t\t\tsteps[++is] = polygonDistances[i];\n\t\t\t\tsteps[++is] = ay * (fp - (1 - polygonUvs[j]));\n\t\t\t\tsteps[++is] = toPackedF2x1024(polygonClippings[i], 0);\n\t\t\t\tsteps[++is] = polygonLengths[i];\n\t\t\t}\n\t\t\tbreak;\n\t\tcase EShapeFillDirection.LEFT:\n\t\t\tfor (let i = 0, j = 0; i < vertexCount; i += 1, j += 2) {\n\t\t\t\tsteps[++is] = strokeWidth;\n\t\t\t\tsteps[++is] = e;\n\t\t\t\tsteps[++is] = polygonDistances[i];\n\t\t\t\tsteps[++is] = ax * (fp - (1 - polygonUvs[j]));\n\t\t\t\tsteps[++is] = toPackedF2x1024(polygonClippings[i], 0);\n\t\t\t\tsteps[++is] = polygonLengths[i];\n\t\t\t}\n\t\t\tbreak;\n\t}\n};\n\n/**\n * Build UV buffer for polygons.\n */\nexport const buildPolygonUv = (\n\tuvs: Float32Array,\n\tpolygonUvs: number[],\n\tvoffset: number,\n\ttextureUvs: TextureUvs\n): void => {\n\tconst x0 = textureUvs.x0;\n\tconst x1 = textureUvs.x1;\n\tconst y0 = textureUvs.y0;\n\tconst y3 = textureUvs.y3;\n\tconst dx = x1 - x0;\n\tconst dy = y3 - y0;\n\tlet iuv = (voffset << 1) - 1;\n\tfor (let i = 0, n = polygonUvs.length; i < n; i += 2) {\n\t\tuvs[++iuv] = x0 + polygonUvs[i] * dx;\n\t\tuvs[++iuv] = y0 + polygonUvs[i + 1] * dy;\n\t}\n};\n"]}
|
|
1
|
+
{"version":3,"file":"build-polygon.js","sourceRoot":"","sources":["../../../../../src/main/typescript/wcardinal/ui/shape/variant/build-polygon.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAGhE;;GAEG;AACH,MAAM,CAAC,IAAM,iBAAiB,GAAG,UAChC,OAAkC,EAClC,cAAwB,EACxB,OAAe,EACf,O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AEtB,IAAM,EAAE,GAAG,UAAU,CAAC,EAAE,CAAC;IACzB,IAAM,EAAE,GAAG,UAAU,CAAC,EAAE,CAAC;IACzB,IAAM,EAAE,GAAG,UAAU,CAAC,EAAE,CAAC;IACzB,IAAM,EAAE,GAAG,UAAU,CAAC,EAAE,CAAC;IACzB,IAAM,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;IACnB,IAAM,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;IACnB,IAAI,GAAG,GAAG,CAAC,OAAO,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;IAC7B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;QACtD,GAAG,CAAC,EAAE,GAAG,CAAC,GAAG,EAAE,GAAG,UAAU,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC;QACrC,GAAG,CAAC,EAAE,GAAG,CAAC,GAAG,EAAE,GAAG,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC;IAC1C,CAAC;AACF,CAAC,CAAC","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { Matrix, TextureUvs } from \"pixi.js\";\nimport { EShapeStrokeStyle } from \"../e-shape-stroke-style\";\nimport { toPackedF2x1024, toPackedI4x64 } from \"./to-packed\";\nimport { toScaleInvariant } from \"./to-scale-invariant\";\nimport { EShapeStrokeSide } from \"../e-shape-stroke-side\";\nimport { toDash } from \"./to-dash\";\nimport { EShapeFillDirection } from \"../e-shape-fill-direction\";\nimport { EShapeBoundary } from \"../e-shape-boundary\";\n\n/**\n * Build index buffer for polygons.\n */\nexport const buildPolygonIndex = (\n\tindices: Uint16Array | Uint32Array,\n\tpolygonIndices: number[],\n\tvoffset: number,\n\tioffset: number\n): void => {\n\tlet ii = ioffset * 3 - 1;\n\tfor (let i = 0, n = polygonIndices.length; i < n; ++i) {\n\t\tindices[++ii] = voffset + polygonIndices[i];\n\t}\n};\n\n/**\n * Build vertices buffer for polygons.\n */\nexport const buildPolygonVertex = (\n\tvertices: Float32Array,\n\tpolygonVertices: number[],\n\tvoffset: number,\n\tinternalTransform: Matrix\n): void => {\n\tconst a = internalTransform.a;\n\tconst b = internalTransform.b;\n\tconst c = internalTransform.c;\n\tconst d = internalTransform.d;\n\tconst tx = internalTransform.tx;\n\tconst ty = internalTransform.ty;\n\tlet iv = (voffset << 1) - 1;\n\tfor (let i = 0, n = polygonVertices.length; i < n; i += 2) {\n\t\tconst x = polygonVertices[i];\n\t\tconst y = polygonVertices[i + 1];\n\t\tvertices[++iv] = a * x + c * y + tx;\n\t\tvertices[++iv] = b * x + d * y + ty;\n\t}\n};\n\n/**\n * Build step buffer for polygons.\n */\nexport const buildPolygonStep = (\n\tsteps: Float32Array,\n\tpolygonDistances: number[],\n\tpolygonLengths: number[],\n\tpolygonClippings: number[],\n\tpolygonUvs: number[],\n\tpolygonBoundary: EShapeBoundary,\n\tvoffset: number,\n\tvertexCount: number,\n\tfillDirection: EShapeFillDirection,\n\tfillPercent: number,\n\tstrokeWidth: number,\n\tstrokeSide: EShapeStrokeSide,\n\tstrokeStyle: EShapeStrokeStyle\n): void => {\n\tconst scaleInvariant = toScaleInvariant(strokeStyle);\n\tconst dash = toDash(strokeStyle);\n\tconst w = (strokeSide & EShapeStrokeSide.ALL) === EShapeStrokeSide.ALL ? 1 : 0;\n\tconst e = toPackedI4x64(7 + dash, scaleInvariant, w, 0);\n\tconst fp = Math.max(0, Math.min(1, fillPercent));\n\tswitch (fillDirection) {\n\t\tcase EShapeFillDirection.TOP:\n\t\t\tbuildPolygonStepY(\n\t\t\t\tsteps,\n\t\t\t\tpolygonDistances,\n\t\t\t\tpolygonLengths,\n\t\t\t\tpolygonClippings,\n\t\t\t\tpolygonUvs,\n\t\t\t\tvoffset,\n\t\t\t\tvertexCount,\n\t\t\t\tstrokeWidth,\n\t\t\t\te,\n\t\t\t\tpolygonBoundary[3] - polygonBoundary[1],\n\t\t\t\tfp\n\t\t\t);\n\t\t\tbreak;\n\t\tcase EShapeFillDirection.RIGHT:\n\t\t\tbuildPolygonStepX(\n\t\t\t\tsteps,\n\t\t\t\tpolygonDistances,\n\t\t\t\tpolygonLengths,\n\t\t\t\tpolygonClippings,\n\t\t\t\tpolygonUvs,\n\t\t\t\tvoffset,\n\t\t\t\tvertexCount,\n\t\t\t\tstrokeWidth,\n\t\t\t\te,\n\t\t\t\tpolygonBoundary[0] - polygonBoundary[2],\n\t\t\t\t1 - fp\n\t\t\t);\n\t\t\tbreak;\n\t\tcase EShapeFillDirection.BOTTOM:\n\t\t\tbuildPolygonStepY(\n\t\t\t\tsteps,\n\t\t\t\tpolygonDistances,\n\t\t\t\tpolygonLengths,\n\t\t\t\tpolygonClippings,\n\t\t\t\tpolygonUvs,\n\t\t\t\tvoffset,\n\t\t\t\tvertexCount,\n\t\t\t\tstrokeWidth,\n\t\t\t\te,\n\t\t\t\tpolygonBoundary[1] - polygonBoundary[3],\n\t\t\t\t1 - fp\n\t\t\t);\n\t\t\tbreak;\n\t\tcase EShapeFillDirection.LEFT:\n\t\t\tbuildPolygonStepX(\n\t\t\t\tsteps,\n\t\t\t\tpolygonDistances,\n\t\t\t\tpolygonLengths,\n\t\t\t\tpolygonClippings,\n\t\t\t\tpolygonUvs,\n\t\t\t\tvoffset,\n\t\t\t\tvertexCount,\n\t\t\t\tstrokeWidth,\n\t\t\t\te,\n\t\t\t\tpolygonBoundary[2] - polygonBoundary[0],\n\t\t\t\tfp\n\t\t\t);\n\t\t\tbreak;\n\t}\n};\n\nexport const buildPolygonStepX = (\n\tsteps: Float32Array,\n\tpolygonDistances: number[],\n\tpolygonLengths: number[],\n\tpolygonClippings: number[],\n\tpolygonUvs: number[],\n\tvoffset: number,\n\tvertexCount: number,\n\tstrokeWidth: number,\n\te: number,\n\tafp: number,\n\tfp: number\n): void => {\n\tlet is = voffset * 6 - 1;\n\tfor (let i = 0, j = 0; i < vertexCount; i += 1, j += 2) {\n\t\tsteps[++is] = strokeWidth;\n\t\tsteps[++is] = e;\n\t\tsteps[++is] = polygonDistances[i];\n\t\tsteps[++is] = afp * (fp - polygonUvs[j]);\n\t\tsteps[++is] = toPackedF2x1024(polygonClippings[i], 0);\n\t\tsteps[++is] = polygonLengths[i];\n\t}\n};\n\nexport const buildPolygonStepY = (\n\tsteps: Float32Array,\n\tpolygonDistances: number[],\n\tpolygonLengths: number[],\n\tpolygonClippings: number[],\n\tpolygonUvs: number[],\n\tvoffset: number,\n\tvertexCount: number,\n\tstrokeWidth: number,\n\te: number,\n\tafp: number,\n\tfp: number\n): void => {\n\tlet is = voffset * 6 - 1;\n\tfor (let i = 0, j = 1; i < vertexCount; i += 1, j += 2) {\n\t\tsteps[++is] = strokeWidth;\n\t\tsteps[++is] = e;\n\t\tsteps[++is] = polygonDistances[i];\n\t\tsteps[++is] = afp * (fp - polygonUvs[j]);\n\t\tsteps[++is] = toPackedF2x1024(polygonClippings[i], 0);\n\t\tsteps[++is] = polygonLengths[i];\n\t}\n};\n\n/**\n * Build UV buffer for polygons.\n */\nexport const buildPolygonUv = (\n\tuvs: Float32Array,\n\tpolygonUvs: number[],\n\tvoffset: number,\n\ttextureUvs: TextureUvs\n): void => {\n\tconst x0 = textureUvs.x0;\n\tconst x1 = textureUvs.x1;\n\tconst y0 = textureUvs.y0;\n\tconst y3 = textureUvs.y3;\n\tconst dx = x1 - x0;\n\tconst dy = y3 - y0;\n\tlet iuv = (voffset << 1) - 1;\n\tfor (let i = 0, n = polygonUvs.length; i < n; i += 2) {\n\t\tuvs[++iuv] = x0 + polygonUvs[i] * dx;\n\t\tuvs[++iuv] = y0 + polygonUvs[i + 1] * dy;\n\t}\n};\n"]}
|
|
@@ -118,8 +118,7 @@ var BuilderPolygon = /** @class */ (function (_super) {
|
|
|
118
118
|
// Steps
|
|
119
119
|
if (isNotInited || isTriangulatedIdChanged || isFillChanged || isStrokeChanged) {
|
|
120
120
|
buffer.updateSteps();
|
|
121
|
-
|
|
122
|
-
buildPolygonStep(buffer.steps, triangulated.distances, triangulated.lengths, triangulated.clippings, triangulated.uvs, voffset, this.vertexCount, size.x, size.y, fillDirection, fillPercent, strokeWidth, strokeSide, strokeStyle);
|
|
121
|
+
buildPolygonStep(buffer.steps, triangulated.distances, triangulated.lengths, triangulated.clippings, triangulated.uvs, triangulated.boundary, voffset, this.vertexCount, fillDirection, fillPercent, strokeWidth, strokeSide, strokeStyle);
|
|
123
122
|
}
|
|
124
123
|
// UVs
|
|
125
124
|
if (isNotInited || isTriangulatedIdChanged || isTextureChanged) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builder-polygon.js","sourceRoot":"","sources":["../../../../../src/main/typescript/wcardinal/ui/shape/variant/builder-polygon.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAGH,OAAO,EACN,iBAAiB,EACjB,gBAAgB,EAChB,cAAc,EACd,kBAAkB,EAClB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAiB,WAAW,EAAE,MAAM,WAAW,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAE/F;IAAoC,kCAAW;IAG9C,wBACC,MAAqB,EACrB,YAAoB,EACpB,WAAmB,EACnB,WAAmB,EACnB,UAAkB;QAElB,YAAA,MAAK,YAAC,MAAM,EAAE,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,UAAU,CAAC,SAAC;QAClE,KAAI,CAAC,cAAc,GAAG,CAAC,CAAC,CAAC;;IAC1B,CAAC;IAEQ,6BAAI,GAAb;QACC,aAAa;IACd,CAAC;IAEQ,+BAAM,GAAf,UACC,MAAqB,EACrB,KA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ier: Apache-2.0\n */\n\nimport { EShape } from \"../e-shape\";\nimport {\n\tbuildPolygonIndex,\n\tbuildPolygonStep,\n\tbuildPolygonUv,\n\tbuildPolygonVertex\n} from \"./build-polygon\";\nimport { BuilderBuffer, BuilderFlag } from \"./builder\";\nimport { BuilderBase } from \"./builder-base\";\nimport { EShapePolygon } from \"./e-shape-polygon\";\nimport { toTexture, toTextureTransformId, toTextureUvs, toTransformLocalId } from \"./builders\";\n\nexport class BuilderPolygon extends BuilderBase {\n\tprotected triangulatedId: number;\n\n\tconstructor(\n\t\tbuffer: BuilderBuffer,\n\t\tvertexOffset: number,\n\t\tindexOffset: number,\n\t\tvertexCount: number,\n\t\tindexCount: number\n\t) {\n\t\tsuper(buffer, vertexOffset, indexOffset, vertexCount, indexCount);\n\t\tthis.triangulatedId = -1;\n\t}\n\n\toverride init(): void {\n\t\t// DO NOTHING\n\t}\n\n\toverride reinit(\n\t\tbuffer: BuilderBuffer,\n\t\tshape: EShape,\n\t\tvertexOffset: number,\n\t\tindexOffset: number\n\t): boolean {\n\t\tif (!(shape instanceof EShapePolygon)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst triangulated = shape.triangulated;\n\t\tconst vertexCount = triangulated.nvertices;\n\t\tconst indexCount = triangulated.nindices;\n\t\tif (\n\t\t\tthis.buffer !== buffer ||\n\t\t\tthis.vertexOffset !== vertexOffset ||\n\t\t\tthis.indexOffset !== indexOffset ||\n\t\t\tthis.vertexCount !== vertexCount ||\n\t\t\tthis.indexCount !== indexCount\n\t\t) {\n\t\t\tif (buffer.check(vertexOffset, indexOffset, vertexCount, indexCount)) {\n\t\t\t\tthis.inited = BuilderFlag.NONE;\n\t\t\t\tthis.buffer = buffer;\n\t\t\t\tthis.vertexOffset = vertexOffset;\n\t\t\t\tthis.indexOffset = indexOffset;\n\t\t\t\tthis.vertexCount = vertexCount;\n\t\t\t\tthis.indexCount = indexCount;\n\t\t\t\tthis.triangulatedId = -1;\n\t\t\t\tthis.init();\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\toverride isCompatible(shape: EShape): boolean {\n\t\tif (!(shape instanceof EShapePolygon)) {\n\t\t\treturn false;\n\t\t}\n\t\tconst triangulated = shape.triangulated;\n\t\tconst vertexCount = triangulated.nvertices;\n\t\tconst indexCount = triangulated.nindices;\n\t\treturn vertexCount === this.vertexCount && indexCount === this.indexCount;\n\t}\n\n\toverride update(shape: EShape): void {\n\t\tif (!(shape instanceof EShapePolygon)) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst buffer = this.buffer;\n\t\tthis.updateVertexStepUvAndIndex(buffer, shape);\n\t\tthis.updateColor(buffer, shape);\n\t}\n\n\tprotected updateVertexStepUvAndIndex(buffer: BuilderBuffer, shape: EShapePolygon): void {\n\t\tconst transformLocalId = toTransformLocalId(shape);\n\t\tconst isTransformChanged = this.transformLocalId !== transformLocalId;\n\n\t\t// Check if vertices/distances/clippings/indices changed\n\t\tconst triangulated = shape.triangulated;\n\t\tconst triangulatedId = triangulated.id;\n\t\tconst isTriangulatedIdChanged = this.triangulatedId !== triangulatedId;\n\n\t\tconst fill = shape.fill;\n\t\tconst fillDirection = fill.direction;\n\t\tconst fillPercent = fill.percent;\n\t\tconst isFillChanged =\n\t\t\tthis.fillDirection !== fillDirection || this.fillPercent !== fillPercent;\n\n\t\tconst stroke = shape.stroke;\n\t\tconst strokeWidth = stroke.enable ? stroke.width : 0;\n\t\tconst strokeSide = stroke.side;\n\t\tconst strokeStyle = stroke.style;\n\t\tconst isStrokeChanged =\n\t\t\tthis.strokeWidth !== strokeWidth ||\n\t\t\tthis.strokeSide !== strokeSide ||\n\t\t\tthis.strokeStyle !== strokeStyle;\n\n\t\tconst texture = toTexture(shape);\n\t\tconst textureTransformId = toTextureTransformId(texture);\n\t\tconst isTextureChanged =\n\t\t\ttexture !== this.texture || textureTransformId !== this.textureTransformId;\n\n\t\tconst isNotInited = !(this.inited & BuilderFlag.VERTEX_STEP_UV_AND_INDEX);\n\n\t\tif (\n\t\t\tisNotInited ||\n\t\t\tisTriangulatedIdChanged ||\n\t\t\tisTransformChanged ||\n\t\t\tisFillChanged ||\n\t\t\tisStrokeChanged ||\n\t\t\tisTextureChanged\n\t\t) {\n\t\t\tthis.inited |= BuilderFlag.VERTEX_STEP_UV_AND_INDEX;\n\t\t\tthis.transformLocalId = transformLocalId;\n\t\t\tthis.fillDirection = fillDirection;\n\t\t\tthis.fillPercent = fillPercent;\n\t\t\tthis.strokeWidth = strokeWidth;\n\t\t\tthis.strokeSide = strokeSide;\n\t\t\tthis.strokeStyle = strokeStyle;\n\t\t\tthis.texture = texture;\n\t\t\tthis.textureTransformId = textureTransformId;\n\t\t\tthis.triangulatedId = triangulatedId;\n\n\t\t\t// Indices\n\t\t\tif (isNotInited || isTriangulatedIdChanged) {\n\t\t\t\tbuffer.updateIndices();\n\t\t\t\tbuildPolygonIndex(\n\t\t\t\t\tbuffer.indices,\n\t\t\t\t\ttriangulated.indices,\n\t\t\t\t\tthis.vertexOffset,\n\t\t\t\t\tthis.indexOffset\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// Vertices\n\t\t\tconst voffset = this.vertexOffset;\n\t\t\tif (isNotInited || isTriangulatedIdChanged || isTransformChanged) {\n\t\t\t\tbuffer.updateVertices();\n\t\t\t\tbuildPolygonVertex(\n\t\t\t\t\tbuffer.vertices,\n\t\t\t\t\ttriangulated.vertices,\n\t\t\t\t\tvoffset,\n\t\t\t\t\tshape.transform.internalTransform\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// Steps\n\t\t\tif (isNotInited || isTriangulatedIdChanged || isFillChanged || isStrokeChanged) {\n\t\t\t\tbuffer.updateSteps();\n\t\t\t\tconst size = shape.size;\n\t\t\t\tbuildPolygonStep(\n\t\t\t\t\tbuffer.steps,\n\t\t\t\t\ttriangulated.distances,\n\t\t\t\t\ttriangulated.lengths,\n\t\t\t\t\ttriangulated.clippings,\n\t\t\t\t\ttriangulated.uvs,\n\t\t\t\t\tvoffset,\n\t\t\t\t\tthis.vertexCount,\n\t\t\t\t\tsize.x,\n\t\t\t\t\tsize.y,\n\t\t\t\t\tfillDirection,\n\t\t\t\t\tfillPercent,\n\t\t\t\t\tstrokeWidth,\n\t\t\t\t\tstrokeSide,\n\t\t\t\t\tstrokeStyle\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// UVs\n\t\t\tif (isNotInited || isTriangulatedIdChanged || isTextureChanged) {\n\t\t\t\tbuffer.updateUvs();\n\t\t\t\tbuildPolygonUv(buffer.uvs, triangulated.uvs, voffset, toTextureUvs(texture));\n\t\t\t}\n\t\t}\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"builder-polygon.js","sourceRoot":"","sources":["../../../../../src/main/typescript/wcardinal/ui/shape/variant/builder-polygon.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAGH,OAAO,EACN,iBAAiB,EACjB,gBAAgB,EAChB,cAAc,EACd,kBAAkB,EAClB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAiB,WAAW,EAAE,MAAM,WAAW,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAE/F;IAAoC,kCAAW;IAG9C,wBACC,MAAqB,EACrB,YAAoB,EACpB,WAAmB,EACnB,WAAmB,EACnB,UAAkB;QAElB,YAAA,MAAK,YAAC,MAAM,EAAE,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,UAAU,CAAC,SAAC;QAClE,KAAI,CAAC,cAAc,GAAG,CAAC,CAAC,CAAC;;IAC1B,CAAC;IAEQ,6BAAI,GAAb;QACC,aAAa;IACd,CAAC;IAEQ,+BAAM,GAAf,UACC,MAAqB,EACrB,KA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CAChB,MAAM,CAAC,OAAO,EACd,YAAY,CAAC,OAAO,EACpB,IAAI,CAAC,YAAY,EACjB,IAAI,CAAC,WAAW,CAChB,CAAC;YACH,CAAC;YAED,WAAW;YACX,IAAM,OAAO,GAAG,IAAI,CAAC,YAAY,CAAC;YAClC,IAAI,WAAW,IAAI,uBAAuB,IAAI,kBAAkB,EAAE,CAAC;gBAClE,MAAM,CAAC,cAAc,EAAE,CAAC;gBACxB,kBAAkB,CACjB,MAAM,CAAC,QAAQ,EACf,YAAY,CAAC,QAAQ,EACrB,OAAO,EACP,KAAK,CAAC,SAAS,CAAC,iBAAiB,CACjC,CAAC;YACH,CAAC;YAED,QAAQ;YACR,IAAI,WAAW,IAAI,uBAAuB,IAAI,aAAa,IAAI,eAAe,EAAE,CAAC;gBAChF,MAAM,CAAC,WAAW,EAAE,CAAC;gBACrB,gBAAgB,CACf,MAAM,CAAC,KAAK,EACZ,YAAY,CAAC,SAAS,EACtB,YAAY,CAAC,OAAO,EACpB,YAAY,CAAC,SAAS,EACtB,YAAY,CAAC,GAAG,EAChB,YAAY,CAAC,QAAQ,EACrB,OAAO,EACP,IAAI,CAAC,WAAW,EAChB,aAAa,EACb,WAAW,EACX,WAAW,EACX,UAAU,EACV,WAAW,CACX,CAAC;YACH,CAAC;YAED,MAAM;YACN,IAAI,WAAW,IAAI,uBAAuB,IAAI,gBAAgB,EAAE,CAAC;gBAChE,MAAM,CAAC,SAAS,EAAE,CAAC;gBACnB,cAAc,CAAC,MAAM,CAAC,GAAG,EAAE,YAAY,CAAC,GAAG,EAAE,OAAO,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC;YAC9E,CAAC;QACF,CAAC;IACF,CAAC;IACF,qBAAC;AAAD,CAAC,AAhLD,CAAoC,WAAW,GAgL9C","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { EShape } from \"../e-shape\";\nimport {\n\tbuildPolygonIndex,\n\tbuildPolygonStep,\n\tbuildPolygonUv,\n\tbuildPolygonVertex\n} from \"./build-polygon\";\nimport { BuilderBuffer, BuilderFlag } from \"./builder\";\nimport { BuilderBase } from \"./builder-base\";\nimport { EShapePolygon } from \"./e-shape-polygon\";\nimport { toTexture, toTextureTransformId, toTextureUvs, toTransformLocalId } from \"./builders\";\n\nexport class BuilderPolygon extends BuilderBase {\n\tprotected triangulatedId: number;\n\n\tconstructor(\n\t\tbuffer: BuilderBuffer,\n\t\tvertexOffset: number,\n\t\tindexOffset: number,\n\t\tvertexCount: number,\n\t\tindexCount: number\n\t) {\n\t\tsuper(buffer, vertexOffset, indexOffset, vertexCount, indexCount);\n\t\tthis.triangulatedId = -1;\n\t}\n\n\toverride init(): void {\n\t\t// DO NOTHING\n\t}\n\n\toverride reinit(\n\t\tbuffer: BuilderBuffer,\n\t\tshape: EShape,\n\t\tvertexOffset: number,\n\t\tindexOffset: number\n\t): boolean {\n\t\tif (!(shape instanceof EShapePolygon)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst triangulated = shape.triangulated;\n\t\tconst vertexCount = triangulated.nvertices;\n\t\tconst indexCount = triangulated.nindices;\n\t\tif (\n\t\t\tthis.buffer !== buffer ||\n\t\t\tthis.vertexOffset !== vertexOffset ||\n\t\t\tthis.indexOffset !== indexOffset ||\n\t\t\tthis.vertexCount !== vertexCount ||\n\t\t\tthis.indexCount !== indexCount\n\t\t) {\n\t\t\tif (buffer.check(vertexOffset, indexOffset, vertexCount, indexCount)) {\n\t\t\t\tthis.inited = BuilderFlag.NONE;\n\t\t\t\tthis.buffer = buffer;\n\t\t\t\tthis.vertexOffset = vertexOffset;\n\t\t\t\tthis.indexOffset = indexOffset;\n\t\t\t\tthis.vertexCount = vertexCount;\n\t\t\t\tthis.indexCount = indexCount;\n\t\t\t\tthis.triangulatedId = -1;\n\t\t\t\tthis.init();\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\toverride isCompatible(shape: EShape): boolean {\n\t\tif (!(shape instanceof EShapePolygon)) {\n\t\t\treturn false;\n\t\t}\n\t\tconst triangulated = shape.triangulated;\n\t\tconst vertexCount = triangulated.nvertices;\n\t\tconst indexCount = triangulated.nindices;\n\t\treturn vertexCount === this.vertexCount && indexCount === this.indexCount;\n\t}\n\n\toverride update(shape: EShape): void {\n\t\tif (!(shape instanceof EShapePolygon)) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst buffer = this.buffer;\n\t\tthis.updateVertexStepUvAndIndex(buffer, shape);\n\t\tthis.updateColor(buffer, shape);\n\t}\n\n\tprotected updateVertexStepUvAndIndex(buffer: BuilderBuffer, shape: EShapePolygon): void {\n\t\tconst transformLocalId = toTransformLocalId(shape);\n\t\tconst isTransformChanged = this.transformLocalId !== transformLocalId;\n\n\t\t// Check if vertices/distances/clippings/indices changed\n\t\tconst triangulated = shape.triangulated;\n\t\tconst triangulatedId = triangulated.id;\n\t\tconst isTriangulatedIdChanged = this.triangulatedId !== triangulatedId;\n\n\t\tconst fill = shape.fill;\n\t\tconst fillDirection = fill.direction;\n\t\tconst fillPercent = fill.percent;\n\t\tconst isFillChanged =\n\t\t\tthis.fillDirection !== fillDirection || this.fillPercent !== fillPercent;\n\n\t\tconst stroke = shape.stroke;\n\t\tconst strokeWidth = stroke.enable ? stroke.width : 0;\n\t\tconst strokeSide = stroke.side;\n\t\tconst strokeStyle = stroke.style;\n\t\tconst isStrokeChanged =\n\t\t\tthis.strokeWidth !== strokeWidth ||\n\t\t\tthis.strokeSide !== strokeSide ||\n\t\t\tthis.strokeStyle !== strokeStyle;\n\n\t\tconst texture = toTexture(shape);\n\t\tconst textureTransformId = toTextureTransformId(texture);\n\t\tconst isTextureChanged =\n\t\t\ttexture !== this.texture || textureTransformId !== this.textureTransformId;\n\n\t\tconst isNotInited = !(this.inited & BuilderFlag.VERTEX_STEP_UV_AND_INDEX);\n\n\t\tif (\n\t\t\tisNotInited ||\n\t\t\tisTriangulatedIdChanged ||\n\t\t\tisTransformChanged ||\n\t\t\tisFillChanged ||\n\t\t\tisStrokeChanged ||\n\t\t\tisTextureChanged\n\t\t) {\n\t\t\tthis.inited |= BuilderFlag.VERTEX_STEP_UV_AND_INDEX;\n\t\t\tthis.transformLocalId = transformLocalId;\n\t\t\tthis.fillDirection = fillDirection;\n\t\t\tthis.fillPercent = fillPercent;\n\t\t\tthis.strokeWidth = strokeWidth;\n\t\t\tthis.strokeSide = strokeSide;\n\t\t\tthis.strokeStyle = strokeStyle;\n\t\t\tthis.texture = texture;\n\t\t\tthis.textureTransformId = textureTransformId;\n\t\t\tthis.triangulatedId = triangulatedId;\n\n\t\t\t// Indices\n\t\t\tif (isNotInited || isTriangulatedIdChanged) {\n\t\t\t\tbuffer.updateIndices();\n\t\t\t\tbuildPolygonIndex(\n\t\t\t\t\tbuffer.indices,\n\t\t\t\t\ttriangulated.indices,\n\t\t\t\t\tthis.vertexOffset,\n\t\t\t\t\tthis.indexOffset\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// Vertices\n\t\t\tconst voffset = this.vertexOffset;\n\t\t\tif (isNotInited || isTriangulatedIdChanged || isTransformChanged) {\n\t\t\t\tbuffer.updateVertices();\n\t\t\t\tbuildPolygonVertex(\n\t\t\t\t\tbuffer.vertices,\n\t\t\t\t\ttriangulated.vertices,\n\t\t\t\t\tvoffset,\n\t\t\t\t\tshape.transform.internalTransform\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// Steps\n\t\t\tif (isNotInited || isTriangulatedIdChanged || isFillChanged || isStrokeChanged) {\n\t\t\t\tbuffer.updateSteps();\n\t\t\t\tbuildPolygonStep(\n\t\t\t\t\tbuffer.steps,\n\t\t\t\t\ttriangulated.distances,\n\t\t\t\t\ttriangulated.lengths,\n\t\t\t\t\ttriangulated.clippings,\n\t\t\t\t\ttriangulated.uvs,\n\t\t\t\t\ttriangulated.boundary,\n\t\t\t\t\tvoffset,\n\t\t\t\t\tthis.vertexCount,\n\t\t\t\t\tfillDirection,\n\t\t\t\t\tfillPercent,\n\t\t\t\t\tstrokeWidth,\n\t\t\t\t\tstrokeSide,\n\t\t\t\t\tstrokeStyle\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// UVs\n\t\t\tif (isNotInited || isTriangulatedIdChanged || isTextureChanged) {\n\t\t\t\tbuffer.updateUvs();\n\t\t\t\tbuildPolygonUv(buffer.uvs, triangulated.uvs, voffset, toTextureUvs(texture));\n\t\t\t}\n\t\t}\n\t}\n}\n"]}
|