@wcardinal/wcardinal-ui 0.467.1 → 0.469.0-beta.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/d-diagram-serialized.d.ts +1 -1
- package/dist/types/wcardinal/ui/shape/e-shape-capability.d.ts +4 -0
- package/dist/types/wcardinal/ui/shape/e-shape-defaults.d.ts +2 -0
- package/dist/types/wcardinal/ui/shape/e-shape-type.d.ts +3 -0
- package/dist/types/wcardinal/ui/shape/e-shape.d.ts +1 -0
- package/dist/types/wcardinal/ui/shape/load/index.d.ts +3 -0
- package/dist/types/wcardinal/ui/shape/load/load-shape-fan.d.ts +1 -0
- package/dist/types/wcardinal/ui/shape/load/load-shape-semicircle-legacy.d.ts +1 -0
- package/dist/types/wcardinal/ui/shape/load/load-shape-triangle-rounded-legacy.d.ts +1 -0
- package/dist/types/wcardinal/ui/shape/variant/build-semicircle-legacy.d.ts +9 -0
- package/dist/types/wcardinal/ui/shape/variant/build-semicircle.d.ts +1 -9
- package/dist/types/wcardinal/ui/shape/variant/build-triangle-rounded-legacy.d.ts +10 -0
- package/dist/types/wcardinal/ui/shape/variant/build-triangle-rounded.d.ts +1 -10
- package/dist/types/wcardinal/ui/shape/variant/builder-semicircle-legacy.d.ts +10 -0
- package/dist/types/wcardinal/ui/shape/variant/builder-semicircle.d.ts +1 -10
- package/dist/types/wcardinal/ui/shape/variant/builder-triangle-rounded-legacy.d.ts +12 -0
- package/dist/types/wcardinal/ui/shape/variant/builder-triangle-rounded.d.ts +1 -12
- package/dist/types/wcardinal/ui/shape/variant/create-semicircle-legacy-uploaded.d.ts +4 -0
- package/dist/types/wcardinal/ui/shape/variant/create-semicircle-uploaded.d.ts +1 -4
- package/dist/types/wcardinal/ui/shape/variant/create-triangle-rounded-legacy-uploaded.d.ts +4 -0
- package/dist/types/wcardinal/ui/shape/variant/create-triangle-rounded-uploaded.d.ts +1 -4
- package/dist/types/wcardinal/ui/shape/variant/deserialize-fan.d.ts +4 -0
- package/dist/types/wcardinal/ui/shape/variant/deserialize-semicircle-legacy.d.ts +4 -0
- package/dist/types/wcardinal/ui/shape/variant/deserialize-triangle-rounded-legacy.d.ts +4 -0
- package/dist/types/wcardinal/ui/shape/variant/e-shape-base.d.ts +1 -0
- package/dist/types/wcardinal/ui/shape/variant/e-shape-button.d.ts +2 -1
- package/dist/types/wcardinal/ui/shape/variant/e-shape-circle-triangulated-impl.d.ts +2 -0
- package/dist/types/wcardinal/ui/shape/variant/e-shape-fan-triangulated-impl.d.ts +200 -0
- package/dist/types/wcardinal/ui/shape/variant/e-shape-fan-triangulated.d.ts +3 -0
- package/dist/types/wcardinal/ui/shape/variant/e-shape-fan.d.ts +26 -0
- package/dist/types/wcardinal/ui/shape/variant/e-shape-group-viewer.d.ts +2 -0
- package/dist/types/wcardinal/ui/shape/variant/e-shape-group.d.ts +2 -0
- package/dist/types/wcardinal/ui/shape/variant/e-shape-line-of-triangle-roundeds.d.ts +2 -2
- package/dist/types/wcardinal/ui/shape/variant/e-shape-primitive.d.ts +2 -0
- package/dist/types/wcardinal/ui/shape/variant/e-shape-rectangle-rounded-triangulated-impl.d.ts +18 -18
- package/dist/types/wcardinal/ui/shape/variant/e-shape-semicircle-legacy.d.ts +10 -0
- package/dist/types/wcardinal/ui/shape/variant/e-shape-semicircle.d.ts +9 -2
- package/dist/types/wcardinal/ui/shape/variant/e-shape-triangle-rounded-legacy.d.ts +7 -0
- package/dist/types/wcardinal/ui/shape/variant/e-shape-triangle-rounded-triangulated-impl.d.ts +42 -0
- package/dist/types/wcardinal/ui/shape/variant/e-shape-triangle-rounded-triangulated.d.ts +3 -0
- package/dist/types/wcardinal/ui/shape/variant/e-shape-triangle-rounded.d.ts +4 -0
- package/dist/types/wcardinal/ui/shape/variant/e-shape-triangle-triangulated-impl.d.ts +1 -1
- package/dist/types/wcardinal/ui/shape/variant/hit-test-fan.d.ts +2 -0
- package/dist/types/wcardinal/ui/shape/variant/hit-test-triangle-rounded.d.ts +1 -0
- package/dist/types/wcardinal/ui/shape/variant/index.d.ts +18 -0
- package/dist/types/wcardinal/ui/shape/variant/to-fan-angle-centric.d.ts +4 -0
- package/dist/types/wcardinal/ui/shape/variant/to-fan-angle-eccentric.d.ts +5 -0
- package/dist/types/wcardinal/ui/theme/dark/e-theme-dark-shape.d.ts +1 -0
- package/dist/types/wcardinal/ui/theme/white/e-theme-white-shape.d.ts +1 -0
- package/dist/wcardinal/ui/d-diagram-serialized.js.map +1 -1
- package/dist/wcardinal/ui/shape/e-shape-capability.js +6 -1
- package/dist/wcardinal/ui/shape/e-shape-capability.js.map +1 -1
- package/dist/wcardinal/ui/shape/e-shape-defaults.js +7 -0
- package/dist/wcardinal/ui/shape/e-shape-defaults.js.map +1 -1
- package/dist/wcardinal/ui/shape/e-shape-type.js +3 -0
- package/dist/wcardinal/ui/shape/e-shape-type.js.map +1 -1
- package/dist/wcardinal/ui/shape/e-shape.js.map +1 -1
- package/dist/wcardinal/ui/shape/load/index.js +3 -0
- package/dist/wcardinal/ui/shape/load/index.js.map +1 -1
- package/dist/wcardinal/ui/shape/load/load-shape-all.js +6 -0
- package/dist/wcardinal/ui/shape/load/load-shape-all.js.map +1 -1
- package/dist/wcardinal/ui/shape/load/load-shape-fan.js +17 -0
- package/dist/wcardinal/ui/shape/load/load-shape-fan.js.map +1 -0
- package/dist/wcardinal/ui/shape/load/load-shape-semicircle-legacy.js +14 -0
- package/dist/wcardinal/ui/shape/load/load-shape-semicircle-legacy.js.map +1 -0
- package/dist/wcardinal/ui/shape/load/load-shape-semicircle.js +5 -2
- package/dist/wcardinal/ui/shape/load/load-shape-semicircle.js.map +1 -1
- package/dist/wcardinal/ui/shape/load/load-shape-triangle-rounded-legacy.js +17 -0
- package/dist/wcardinal/ui/shape/load/load-shape-triangle-rounded-legacy.js.map +1 -0
- package/dist/wcardinal/ui/shape/load/load-shape-triangle-rounded.js +2 -2
- package/dist/wcardinal/ui/shape/load/load-shape-triangle-rounded.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/build-rectangle-legacy.js +4 -0
- package/dist/wcardinal/ui/shape/variant/build-rectangle-legacy.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/build-rectangle-rounded-legacy.js +20 -19
- package/dist/wcardinal/ui/shape/variant/build-rectangle-rounded-legacy.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/build-semicircle-legacy.js +137 -0
- package/dist/wcardinal/ui/shape/variant/build-semicircle-legacy.js.map +1 -0
- package/dist/wcardinal/ui/shape/variant/build-semicircle.js +1 -139
- package/dist/wcardinal/ui/shape/variant/build-semicircle.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/build-triangle-legacy.js +4 -0
- package/dist/wcardinal/ui/shape/variant/build-triangle-legacy.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/build-triangle-rounded-legacy.js +538 -0
- package/dist/wcardinal/ui/shape/variant/build-triangle-rounded-legacy.js.map +1 -0
- package/dist/wcardinal/ui/shape/variant/build-triangle-rounded.js +5 -536
- package/dist/wcardinal/ui/shape/variant/build-triangle-rounded.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/builder-semicircle-legacy.js +76 -0
- package/dist/wcardinal/ui/shape/variant/builder-semicircle-legacy.js.map +1 -0
- package/dist/wcardinal/ui/shape/variant/builder-semicircle.js +1 -71
- package/dist/wcardinal/ui/shape/variant/builder-semicircle.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/builder-triangle-rounded-legacy.js +84 -0
- package/dist/wcardinal/ui/shape/variant/builder-triangle-rounded-legacy.js.map +1 -0
- package/dist/wcardinal/ui/shape/variant/builder-triangle-rounded.js +1 -79
- package/dist/wcardinal/ui/shape/variant/builder-triangle-rounded.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/create-semicircle-legacy-uploaded.js +24 -0
- package/dist/wcardinal/ui/shape/variant/create-semicircle-legacy-uploaded.js.map +1 -0
- package/dist/wcardinal/ui/shape/variant/create-semicircle-uploaded.js +1 -19
- package/dist/wcardinal/ui/shape/variant/create-semicircle-uploaded.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/create-triangle-rounded-legacy-uploaded.js +24 -0
- package/dist/wcardinal/ui/shape/variant/create-triangle-rounded-legacy-uploaded.js.map +1 -0
- package/dist/wcardinal/ui/shape/variant/create-triangle-rounded-uploaded.js +1 -19
- package/dist/wcardinal/ui/shape/variant/create-triangle-rounded-uploaded.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/deserialize-fan.js +12 -0
- package/dist/wcardinal/ui/shape/variant/deserialize-fan.js.map +1 -0
- package/dist/wcardinal/ui/shape/variant/deserialize-semicircle-legacy.js +10 -0
- package/dist/wcardinal/ui/shape/variant/deserialize-semicircle-legacy.js.map +1 -0
- package/dist/wcardinal/ui/shape/variant/deserialize-triangle-rounded-legacy.js +10 -0
- package/dist/wcardinal/ui/shape/variant/deserialize-triangle-rounded-legacy.js.map +1 -0
- package/dist/wcardinal/ui/shape/variant/e-shape-base.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/e-shape-button.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/e-shape-circle-triangulated-impl.js +134 -199
- package/dist/wcardinal/ui/shape/variant/e-shape-circle-triangulated-impl.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/e-shape-connector-line.js +0 -2
- package/dist/wcardinal/ui/shape/variant/e-shape-connector-line.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/e-shape-embedded-acceptor-edge.js +0 -2
- package/dist/wcardinal/ui/shape/variant/e-shape-embedded-acceptor-edge.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/e-shape-fan-triangulated-impl.js +724 -0
- package/dist/wcardinal/ui/shape/variant/e-shape-fan-triangulated-impl.js.map +1 -0
- package/dist/wcardinal/ui/shape/variant/e-shape-fan-triangulated.js +6 -0
- package/dist/wcardinal/ui/shape/variant/e-shape-fan-triangulated.js.map +1 -0
- package/dist/wcardinal/ui/shape/variant/e-shape-fan.js +85 -0
- package/dist/wcardinal/ui/shape/variant/e-shape-fan.js.map +1 -0
- package/dist/wcardinal/ui/shape/variant/e-shape-group-viewer.js +10 -0
- package/dist/wcardinal/ui/shape/variant/e-shape-group-viewer.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/e-shape-group.js +18 -1
- package/dist/wcardinal/ui/shape/variant/e-shape-group.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/e-shape-line-of-triangle-roundeds.js +2 -2
- package/dist/wcardinal/ui/shape/variant/e-shape-line-of-triangle-roundeds.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/e-shape-polygon.js +3 -4
- package/dist/wcardinal/ui/shape/variant/e-shape-polygon.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/e-shape-primitive.js +10 -0
- package/dist/wcardinal/ui/shape/variant/e-shape-primitive.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/e-shape-rectangle-rounded-triangulated-impl.js +62 -64
- package/dist/wcardinal/ui/shape/variant/e-shape-rectangle-rounded-triangulated-impl.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/e-shape-semicircle-legacy.js +33 -0
- package/dist/wcardinal/ui/shape/variant/e-shape-semicircle-legacy.js.map +1 -0
- package/dist/wcardinal/ui/shape/variant/e-shape-semicircle.js +36 -6
- package/dist/wcardinal/ui/shape/variant/e-shape-semicircle.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/e-shape-triangle-rounded-legacy.js +27 -0
- package/dist/wcardinal/ui/shape/variant/e-shape-triangle-rounded-legacy.js.map +1 -0
- package/dist/wcardinal/ui/shape/variant/e-shape-triangle-rounded-triangulated-impl.js +437 -0
- package/dist/wcardinal/ui/shape/variant/e-shape-triangle-rounded-triangulated-impl.js.map +1 -0
- package/dist/wcardinal/ui/shape/variant/e-shape-triangle-rounded-triangulated.js +6 -0
- package/dist/wcardinal/ui/shape/variant/e-shape-triangle-rounded-triangulated.js.map +1 -0
- package/dist/wcardinal/ui/shape/variant/e-shape-triangle-rounded.js +15 -2
- package/dist/wcardinal/ui/shape/variant/e-shape-triangle-rounded.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/e-shape-triangle-triangulated-impl.js +31 -30
- package/dist/wcardinal/ui/shape/variant/e-shape-triangle-triangulated-impl.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/hit-test-fan.js +79 -0
- package/dist/wcardinal/ui/shape/variant/hit-test-fan.js.map +1 -0
- package/dist/wcardinal/ui/shape/variant/hit-test-triangle-rounded.js +71 -11
- package/dist/wcardinal/ui/shape/variant/hit-test-triangle-rounded.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/index.js +18 -0
- package/dist/wcardinal/ui/shape/variant/index.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/to-fan-angle-centric.js +11 -0
- package/dist/wcardinal/ui/shape/variant/to-fan-angle-centric.js.map +1 -0
- package/dist/wcardinal/ui/shape/variant/to-fan-angle-eccentric.js +12 -0
- package/dist/wcardinal/ui/shape/variant/to-fan-angle-eccentric.js.map +1 -0
- package/dist/wcardinal/ui/theme/dark/e-theme-dark-shape.js +3 -0
- package/dist/wcardinal/ui/theme/dark/e-theme-dark-shape.js.map +1 -1
- package/dist/wcardinal/ui/theme/white/e-theme-white-shape.js +3 -0
- package/dist/wcardinal/ui/theme/white/e-theme-white-shape.js.map +1 -1
- package/dist/wcardinal-ui-theme-dark-en-us.js +4 -1
- package/dist/wcardinal-ui-theme-dark-en-us.min.js +2 -2
- package/dist/wcardinal-ui-theme-dark-en-us.min.js.map +1 -1
- package/dist/wcardinal-ui-theme-dark-ja-jp.js +4 -1
- package/dist/wcardinal-ui-theme-dark-ja-jp.min.js +2 -2
- package/dist/wcardinal-ui-theme-dark-ja-jp.min.js.map +1 -1
- package/dist/wcardinal-ui-theme-dark.js +4 -1
- package/dist/wcardinal-ui-theme-dark.min.js +2 -2
- package/dist/wcardinal-ui-theme-white-en-us.js +4 -1
- package/dist/wcardinal-ui-theme-white-en-us.min.js +2 -2
- package/dist/wcardinal-ui-theme-white-en-us.min.js.map +1 -1
- package/dist/wcardinal-ui-theme-white-ja-jp.js +4 -1
- package/dist/wcardinal-ui-theme-white-ja-jp.min.js +2 -2
- package/dist/wcardinal-ui-theme-white-ja-jp.min.js.map +1 -1
- package/dist/wcardinal-ui-theme-white.js +4 -1
- package/dist/wcardinal-ui-theme-white.min.js +2 -2
- package/dist/wcardinal-ui.cjs.js +2050 -487
- package/dist/wcardinal-ui.js +2044 -487
- package/dist/wcardinal-ui.min.js +2 -2
- package/dist/wcardinal-ui.min.js.map +1 -1
- package/package.json +1 -1
package/dist/wcardinal-ui.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
Winter Cardinal UI v0.
|
|
2
|
+
Winter Cardinal UI v0.469.0-beta.0
|
|
3
3
|
Copyright (C) 2019-2026 Toshiba Corporation
|
|
4
4
|
SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
|
|
@@ -58,6 +58,9 @@
|
|
|
58
58
|
RECTANGLE_LEGACY: 28,
|
|
59
59
|
TRIANGLE_LEGACY: 29,
|
|
60
60
|
RECTANGLE_ROUNDED_LEGACY: 30,
|
|
61
|
+
TRIANGLE_ROUNDED_LEGACY: 31,
|
|
62
|
+
FAN: 32,
|
|
63
|
+
SEMICIRCLE_LEGACY: 33,
|
|
61
64
|
EXTENSION: 1000
|
|
62
65
|
};
|
|
63
66
|
|
|
@@ -1785,6 +1788,13 @@
|
|
|
1785
1788
|
enumerable: false,
|
|
1786
1789
|
configurable: true
|
|
1787
1790
|
});
|
|
1791
|
+
Object.defineProperty(EShapeDefaults, "ANGLE", {
|
|
1792
|
+
get: function () {
|
|
1793
|
+
return this.THEME.getAngle();
|
|
1794
|
+
},
|
|
1795
|
+
enumerable: false,
|
|
1796
|
+
configurable: true
|
|
1797
|
+
});
|
|
1788
1798
|
Object.defineProperty(EShapeDefaults, "SIZE_X", {
|
|
1789
1799
|
get: function () {
|
|
1790
1800
|
return this.THEME.getSizeX();
|
|
@@ -4702,6 +4712,7 @@
|
|
|
4702
4712
|
var LINE = 0x800000;
|
|
4703
4713
|
var LINE_TAIL = 0x1000000;
|
|
4704
4714
|
var LINE_HEAD = 0x2000000;
|
|
4715
|
+
var ANGLE = 0x4000000;
|
|
4705
4716
|
var COORDINATE = POSITION | WIDTH$1 | HEIGHT$1 | ROTATION$1 | SKEW;
|
|
4706
4717
|
var SHAPE = REPLACING | GROUPING | FILL$1 | STROKE$1 | STROKE_STYLE | LINE | LINE_TAIL | LINE_HEAD;
|
|
4707
4718
|
var LAYER = ORDER_IN_LAYER;
|
|
@@ -4710,7 +4721,7 @@
|
|
|
4710
4721
|
var EMBEDDED = ID | COORDINATE | REPLACING | GROUPING | TEXT$2 | DATA | ACTION | LAYER | DATA_MAPPING;
|
|
4711
4722
|
var EMBEDDED_ACCEPTOR_EDGE = ID | COORDINATE | REPLACING | FILL$1 | STROKE$1 | STROKE_STYLE_SCALING | TEXT$2 | TEXTURE | DATA | ACTION | CURSOR$1 | LAYER;
|
|
4712
4723
|
var CONNECTOR = ID | SHAPE | TEXT$2 | TEXTURE | DATA | ACTION | CURSOR$1 | LAYER | CHILDREN$1;
|
|
4713
|
-
var ALL = PRIMITIVE | STROKE_SIDE | BORDER_RADIUS | DATA_MAPPING | UNGROUPING;
|
|
4724
|
+
var ALL = PRIMITIVE | STROKE_SIDE | BORDER_RADIUS | ANGLE | DATA_MAPPING | UNGROUPING;
|
|
4714
4725
|
var EShapeCapability = {
|
|
4715
4726
|
NONE: NONE,
|
|
4716
4727
|
/**
|
|
@@ -4779,6 +4790,10 @@
|
|
|
4779
4790
|
* Allows shape border radiuses to be modified.
|
|
4780
4791
|
*/
|
|
4781
4792
|
BORDER_RADIUS: BORDER_RADIUS,
|
|
4793
|
+
/**
|
|
4794
|
+
* Allows shape angles to be modified.
|
|
4795
|
+
*/
|
|
4796
|
+
ANGLE: ANGLE,
|
|
4782
4797
|
/**
|
|
4783
4798
|
* Allows shape texts to be modified.
|
|
4784
4799
|
*/
|
|
@@ -8432,6 +8447,16 @@
|
|
|
8432
8447
|
enumerable: false,
|
|
8433
8448
|
configurable: true
|
|
8434
8449
|
});
|
|
8450
|
+
Object.defineProperty(EShapePrimitive.prototype, "angle", {
|
|
8451
|
+
get: function () {
|
|
8452
|
+
return 0;
|
|
8453
|
+
},
|
|
8454
|
+
set: function (angle) {
|
|
8455
|
+
// DO NOTHING
|
|
8456
|
+
},
|
|
8457
|
+
enumerable: false,
|
|
8458
|
+
configurable: true
|
|
8459
|
+
});
|
|
8435
8460
|
Object.defineProperty(EShapePrimitive.prototype, "image", {
|
|
8436
8461
|
get: function () {
|
|
8437
8462
|
return this._image;
|
|
@@ -11677,7 +11702,6 @@
|
|
|
11677
11702
|
return new EShapeEmbeddedAcceptorEdge(this.type).copy(this);
|
|
11678
11703
|
};
|
|
11679
11704
|
EShapeEmbeddedAcceptorEdge.prototype.copy = function (source, part) {
|
|
11680
|
-
if (part === void 0) { part = EShapeCopyPart.ALL; }
|
|
11681
11705
|
_super.prototype.copy.call(this, source, part);
|
|
11682
11706
|
if (source instanceof EShapeEmbeddedAcceptorEdge) {
|
|
11683
11707
|
this._subtype = source.subtype;
|
|
@@ -12480,6 +12504,16 @@
|
|
|
12480
12504
|
enumerable: false,
|
|
12481
12505
|
configurable: true
|
|
12482
12506
|
});
|
|
12507
|
+
Object.defineProperty(EShapeGroupViewer.prototype, "angle", {
|
|
12508
|
+
get: function () {
|
|
12509
|
+
return 0;
|
|
12510
|
+
},
|
|
12511
|
+
set: function (angle) {
|
|
12512
|
+
// DO NOTHING
|
|
12513
|
+
},
|
|
12514
|
+
enumerable: false,
|
|
12515
|
+
configurable: true
|
|
12516
|
+
});
|
|
12483
12517
|
Object.defineProperty(EShapeGroupViewer.prototype, "image", {
|
|
12484
12518
|
get: function () {
|
|
12485
12519
|
return undefined;
|
|
@@ -15307,7 +15341,6 @@
|
|
|
15307
15341
|
values.length = bodyValuesLength + 4;
|
|
15308
15342
|
};
|
|
15309
15343
|
EShapeConnectorLine.prototype.copy = function (source, part) {
|
|
15310
|
-
if (part === void 0) { part = EShapeCopyPart.ALL; }
|
|
15311
15344
|
this.lock(EShapeLockPart.ALL);
|
|
15312
15345
|
_super.prototype.copy.call(this, source, part);
|
|
15313
15346
|
if (source instanceof EShapeConnectorLine) {
|
|
@@ -40628,7 +40661,7 @@
|
|
|
40628
40661
|
boundary[3] = +ay;
|
|
40629
40662
|
// # of vertices and # of indices
|
|
40630
40663
|
var n = this._n >> 2;
|
|
40631
|
-
var nv =
|
|
40664
|
+
var nv = 12 * n + 10;
|
|
40632
40665
|
var ni = 4 * n + 10;
|
|
40633
40666
|
this._nvertices = nv;
|
|
40634
40667
|
this._nindices = ni;
|
|
@@ -41258,7 +41291,7 @@
|
|
|
41258
41291
|
* Preconditions:
|
|
41259
41292
|
* * shape.stroke.side === EShapeStrokeSide.TOP_OR_RIGHT
|
|
41260
41293
|
* * ay <= ax
|
|
41261
|
-
* *
|
|
41294
|
+
* * 6 * N + 3 <= nv
|
|
41262
41295
|
* * 4 * N + 1 <= ni
|
|
41263
41296
|
*/
|
|
41264
41297
|
EShapeRectangleRoundedTriangulatedImpl.prototype.updateTopRight0 = function (fx, fy, ax, ay, scale, radius, corner, nv, ni) {
|
|
@@ -41269,7 +41302,7 @@
|
|
|
41269
41302
|
* Preconditions:
|
|
41270
41303
|
* * shape.stroke.side === EShapeStrokeSide.TOP_OR_RIGHT
|
|
41271
41304
|
* * ax < ay
|
|
41272
|
-
* *
|
|
41305
|
+
* * 6 * N + 3 <= nv
|
|
41273
41306
|
* * 4 * N + 1 <= ni
|
|
41274
41307
|
*/
|
|
41275
41308
|
EShapeRectangleRoundedTriangulatedImpl.prototype.updateTopRight1 = function (fx, fy, ax, ay, scale, radius, corner, nv, ni) {
|
|
@@ -41401,7 +41434,7 @@
|
|
|
41401
41434
|
if (ctr) {
|
|
41402
41435
|
var lo = lot + 2 * ax - r;
|
|
41403
41436
|
this.writeFan(+ax - r, -ay + r, 0, -1, lo, iv, ii, n, r, rs, fd, scale, fx, fy);
|
|
41404
|
-
iv +=
|
|
41437
|
+
iv += 3 * (n - 1);
|
|
41405
41438
|
ii += 3 * (n - 1);
|
|
41406
41439
|
}
|
|
41407
41440
|
this.pad(iv, ii, nv, ni, fd);
|
|
@@ -41410,7 +41443,7 @@
|
|
|
41410
41443
|
* Preconditions:
|
|
41411
41444
|
* * shape.stroke.side === EShapeStrokeSide.BOTTOM_OR_LEFT
|
|
41412
41445
|
* * ay <= ax
|
|
41413
|
-
* *
|
|
41446
|
+
* * 6 * N + 3 <= nv
|
|
41414
41447
|
* * 4 * N + 1 <= ni
|
|
41415
41448
|
*/
|
|
41416
41449
|
EShapeRectangleRoundedTriangulatedImpl.prototype.updateBottomLeft0 = function (fx, fy, ax, ay, scale, radius, corner, nv, ni) {
|
|
@@ -41421,7 +41454,7 @@
|
|
|
41421
41454
|
* Preconditions:
|
|
41422
41455
|
* * shape.stroke.side === EShapeStrokeSide.BOTTOM_OR_LEFT
|
|
41423
41456
|
* * ax < ay
|
|
41424
|
-
* *
|
|
41457
|
+
* * 6 * N + 3 <= nv
|
|
41425
41458
|
* * 4 * N + 1 <= ni
|
|
41426
41459
|
*/
|
|
41427
41460
|
EShapeRectangleRoundedTriangulatedImpl.prototype.updateBottomLeft1 = function (fx, fy, ax, ay, scale, radius, corner, nv, ni) {
|
|
@@ -41555,7 +41588,7 @@
|
|
|
41555
41588
|
if (cbl) {
|
|
41556
41589
|
var lo = lob + 2 * ax - r;
|
|
41557
41590
|
this.writeFan(-ax + r, +ay - r, 0, 1, lo, iv, ii, n, r, rs, fd, scale, fx, fy);
|
|
41558
|
-
iv +=
|
|
41591
|
+
iv += 3 * (n - 1);
|
|
41559
41592
|
ii += 3 * (n - 1);
|
|
41560
41593
|
}
|
|
41561
41594
|
this.pad(iv, ii, nv, ni, fd);
|
|
@@ -41572,7 +41605,7 @@
|
|
|
41572
41605
|
* Preconditions:
|
|
41573
41606
|
* * shape.stroke.side === EShapeStrokeSide.TOP_OR_LEFT
|
|
41574
41607
|
* * ay <= ax
|
|
41575
|
-
* *
|
|
41608
|
+
* * 6 * N + 3 <= nv
|
|
41576
41609
|
* * 4 * N + 1 <= ni
|
|
41577
41610
|
*/
|
|
41578
41611
|
EShapeRectangleRoundedTriangulatedImpl.prototype.updateTopLeft0 = function (fx, fy, ax, ay, scale, radius, corner, nv, ni) {
|
|
@@ -41583,7 +41616,7 @@
|
|
|
41583
41616
|
* Preconditions:
|
|
41584
41617
|
* * shape.stroke.side === EShapeStrokeSide.TOP_OR_LEFT
|
|
41585
41618
|
* * ax < ay
|
|
41586
|
-
* *
|
|
41619
|
+
* * 6 * N + 3 <= nv
|
|
41587
41620
|
* * 4 * N + 1 <= ni
|
|
41588
41621
|
*/
|
|
41589
41622
|
EShapeRectangleRoundedTriangulatedImpl.prototype.updateTopLeft1 = function (fx, fy, ax, ay, scale, radius, corner, nv, ni) {
|
|
@@ -41729,7 +41762,7 @@
|
|
|
41729
41762
|
if (ctl) {
|
|
41730
41763
|
var lo = lol + 2 * ay - r;
|
|
41731
41764
|
this.writeFan(-ax + r, -ay + r, -1, 0, lo, iv, ii, n, r, rs, fd, scale, fx, fy);
|
|
41732
|
-
iv +=
|
|
41765
|
+
iv += 3 * (n - 1);
|
|
41733
41766
|
ii += 3 * (n - 1);
|
|
41734
41767
|
}
|
|
41735
41768
|
this.pad(iv, ii, nv, ni, fd);
|
|
@@ -41738,7 +41771,7 @@
|
|
|
41738
41771
|
* Preconditions:
|
|
41739
41772
|
* * shape.stroke.side === EShapeStrokeSide.BOTTOM_OR_RIGHT
|
|
41740
41773
|
* * ay <= ax
|
|
41741
|
-
* *
|
|
41774
|
+
* * 6 * N + 3 <= nv
|
|
41742
41775
|
* * 4 * N + 1 <= ni
|
|
41743
41776
|
*/
|
|
41744
41777
|
EShapeRectangleRoundedTriangulatedImpl.prototype.updateBottomRight0 = function (fx, fy, ax, ay, scale, radius, corner, nv, ni) {
|
|
@@ -41749,7 +41782,7 @@
|
|
|
41749
41782
|
* Preconditions:
|
|
41750
41783
|
* * shape.stroke.side === EShapeStrokeSide.BOTTOM_OR_RIGHT
|
|
41751
41784
|
* * ax < ay
|
|
41752
|
-
* *
|
|
41785
|
+
* * 6 * N + 3 <= nv
|
|
41753
41786
|
* * 4 * N + 1 <= ni
|
|
41754
41787
|
*/
|
|
41755
41788
|
EShapeRectangleRoundedTriangulatedImpl.prototype.updateBottomRight1 = function (fx, fy, ax, ay, scale, radius, corner, nv, ni) {
|
|
@@ -41892,7 +41925,7 @@
|
|
|
41892
41925
|
if (cbr) {
|
|
41893
41926
|
var lo = lor + 2 * ay - r;
|
|
41894
41927
|
this.writeFan(+ax - r, +ay - r, 1, 0, lo, iv, ii, n, r, rs, fd, scale, fx, fy);
|
|
41895
|
-
iv +=
|
|
41928
|
+
iv += 3 * (n - 1);
|
|
41896
41929
|
ii += 3 * (n - 1);
|
|
41897
41930
|
}
|
|
41898
41931
|
this.pad(iv, ii, nv, ni, fd);
|
|
@@ -41901,7 +41934,7 @@
|
|
|
41901
41934
|
* Preconditions:
|
|
41902
41935
|
* * shape.stroke.side === EShapeStrokeSide.NOT_TOP
|
|
41903
41936
|
* * ay <= ax
|
|
41904
|
-
* *
|
|
41937
|
+
* * 8 * N + 8 <= nv
|
|
41905
41938
|
* * 4 * N + 6 <= ni
|
|
41906
41939
|
*/
|
|
41907
41940
|
EShapeRectangleRoundedTriangulatedImpl.prototype.updateNotTop0 = function (fx, fy, ax, ay, scale, radius, corner, nv, ni) {
|
|
@@ -41944,13 +41977,13 @@
|
|
|
41944
41977
|
if (cbl) {
|
|
41945
41978
|
var lo = lob + 2 * ax - r;
|
|
41946
41979
|
this.writeFan(-ax + r, +ay - r, 0, 1, lo, iv, ii, n, r, rs, fd, scale, fx, fy);
|
|
41947
|
-
iv +=
|
|
41980
|
+
iv += 3 * (n - 1);
|
|
41948
41981
|
ii += 3 * (n - 1);
|
|
41949
41982
|
}
|
|
41950
41983
|
if (cbr) {
|
|
41951
41984
|
var lo = lor + 2 * ay - r;
|
|
41952
41985
|
this.writeFan(+ax - r, +ay - r, 1, 0, lo, iv, ii, n, r, rs, fd, scale, fx, fy);
|
|
41953
|
-
iv +=
|
|
41986
|
+
iv += 3 * (n - 1);
|
|
41954
41987
|
ii += 3 * (n - 1);
|
|
41955
41988
|
}
|
|
41956
41989
|
this.pad(iv, ii, nv, ni, fd);
|
|
@@ -41959,7 +41992,7 @@
|
|
|
41959
41992
|
* Preconditions:
|
|
41960
41993
|
* * shape.stroke.side === EShapeStrokeSide.NOT_TOP
|
|
41961
41994
|
* * ax < ay
|
|
41962
|
-
* *
|
|
41995
|
+
* * 8 * N + 8 <= nv
|
|
41963
41996
|
* * 4 * N + 6 <= ni
|
|
41964
41997
|
*/
|
|
41965
41998
|
EShapeRectangleRoundedTriangulatedImpl.prototype.updateNotTop1 = function (fx, fy, ax, ay, scale, radius, corner, nv, ni) {
|
|
@@ -42000,13 +42033,13 @@
|
|
|
42000
42033
|
if (cbl) {
|
|
42001
42034
|
var lo = lob + 2 * ax - r;
|
|
42002
42035
|
this.writeFan(-ax + r, +ay - r, 0, 1, lo, iv, ii, n, r, rs, fd, scale, fx, fy);
|
|
42003
|
-
iv +=
|
|
42036
|
+
iv += 3 * (n - 1);
|
|
42004
42037
|
ii += 3 * (n - 1);
|
|
42005
42038
|
}
|
|
42006
42039
|
if (cbr) {
|
|
42007
42040
|
var lo = lor + 2 * ay - r;
|
|
42008
42041
|
this.writeFan(+ax - r, +ay - r, 1, 0, lo, iv, ii, n, r, rs, fd, scale, fx, fy);
|
|
42009
|
-
iv +=
|
|
42042
|
+
iv += 3 * (n - 1);
|
|
42010
42043
|
ii += 3 * (n - 1);
|
|
42011
42044
|
}
|
|
42012
42045
|
this.pad(iv, ii, nv, ni, fd);
|
|
@@ -42084,7 +42117,7 @@
|
|
|
42084
42117
|
* Preconditions:
|
|
42085
42118
|
* * shape.stroke.side === EShapeStrokeSide.NOT_BOTTOM
|
|
42086
42119
|
* * ay <= ax
|
|
42087
|
-
* *
|
|
42120
|
+
* * 8 * N + 8 <= nv
|
|
42088
42121
|
* * 4 * N + 6 <= ni
|
|
42089
42122
|
*/
|
|
42090
42123
|
EShapeRectangleRoundedTriangulatedImpl.prototype.updateNotBottom0 = function (fx, fy, ax, ay, scale, radius, corner, nv, ni) {
|
|
@@ -42133,13 +42166,13 @@
|
|
|
42133
42166
|
if (ctl) {
|
|
42134
42167
|
var lo = lol + 2 * ay - r;
|
|
42135
42168
|
this.writeFan(-ax + r, -ay + r, -1, 0, lo, iv, ii, n, r, rs, fd, scale, fx, fy);
|
|
42136
|
-
iv +=
|
|
42169
|
+
iv += 3 * (n - 1);
|
|
42137
42170
|
ii += 3 * (n - 1);
|
|
42138
42171
|
}
|
|
42139
42172
|
if (ctr) {
|
|
42140
42173
|
var lo = lot + 2 * ax - r;
|
|
42141
42174
|
this.writeFan(+ax - r, -ay + r, 0, -1, lo, iv, ii, n, r, rs, fd, scale, fx, fy);
|
|
42142
|
-
iv +=
|
|
42175
|
+
iv += 3 * (n - 1);
|
|
42143
42176
|
ii += 3 * (n - 1);
|
|
42144
42177
|
}
|
|
42145
42178
|
this.pad(iv, ii, nv, ni, fd);
|
|
@@ -42148,7 +42181,7 @@
|
|
|
42148
42181
|
* Preconditions:
|
|
42149
42182
|
* * shape.stroke.side === EShapeStrokeSide.NOT_BOTTOM
|
|
42150
42183
|
* * ax < ay
|
|
42151
|
-
* *
|
|
42184
|
+
* * 8 * N + 8 <= nv
|
|
42152
42185
|
* * 4 * N + 6 <= ni
|
|
42153
42186
|
*/
|
|
42154
42187
|
EShapeRectangleRoundedTriangulatedImpl.prototype.updateNotBottom1 = function (fx, fy, ax, ay, scale, radius, corner, nv, ni) {
|
|
@@ -42196,13 +42229,13 @@
|
|
|
42196
42229
|
if (ctl) {
|
|
42197
42230
|
var lo = lol + 2 * ay - r;
|
|
42198
42231
|
this.writeFan(-ax + r, -ay + r, -1, 0, lo, iv, ii, n, r, rs, fd, scale, fx, fy);
|
|
42199
|
-
iv +=
|
|
42232
|
+
iv += 3 * (n - 1);
|
|
42200
42233
|
ii += 3 * (n - 1);
|
|
42201
42234
|
}
|
|
42202
42235
|
if (ctr) {
|
|
42203
42236
|
var lo = lot + 2 * ax - r;
|
|
42204
42237
|
this.writeFan(+ax - r, -ay + r, 0, -1, lo, iv, ii, n, r, rs, fd, scale, fx, fy);
|
|
42205
|
-
iv +=
|
|
42238
|
+
iv += 3 * (n - 1);
|
|
42206
42239
|
ii += 3 * (n - 1);
|
|
42207
42240
|
}
|
|
42208
42241
|
this.pad(iv, ii, nv, ni, fd);
|
|
@@ -42277,7 +42310,7 @@
|
|
|
42277
42310
|
* Preconditions:
|
|
42278
42311
|
* * shape.stroke.side === EShapeStrokeSide.NOT_LEFT
|
|
42279
42312
|
* * ay <= ax
|
|
42280
|
-
* *
|
|
42313
|
+
* * 8 * N + 8 <= nv
|
|
42281
42314
|
* * 4 * N + 6 <= ni
|
|
42282
42315
|
*/
|
|
42283
42316
|
EShapeRectangleRoundedTriangulatedImpl.prototype.updateNotLeft0 = function (fx, fy, ax, ay, scale, radius, corner, nv, ni) {
|
|
@@ -42324,13 +42357,13 @@
|
|
|
42324
42357
|
if (ctr) {
|
|
42325
42358
|
var lo = lot + 2 * ax - r;
|
|
42326
42359
|
this.writeFan(+ax - r, -ay + r, 0, -1, lo, iv, ii, n, r, rs, fd, scale, fx, fy);
|
|
42327
|
-
iv +=
|
|
42360
|
+
iv += 3 * (n - 1);
|
|
42328
42361
|
ii += 3 * (n - 1);
|
|
42329
42362
|
}
|
|
42330
42363
|
if (cbr) {
|
|
42331
42364
|
var lo = lor + 2 * ay - r;
|
|
42332
42365
|
this.writeFan(+ax - r, +ay - r, 1, 0, lo, iv, ii, n, r, rs, fd, scale, fx, fy);
|
|
42333
|
-
iv +=
|
|
42366
|
+
iv += 3 * (n - 1);
|
|
42334
42367
|
ii += 3 * (n - 1);
|
|
42335
42368
|
}
|
|
42336
42369
|
this.pad(iv, ii, nv, ni, fd);
|
|
@@ -42339,7 +42372,7 @@
|
|
|
42339
42372
|
* Preconditions:
|
|
42340
42373
|
* * shape.stroke.side === EShapeStrokeSide.NOT_LEFT
|
|
42341
42374
|
* * ax < ay
|
|
42342
|
-
* *
|
|
42375
|
+
* * 8 * N + 8 <= nv
|
|
42343
42376
|
* * 4 * N + 6 <= ni
|
|
42344
42377
|
*/
|
|
42345
42378
|
EShapeRectangleRoundedTriangulatedImpl.prototype.updateNotLeft1 = function (fx, fy, ax, ay, scale, radius, corner, nv, ni) {
|
|
@@ -42387,13 +42420,13 @@
|
|
|
42387
42420
|
if (ctr) {
|
|
42388
42421
|
var lo = lot + 2 * ax - r;
|
|
42389
42422
|
this.writeFan(+ax - r, -ay + r, 0, -1, lo, iv, ii, n, r, rs, fd, scale, fx, fy);
|
|
42390
|
-
iv +=
|
|
42423
|
+
iv += 3 * (n - 1);
|
|
42391
42424
|
ii += 3 * (n - 1);
|
|
42392
42425
|
}
|
|
42393
42426
|
if (cbr) {
|
|
42394
42427
|
var lo = lor + 2 * ay - r;
|
|
42395
42428
|
this.writeFan(+ax - r, +ay - r, 1, 0, lo, iv, ii, n, r, rs, fd, scale, fx, fy);
|
|
42396
|
-
iv +=
|
|
42429
|
+
iv += 3 * (n - 1);
|
|
42397
42430
|
ii += 3 * (n - 1);
|
|
42398
42431
|
}
|
|
42399
42432
|
this.pad(iv, ii, nv, ni, fd);
|
|
@@ -42468,7 +42501,7 @@
|
|
|
42468
42501
|
* Preconditions:
|
|
42469
42502
|
* * shape.stroke.side === EShapeStrokeSide.NOT_RIGHT
|
|
42470
42503
|
* * ay <= ax
|
|
42471
|
-
* *
|
|
42504
|
+
* * 8 * N + 8 <= nv
|
|
42472
42505
|
* * 4 * N + 6 <= ni
|
|
42473
42506
|
*/
|
|
42474
42507
|
EShapeRectangleRoundedTriangulatedImpl.prototype.updateNotRight0 = function (fx, fy, ax, ay, scale, radius, corner, nv, ni) {
|
|
@@ -42509,13 +42542,13 @@
|
|
|
42509
42542
|
if (ctl) {
|
|
42510
42543
|
var lo = lol + 2 * ay - r;
|
|
42511
42544
|
this.writeFan(-ax + r, -ay + r, -1, 0, lo, iv, ii, n, r, rs, fd, scale, fx, fy);
|
|
42512
|
-
iv +=
|
|
42545
|
+
iv += 3 * (n - 1);
|
|
42513
42546
|
ii += 3 * (n - 1);
|
|
42514
42547
|
}
|
|
42515
42548
|
if (cbl) {
|
|
42516
42549
|
var lo = lob + 2 * ax - r;
|
|
42517
42550
|
this.writeFan(-ax + r, +ay - r, 0, 1, lo, iv, ii, n, r, rs, fd, scale, fx, fy);
|
|
42518
|
-
iv +=
|
|
42551
|
+
iv += 3 * (n - 1);
|
|
42519
42552
|
ii += 3 * (n - 1);
|
|
42520
42553
|
}
|
|
42521
42554
|
this.pad(iv, ii, nv, ni, fd);
|
|
@@ -42524,7 +42557,7 @@
|
|
|
42524
42557
|
* Preconditions:
|
|
42525
42558
|
* * shape.stroke.side === EShapeStrokeSide.NOT_RIGHT
|
|
42526
42559
|
* * ax < ay
|
|
42527
|
-
* *
|
|
42560
|
+
* * 8 * N + 8 <= nv
|
|
42528
42561
|
* * 4 * N + 6 <= ni
|
|
42529
42562
|
*/
|
|
42530
42563
|
EShapeRectangleRoundedTriangulatedImpl.prototype.updateNotRight1 = function (fx, fy, ax, ay, scale, radius, corner, nv, ni) {
|
|
@@ -42566,13 +42599,13 @@
|
|
|
42566
42599
|
if (ctl) {
|
|
42567
42600
|
var lo = lol + 2 * ay - r;
|
|
42568
42601
|
this.writeFan(-ax + r, -ay + r, -1, 0, lo, iv, ii, n, r, rs, fd, scale, fx, fy);
|
|
42569
|
-
iv +=
|
|
42602
|
+
iv += 3 * (n - 1);
|
|
42570
42603
|
ii += 3 * (n - 1);
|
|
42571
42604
|
}
|
|
42572
42605
|
if (cbl) {
|
|
42573
42606
|
var lo = lob + 2 * ax - r;
|
|
42574
42607
|
this.writeFan(-ax + r, +ay - r, 0, 1, lo, iv, ii, n, r, rs, fd, scale, fx, fy);
|
|
42575
|
-
iv +=
|
|
42608
|
+
iv += 3 * (n - 1);
|
|
42576
42609
|
ii += 3 * (n - 1);
|
|
42577
42610
|
}
|
|
42578
42611
|
this.pad(iv, ii, nv, ni, fd);
|
|
@@ -42647,7 +42680,7 @@
|
|
|
42647
42680
|
* Preconditions:
|
|
42648
42681
|
* * shape.stroke.side === EShapeStrokeSide.ALL or NONE
|
|
42649
42682
|
* * ay <= ax
|
|
42650
|
-
* *
|
|
42683
|
+
* * 12 * N + 10 <= nv
|
|
42651
42684
|
* * 4 * N + 10 <= ni
|
|
42652
42685
|
*/
|
|
42653
42686
|
EShapeRectangleRoundedTriangulatedImpl.prototype.updateAll0 = function (fx, fy, ax, ay, scale, radius, corner, nv, ni) {
|
|
@@ -42692,10 +42725,10 @@
|
|
|
42692
42725
|
iv += 5;
|
|
42693
42726
|
ii += 9;
|
|
42694
42727
|
var rs = r + fs;
|
|
42695
|
-
var l = 2 * ax + lot;
|
|
42728
|
+
var l = 2 * ax + lot - r;
|
|
42696
42729
|
if (ctr) {
|
|
42697
42730
|
this.writeFan(x4, y1, 0, -1, l, iv, ii, n, r, rs, fd, s, fx, fy);
|
|
42698
|
-
iv +=
|
|
42731
|
+
iv += 3 * (n - 1);
|
|
42699
42732
|
ii += 3 * (n - 1);
|
|
42700
42733
|
l += 2 * ay + lc;
|
|
42701
42734
|
}
|
|
@@ -42704,7 +42737,7 @@
|
|
|
42704
42737
|
}
|
|
42705
42738
|
if (cbr) {
|
|
42706
42739
|
this.writeFan(x4, y4, 1, 0, l, iv, ii, n, r, rs, fd, s, fx, fy);
|
|
42707
|
-
iv +=
|
|
42740
|
+
iv += 3 * (n - 1);
|
|
42708
42741
|
ii += 3 * (n - 1);
|
|
42709
42742
|
l += 2 * ax + lc;
|
|
42710
42743
|
}
|
|
@@ -42713,7 +42746,7 @@
|
|
|
42713
42746
|
}
|
|
42714
42747
|
if (cbl) {
|
|
42715
42748
|
this.writeFan(x1, y4, 0, 1, l, iv, ii, n, r, rs, fd, s, fx, fy);
|
|
42716
|
-
iv +=
|
|
42749
|
+
iv += 3 * (n - 1);
|
|
42717
42750
|
ii += 3 * (n - 1);
|
|
42718
42751
|
l += 2 * ay + lc;
|
|
42719
42752
|
}
|
|
@@ -42722,7 +42755,7 @@
|
|
|
42722
42755
|
}
|
|
42723
42756
|
if (ctl) {
|
|
42724
42757
|
this.writeFan(x1, y1, -1, 0, l, iv, ii, n, r, rs, fd, s, fx, fy);
|
|
42725
|
-
iv +=
|
|
42758
|
+
iv += 3 * (n - 1);
|
|
42726
42759
|
ii += 3 * (n - 1);
|
|
42727
42760
|
}
|
|
42728
42761
|
this.pad(iv, ii, nv, ni, fd);
|
|
@@ -42731,7 +42764,7 @@
|
|
|
42731
42764
|
* Preconditions:
|
|
42732
42765
|
* * shape.stroke.side === EShapeStrokeSide.ALL or NONE
|
|
42733
42766
|
* * ax < ay
|
|
42734
|
-
* *
|
|
42767
|
+
* * 12 * N + 10 <= nv
|
|
42735
42768
|
* * 4 * N + 10 <= ni
|
|
42736
42769
|
*/
|
|
42737
42770
|
EShapeRectangleRoundedTriangulatedImpl.prototype.updateAll1 = function (fx, fy, ax, ay, scale, radius, corner, nv, ni) {
|
|
@@ -42776,10 +42809,10 @@
|
|
|
42776
42809
|
this.writeHexaLeft(iv, ii, lol, cbl ? x1 : ol, cbl ? y4 : y5, ol, y4, ol, y1, ctl ? x1 : ol, ctl ? y1 : y0, 0, y2, 0, y3, fd, s, fx, fy, ax, ay);
|
|
42777
42810
|
iv += 6;
|
|
42778
42811
|
ii += 12;
|
|
42779
|
-
var l = 2 * ax + lot;
|
|
42812
|
+
var l = 2 * ax + lot - r;
|
|
42780
42813
|
if (ctr) {
|
|
42781
42814
|
this.writeFan(x4, y1, 0, -1, l, iv, ii, n, r, rs, fd, s, fx, fy);
|
|
42782
|
-
iv +=
|
|
42815
|
+
iv += 3 * (n - 1);
|
|
42783
42816
|
ii += 3 * (n - 1);
|
|
42784
42817
|
l += 2 * ay + lc;
|
|
42785
42818
|
}
|
|
@@ -42788,7 +42821,7 @@
|
|
|
42788
42821
|
}
|
|
42789
42822
|
if (cbr) {
|
|
42790
42823
|
this.writeFan(x4, y4, 1, 0, l, iv, ii, n, r, rs, fd, s, fx, fy);
|
|
42791
|
-
iv +=
|
|
42824
|
+
iv += 3 * (n - 1);
|
|
42792
42825
|
ii += 3 * (n - 1);
|
|
42793
42826
|
l += 2 * ax + lc;
|
|
42794
42827
|
}
|
|
@@ -42797,7 +42830,7 @@
|
|
|
42797
42830
|
}
|
|
42798
42831
|
if (cbl) {
|
|
42799
42832
|
this.writeFan(x1, y4, 0, 1, l, iv, ii, n, r, rs, fd, s, fx, fy);
|
|
42800
|
-
iv +=
|
|
42833
|
+
iv += 3 * (n - 1);
|
|
42801
42834
|
ii += 3 * (n - 1);
|
|
42802
42835
|
l += 2 * ay + lc;
|
|
42803
42836
|
}
|
|
@@ -42806,7 +42839,7 @@
|
|
|
42806
42839
|
}
|
|
42807
42840
|
if (ctl) {
|
|
42808
42841
|
this.writeFan(x1, y1, -1, 0, l, iv, ii, n, r, rs, fd, s, fx, fy);
|
|
42809
|
-
iv +=
|
|
42842
|
+
iv += 3 * (n - 1);
|
|
42810
42843
|
ii += 3 * (n - 1);
|
|
42811
42844
|
}
|
|
42812
42845
|
this.pad(iv, ii, nv, ni, fd);
|
|
@@ -43079,29 +43112,27 @@
|
|
|
43079
43112
|
var dangle = (Math.PI * 0.5) / (n - 1);
|
|
43080
43113
|
var c = Math.cos(dangle);
|
|
43081
43114
|
var s = Math.sin(dangle);
|
|
43082
|
-
var dl =
|
|
43115
|
+
var dl = r * dangle;
|
|
43116
|
+
// Rim vertices at radius rs sit dl / 2 * (rs / r) from the chord midpoint, so the length is exact at radius r.
|
|
43117
|
+
var dlm = 0.5 * dl * (rs / r - 1);
|
|
43118
|
+
var cc = 1 - r * fd;
|
|
43119
|
+
var indices = this._indices;
|
|
43083
43120
|
var dx = rs * cos0;
|
|
43084
43121
|
var dy = rs * sin0;
|
|
43085
|
-
var iv0 = iv++;
|
|
43086
43122
|
var l = lo;
|
|
43087
|
-
this.writeVertex(iv0, cx + dx, cy + dy, fd, lo, scale, fx, fy);
|
|
43088
|
-
var indices = this._indices;
|
|
43089
|
-
var cc = 1 - r * fd;
|
|
43090
43123
|
for (var i = 0; i < n - 1; ++i) {
|
|
43091
|
-
var iv1 = iv++;
|
|
43092
|
-
l += dl;
|
|
43093
|
-
this.writeVertex(iv1, cx, cy, fd, l, cc, fx, fy);
|
|
43094
|
-
var iv2 = iv++;
|
|
43095
|
-
l += dl;
|
|
43096
43124
|
var ndx = c * dx - s * dy;
|
|
43097
43125
|
var ndy = s * dx + c * dy;
|
|
43098
|
-
this.writeVertex(
|
|
43126
|
+
this.writeVertex(iv + 0, cx + dx, cy + dy, fd, l - dlm, scale, fx, fy);
|
|
43127
|
+
this.writeVertex(iv + 1, cx + ndx, cy + ndy, fd, l + dl + dlm, scale, fx, fy);
|
|
43128
|
+
this.writeVertex(iv + 2, cx, cy, fd, l + 0.5 * dl, cc, fx, fy);
|
|
43129
|
+
indices[ii++] = iv + 2;
|
|
43130
|
+
indices[ii++] = iv + 0;
|
|
43131
|
+
indices[ii++] = iv + 1;
|
|
43132
|
+
iv += 3;
|
|
43133
|
+
l += dl;
|
|
43099
43134
|
dx = ndx;
|
|
43100
43135
|
dy = ndy;
|
|
43101
|
-
indices[ii++] = iv1;
|
|
43102
|
-
indices[ii++] = iv0;
|
|
43103
|
-
indices[ii++] = iv2;
|
|
43104
|
-
iv0 = iv2;
|
|
43105
43136
|
}
|
|
43106
43137
|
};
|
|
43107
43138
|
EShapeRectangleRoundedTriangulatedImpl.prototype.writeVertexTop = function (vertex, x, y, lengthOffset, fdistance, scale, fx, fy, ax, ay) {
|
|
@@ -43873,6 +43904,7 @@
|
|
|
43873
43904
|
this._nvertices = 0;
|
|
43874
43905
|
this._distances = [];
|
|
43875
43906
|
this._lengths = [];
|
|
43907
|
+
this._lengthShifts = [];
|
|
43876
43908
|
this._clippings = [];
|
|
43877
43909
|
this._uvs = [];
|
|
43878
43910
|
this._indices = [];
|
|
@@ -43999,7 +44031,7 @@
|
|
|
43999
44031
|
boundary[2] = +ax;
|
|
44000
44032
|
boundary[3] = +ay;
|
|
44001
44033
|
// # of vertices and # of indices
|
|
44002
|
-
var nv =
|
|
44034
|
+
var nv = 4 * n - 4;
|
|
44003
44035
|
var ni = 2 * n - 4;
|
|
44004
44036
|
this._nvertices = nv;
|
|
44005
44037
|
this._nindices = ni;
|
|
@@ -44064,83 +44096,56 @@
|
|
|
44064
44096
|
var dangle = (2 * Math.PI) / n;
|
|
44065
44097
|
var c = Math.cos(dangle);
|
|
44066
44098
|
var s = Math.sin(dangle);
|
|
44067
|
-
//
|
|
44068
|
-
var
|
|
44069
|
-
var
|
|
44070
|
-
var
|
|
44071
|
-
var
|
|
44072
|
-
var
|
|
44073
|
-
var
|
|
44074
|
-
|
|
44075
|
-
var
|
|
44076
|
-
|
|
44077
|
-
var
|
|
44078
|
-
var
|
|
44079
|
-
var
|
|
44080
|
-
var
|
|
44081
|
-
var
|
|
44082
|
-
|
|
44083
|
-
|
|
44084
|
-
|
|
44085
|
-
|
|
44086
|
-
|
|
44087
|
-
|
|
44088
|
-
|
|
44089
|
-
|
|
44090
|
-
|
|
44091
|
-
|
|
44092
|
-
|
|
44093
|
-
|
|
44094
|
-
|
|
44095
|
-
|
|
44096
|
-
|
|
44097
|
-
|
|
44098
|
-
|
|
44099
|
-
|
|
44100
|
-
|
|
44101
|
-
|
|
44102
|
-
|
|
44103
|
-
|
|
44104
|
-
|
|
44105
|
-
|
|
44106
|
-
|
|
44107
|
-
|
|
44108
|
-
|
|
44109
|
-
|
|
44110
|
-
|
|
44111
|
-
|
|
44112
|
-
|
|
44113
|
-
var un = c * u - s * v;
|
|
44114
|
-
var vn = s * u + c * v;
|
|
44115
|
-
u = un;
|
|
44116
|
-
v = vn;
|
|
44117
|
-
su = scale * u;
|
|
44118
|
-
sv = scale * v;
|
|
44119
|
-
l1 += dl;
|
|
44120
|
-
l2 += dl;
|
|
44121
|
-
vertices[iv2 + 0] = su * sizeX;
|
|
44122
|
-
vertices[iv2 + 1] = sv * sizeY;
|
|
44123
|
-
vertices[iv2 + 2] = 0;
|
|
44124
|
-
vertices[iv2 + 3] = 0;
|
|
44125
|
-
distances[iv1 + 0] = fdistance;
|
|
44126
|
-
distances[iv1 + 1] = fdistance;
|
|
44127
|
-
clippings[iv1 + 0] = scale;
|
|
44128
|
-
clippings[iv1 + 1] = 0;
|
|
44129
|
-
lengths[iv1 + 0] = l1;
|
|
44130
|
-
lengths[iv1 + 1] = l2;
|
|
44131
|
-
uvs[iv2 + 0] = 0.5 * (su + 1);
|
|
44132
|
-
uvs[iv2 + 1] = 0.5 * (sv + 1);
|
|
44133
|
-
uvs[iv2 + 2] = 0.5;
|
|
44134
|
-
uvs[iv2 + 3] = 0.5;
|
|
44135
|
-
indices[ii + 0] = iv1 - 2;
|
|
44136
|
-
indices[ii + 1] = iv1;
|
|
44137
|
-
indices[ii + 2] = iv1 + 1;
|
|
44138
|
-
iv1 += 2;
|
|
44139
|
-
iv2 += 4;
|
|
44099
|
+
// Edge length and apothem of the unscaled polygon
|
|
44100
|
+
var ex = -s * sizeX;
|
|
44101
|
+
var ey = (c - 1) * sizeY;
|
|
44102
|
+
var dl = Math.sqrt(ex * ex + ey * ey);
|
|
44103
|
+
var mx = 0.5 * ex;
|
|
44104
|
+
var my = 0.5 * (c + 1) * sizeY;
|
|
44105
|
+
var fdistance = 1 / Math.sqrt(mx * mx + my * my);
|
|
44106
|
+
// Half edge length at clipping = scale
|
|
44107
|
+
var hl = 0.5 * scale * dl;
|
|
44108
|
+
// Each triangle owns its vertices so that the lengths are exact at clipping = 1 on both sides.
|
|
44109
|
+
var u0 = 0;
|
|
44110
|
+
var v0 = scale;
|
|
44111
|
+
var iv = 0;
|
|
44112
|
+
var ii = 0;
|
|
44113
|
+
for (var i = 0; i < n; ++i) {
|
|
44114
|
+
var u1 = c * u0 - s * v0;
|
|
44115
|
+
var v1 = s * u0 + c * v0;
|
|
44116
|
+
var lm = (i + 0.5) * dl;
|
|
44117
|
+
var iv2 = iv << 1;
|
|
44118
|
+
vertices[iv2 + 0] = u0 * sizeX;
|
|
44119
|
+
vertices[iv2 + 1] = v0 * sizeY;
|
|
44120
|
+
vertices[iv2 + 2] = u1 * sizeX;
|
|
44121
|
+
vertices[iv2 + 3] = v1 * sizeY;
|
|
44122
|
+
vertices[iv2 + 4] = 0;
|
|
44123
|
+
vertices[iv2 + 5] = 0;
|
|
44124
|
+
distances[iv + 0] = fdistance;
|
|
44125
|
+
distances[iv + 1] = fdistance;
|
|
44126
|
+
distances[iv + 2] = fdistance;
|
|
44127
|
+
clippings[iv + 0] = scale;
|
|
44128
|
+
clippings[iv + 1] = scale;
|
|
44129
|
+
clippings[iv + 2] = 0;
|
|
44130
|
+
lengths[iv + 0] = lm - hl;
|
|
44131
|
+
lengths[iv + 1] = lm + hl;
|
|
44132
|
+
lengths[iv + 2] = lm;
|
|
44133
|
+
uvs[iv2 + 0] = 0.5 * (u0 + 1);
|
|
44134
|
+
uvs[iv2 + 1] = 0.5 * (v0 + 1);
|
|
44135
|
+
uvs[iv2 + 2] = 0.5 * (u1 + 1);
|
|
44136
|
+
uvs[iv2 + 3] = 0.5 * (v1 + 1);
|
|
44137
|
+
uvs[iv2 + 4] = 0.5;
|
|
44138
|
+
uvs[iv2 + 5] = 0.5;
|
|
44139
|
+
indices[ii + 0] = iv + 0;
|
|
44140
|
+
indices[ii + 1] = iv + 1;
|
|
44141
|
+
indices[ii + 2] = iv + 2;
|
|
44142
|
+
u0 = u1;
|
|
44143
|
+
v0 = v1;
|
|
44144
|
+
iv += 3;
|
|
44140
44145
|
ii += 3;
|
|
44141
44146
|
}
|
|
44142
44147
|
// Degenerate triangles keep the buffer sizes consistent with elongated circles.
|
|
44143
|
-
this.pad(
|
|
44148
|
+
this.pad(iv, ii, nv, ni, fdistance);
|
|
44144
44149
|
};
|
|
44145
44150
|
/**
|
|
44146
44151
|
* Precondition: sizeX !== 0 && sizeY !== 0 && abs(sizeY) < abs(sizeX)
|
|
@@ -44155,8 +44160,10 @@
|
|
|
44155
44160
|
var dangle = (2 * Math.PI) / n;
|
|
44156
44161
|
var c = Math.cos(dangle);
|
|
44157
44162
|
var s = Math.sin(dangle);
|
|
44158
|
-
var fx =
|
|
44159
|
-
var fy =
|
|
44163
|
+
var fx = 1 / sizeX;
|
|
44164
|
+
var fy = 1 / sizeY;
|
|
44165
|
+
var fxy = sizeX * fy;
|
|
44166
|
+
var fyx = sizeY * fx;
|
|
44160
44167
|
var ileft = n >> 2;
|
|
44161
44168
|
var iright = ileft * 3;
|
|
44162
44169
|
var ppx = sizeX * s;
|
|
@@ -44165,20 +44172,12 @@
|
|
|
44165
44172
|
var py = sizeY;
|
|
44166
44173
|
var nx = -sizeX * s;
|
|
44167
44174
|
var ny = sizeY * c;
|
|
44168
|
-
var nnx = nx * c - ny *
|
|
44169
|
-
var nny = nx *
|
|
44175
|
+
var nnx = nx * c - ny * fxy * s;
|
|
44176
|
+
var nny = nx * fyx * s + ny * c;
|
|
44170
44177
|
var sx = this.toSkeletonX(ppx, ppy, px, py, nx, ny);
|
|
44171
|
-
|
|
44172
|
-
vertices[1] = sizeY;
|
|
44173
|
-
clippings[0] = -1;
|
|
44174
|
-
distances[0] = sx;
|
|
44175
|
-
lengths[0] = 0;
|
|
44176
|
-
uvs[0] = 0.5;
|
|
44177
|
-
uvs[1] = 1;
|
|
44178
|
-
var iv = 1;
|
|
44178
|
+
var iv = 0;
|
|
44179
44179
|
var ii = 0;
|
|
44180
|
-
var
|
|
44181
|
-
var current = 0;
|
|
44180
|
+
var l = 0;
|
|
44182
44181
|
var maxDistance = 0;
|
|
44183
44182
|
for (var i = 0; i < n; ++i) {
|
|
44184
44183
|
var inext = (i + 1) % n;
|
|
@@ -44194,59 +44193,38 @@
|
|
|
44194
44193
|
var dy = ny - py;
|
|
44195
44194
|
var dl = Math.sqrt(dx * dx + dy * dy);
|
|
44196
44195
|
var fl = 1 / dl;
|
|
44197
|
-
var
|
|
44198
|
-
var
|
|
44199
|
-
var
|
|
44200
|
-
|
|
44201
|
-
|
|
44202
|
-
var
|
|
44203
|
-
|
|
44204
|
-
|
|
44205
|
-
|
|
44206
|
-
|
|
44207
|
-
|
|
44208
|
-
|
|
44209
|
-
|
|
44210
|
-
|
|
44211
|
-
|
|
44212
|
-
|
|
44213
|
-
|
|
44214
|
-
|
|
44215
|
-
|
|
44216
|
-
|
|
44217
|
-
|
|
44218
|
-
|
|
44219
|
-
|
|
44220
|
-
|
|
44221
|
-
|
|
44222
|
-
|
|
44223
|
-
clippings[current] = -1 - ndistance;
|
|
44224
|
-
}
|
|
44225
|
-
else {
|
|
44226
|
-
var mdistance = Math.abs(-dx * py - dy * (sx - px)) * fl;
|
|
44227
|
-
maxDistance = Math.max(maxDistance, mdistance);
|
|
44228
|
-
clippings[current] = -1 - mdistance;
|
|
44229
|
-
var miv1 = iv++;
|
|
44230
|
-
var miv2 = miv1 << 1;
|
|
44231
|
-
vertices[miv2] = sx;
|
|
44232
|
-
vertices[miv2 + 1] = 0;
|
|
44233
|
-
clippings[miv1] = mdistance;
|
|
44234
|
-
distances[miv1] = 0;
|
|
44235
|
-
lengths[miv1] = length + ((sx - px) * dx - py * dy) * fl;
|
|
44236
|
-
uvs[miv2] = 0.5 * (sx / sizeX + 1);
|
|
44237
|
-
uvs[miv2 + 1] = 0.5;
|
|
44238
|
-
indices[ii++] = current;
|
|
44239
|
-
indices[ii++] = niv1;
|
|
44240
|
-
indices[ii++] = miv1;
|
|
44241
|
-
}
|
|
44242
|
-
current = iv1;
|
|
44243
|
-
length = nlength;
|
|
44196
|
+
var nl = l + dl;
|
|
44197
|
+
var nd = Math.abs(-dx * py - dy * (nsx - px)) * fl;
|
|
44198
|
+
var md = sx === nsx ? nd : Math.abs(-dx * py - dy * (sx - px)) * fl;
|
|
44199
|
+
maxDistance = Math.max(maxDistance, nd, md);
|
|
44200
|
+
// Each edge owns its vertices so that the lengths are exact at clipping = 1 on both sides.
|
|
44201
|
+
var iva = iv++;
|
|
44202
|
+
var ivb = iv++;
|
|
44203
|
+
var ivn = iv++;
|
|
44204
|
+
var ls0 = ((px - sx) * dx + py * dy) * fl;
|
|
44205
|
+
var ls1 = ((nx - nsx) * dx + ny * dy) * fl;
|
|
44206
|
+
var ls2 = ((nsx - px) * dx - py * dy) * fl;
|
|
44207
|
+
this.writeVertex(iva, px, py, fx, fy, sx, l, -1 - md, ls0);
|
|
44208
|
+
this.writeVertex(ivb, nx, ny, fx, fy, nsx, nl, -1 - nd, ls1);
|
|
44209
|
+
this.writeVertex(ivn, nsx, 0, fx, fy, 0, l + ls2, nd, 0);
|
|
44210
|
+
indices[ii++] = iva;
|
|
44211
|
+
indices[ii++] = ivb;
|
|
44212
|
+
indices[ii++] = ivn;
|
|
44213
|
+
if (sx !== nsx) {
|
|
44214
|
+
var ivm = iv++;
|
|
44215
|
+
var ls3 = ((sx - px) * dx - py * dy) * fl;
|
|
44216
|
+
this.writeVertex(ivm, sx, 0, fx, fy, 0, l + ls3, md, 0);
|
|
44217
|
+
indices[ii++] = iva;
|
|
44218
|
+
indices[ii++] = ivn;
|
|
44219
|
+
indices[ii++] = ivm;
|
|
44220
|
+
}
|
|
44221
|
+
l = nl;
|
|
44244
44222
|
px = nx;
|
|
44245
44223
|
py = ny;
|
|
44246
44224
|
nx = nnx;
|
|
44247
44225
|
ny = nny;
|
|
44248
|
-
nnx = c * nx - s * ny *
|
|
44249
|
-
nny = s * nx *
|
|
44226
|
+
nnx = c * nx - s * ny * fxy;
|
|
44227
|
+
nny = s * nx * fyx + c * ny;
|
|
44250
44228
|
sx = nsx;
|
|
44251
44229
|
}
|
|
44252
44230
|
var fdistance = 0;
|
|
@@ -44254,6 +44232,7 @@
|
|
|
44254
44232
|
fdistance = 1 / maxDistance;
|
|
44255
44233
|
}
|
|
44256
44234
|
var shift = (scale - 1) * maxDistance;
|
|
44235
|
+
var lengthShifts = this._lengthShifts;
|
|
44257
44236
|
for (var i = 0; i < iv; ++i) {
|
|
44258
44237
|
var clipping = clippings[i];
|
|
44259
44238
|
if (0 <= clipping) {
|
|
@@ -44266,6 +44245,7 @@
|
|
|
44266
44245
|
var factor = shift / distance;
|
|
44267
44246
|
var x = vertices[i2] + (vertices[i2] - distances[i]) * factor;
|
|
44268
44247
|
var y = vertices[i2 + 1] * (1 + factor);
|
|
44248
|
+
lengths[i] += factor * lengthShifts[i];
|
|
44269
44249
|
vertices[i2] = x;
|
|
44270
44250
|
vertices[i2 + 1] = y;
|
|
44271
44251
|
uvs[i2] = 0.5 * (x / sizeX + 1);
|
|
@@ -44302,8 +44282,10 @@
|
|
|
44302
44282
|
var dangle = (2 * Math.PI) / n;
|
|
44303
44283
|
var c = Math.cos(dangle);
|
|
44304
44284
|
var s = Math.sin(dangle);
|
|
44305
|
-
var fx =
|
|
44306
|
-
var fy =
|
|
44285
|
+
var fx = 1 / sizeX;
|
|
44286
|
+
var fy = 1 / sizeY;
|
|
44287
|
+
var fxy = sizeX * fy;
|
|
44288
|
+
var fyx = sizeY * fx;
|
|
44307
44289
|
var itop = 0;
|
|
44308
44290
|
var ibottom = n >> 1;
|
|
44309
44291
|
var ppx = sizeX * s;
|
|
@@ -44314,20 +44296,12 @@
|
|
|
44314
44296
|
var py = sizeY;
|
|
44315
44297
|
var nx = -sizeX * s;
|
|
44316
44298
|
var ny = sizeY * c;
|
|
44317
|
-
var nnx = c * nx - s * ny *
|
|
44318
|
-
var nny = s * nx *
|
|
44299
|
+
var nnx = c * nx - s * ny * fxy;
|
|
44300
|
+
var nny = s * nx * fyx + c * ny;
|
|
44319
44301
|
var sy = this.toSkeletonY(pppx, pppy, ppx, ppy, px, py);
|
|
44320
|
-
|
|
44321
|
-
vertices[1] = sizeY;
|
|
44322
|
-
clippings[0] = -1;
|
|
44323
|
-
distances[0] = sy;
|
|
44324
|
-
lengths[0] = 0;
|
|
44325
|
-
uvs[0] = 0.5;
|
|
44326
|
-
uvs[1] = 1;
|
|
44327
|
-
var iv = 1;
|
|
44302
|
+
var iv = 0;
|
|
44328
44303
|
var ii = 0;
|
|
44329
|
-
var
|
|
44330
|
-
var current = 0;
|
|
44304
|
+
var l = 0;
|
|
44331
44305
|
var maxDistance = 0;
|
|
44332
44306
|
for (var i = 0; i < n; ++i) {
|
|
44333
44307
|
var inext = (i + 1) % n;
|
|
@@ -44343,59 +44317,38 @@
|
|
|
44343
44317
|
var dy = ny - py;
|
|
44344
44318
|
var dl = Math.sqrt(dx * dx + dy * dy);
|
|
44345
44319
|
var fl = 1 / dl;
|
|
44346
|
-
var
|
|
44347
|
-
var
|
|
44348
|
-
var
|
|
44349
|
-
|
|
44350
|
-
|
|
44351
|
-
var
|
|
44352
|
-
|
|
44353
|
-
|
|
44354
|
-
|
|
44355
|
-
|
|
44356
|
-
|
|
44357
|
-
|
|
44358
|
-
|
|
44359
|
-
|
|
44360
|
-
|
|
44361
|
-
|
|
44362
|
-
|
|
44363
|
-
|
|
44364
|
-
|
|
44365
|
-
|
|
44366
|
-
|
|
44367
|
-
|
|
44368
|
-
|
|
44369
|
-
|
|
44370
|
-
|
|
44371
|
-
|
|
44372
|
-
clippings[current] = -1 - ndistance;
|
|
44373
|
-
}
|
|
44374
|
-
else {
|
|
44375
|
-
var mdistance = Math.abs(dx * (sy - py) + dy * px) * fl;
|
|
44376
|
-
maxDistance = Math.max(maxDistance, mdistance);
|
|
44377
|
-
clippings[current] = -1 - mdistance;
|
|
44378
|
-
var miv1 = iv++;
|
|
44379
|
-
var miv2 = miv1 << 1;
|
|
44380
|
-
vertices[miv2] = 0;
|
|
44381
|
-
vertices[miv2 + 1] = sy;
|
|
44382
|
-
clippings[miv1] = mdistance;
|
|
44383
|
-
distances[miv1] = 0;
|
|
44384
|
-
lengths[miv1] = length + (-px * dx + (sy - py) * dy) * fl;
|
|
44385
|
-
uvs[miv2] = 0.5;
|
|
44386
|
-
uvs[miv2 + 1] = 0.5 * (sy / sizeY + 1);
|
|
44387
|
-
indices[ii++] = current;
|
|
44388
|
-
indices[ii++] = niv1;
|
|
44389
|
-
indices[ii++] = miv1;
|
|
44390
|
-
}
|
|
44391
|
-
current = iv1;
|
|
44392
|
-
length = nlength;
|
|
44320
|
+
var nl = l + dl;
|
|
44321
|
+
var nd = Math.abs(dx * (nsy - py) + dy * px) * fl;
|
|
44322
|
+
var md = sy === nsy ? nd : Math.abs(dx * (sy - py) + dy * px) * fl;
|
|
44323
|
+
maxDistance = Math.max(maxDistance, nd, md);
|
|
44324
|
+
// Each edge owns its vertices so that the lengths are exact at clipping = 1 on both sides.
|
|
44325
|
+
var iva = iv++;
|
|
44326
|
+
var ivb = iv++;
|
|
44327
|
+
var ivn = iv++;
|
|
44328
|
+
var ls0 = (px * dx + (py - sy) * dy) * fl;
|
|
44329
|
+
var ls1 = (nx * dx + (ny - nsy) * dy) * fl;
|
|
44330
|
+
var ls2 = (-px * dx + (nsy - py) * dy) * fl;
|
|
44331
|
+
this.writeVertex(iva, px, py, fx, fy, sy, l, -1 - md, ls0);
|
|
44332
|
+
this.writeVertex(ivb, nx, ny, fx, fy, nsy, nl, -1 - nd, ls1);
|
|
44333
|
+
this.writeVertex(ivn, 0, nsy, fx, fy, 0, l + ls2, nd, 0);
|
|
44334
|
+
indices[ii++] = iva;
|
|
44335
|
+
indices[ii++] = ivb;
|
|
44336
|
+
indices[ii++] = ivn;
|
|
44337
|
+
if (sy !== nsy) {
|
|
44338
|
+
var ivm = iv++;
|
|
44339
|
+
var ls3 = (-px * dx + (sy - py) * dy) * fl;
|
|
44340
|
+
this.writeVertex(ivm, 0, sy, fx, fy, 0, l + ls3, md, 0);
|
|
44341
|
+
indices[ii++] = iva;
|
|
44342
|
+
indices[ii++] = ivn;
|
|
44343
|
+
indices[ii++] = ivm;
|
|
44344
|
+
}
|
|
44345
|
+
l = nl;
|
|
44393
44346
|
px = nx;
|
|
44394
44347
|
py = ny;
|
|
44395
44348
|
nx = nnx;
|
|
44396
44349
|
ny = nny;
|
|
44397
|
-
nnx = c * nx - s * ny *
|
|
44398
|
-
nny = s * nx *
|
|
44350
|
+
nnx = c * nx - s * ny * fxy;
|
|
44351
|
+
nny = s * nx * fyx + c * ny;
|
|
44399
44352
|
sy = nsy;
|
|
44400
44353
|
}
|
|
44401
44354
|
var fdistance = 0;
|
|
@@ -44403,6 +44356,7 @@
|
|
|
44403
44356
|
fdistance = 1 / maxDistance;
|
|
44404
44357
|
}
|
|
44405
44358
|
var shift = (scale - 1) * maxDistance;
|
|
44359
|
+
var lengthShifts = this._lengthShifts;
|
|
44406
44360
|
for (var i = 0; i < iv; ++i) {
|
|
44407
44361
|
var clipping = clippings[i];
|
|
44408
44362
|
if (0 <= clipping) {
|
|
@@ -44415,6 +44369,7 @@
|
|
|
44415
44369
|
var factor = shift / distance;
|
|
44416
44370
|
var x = vertices[i2] * (1 + factor);
|
|
44417
44371
|
var y = vertices[i2 + 1] + (vertices[i2 + 1] - distances[i]) * factor;
|
|
44372
|
+
lengths[i] += factor * lengthShifts[i];
|
|
44418
44373
|
vertices[i2] = x;
|
|
44419
44374
|
vertices[i2 + 1] = y;
|
|
44420
44375
|
uvs[i2] = 0.5 * (x / sizeX + 1);
|
|
@@ -44438,6 +44393,17 @@
|
|
|
44438
44393
|
var by = pdy * fp + ndy * fn;
|
|
44439
44394
|
return py - (px * by) / bx;
|
|
44440
44395
|
};
|
|
44396
|
+
EShapeCircleTriangulatedImpl.prototype.writeVertex = function (iv, x, y, fx, fy, distance, length, clipping, lengthShift) {
|
|
44397
|
+
var iv2 = iv << 1;
|
|
44398
|
+
this._vertices[iv2] = x;
|
|
44399
|
+
this._vertices[iv2 + 1] = y;
|
|
44400
|
+
this._distances[iv] = distance;
|
|
44401
|
+
this._lengths[iv] = length;
|
|
44402
|
+
this._clippings[iv] = clipping;
|
|
44403
|
+
this._lengthShifts[iv] = lengthShift;
|
|
44404
|
+
this._uvs[iv2] = 0.5 * (x * fx + 1);
|
|
44405
|
+
this._uvs[iv2 + 1] = 0.5 * (y * fy + 1);
|
|
44406
|
+
};
|
|
44441
44407
|
return EShapeCircleTriangulatedImpl;
|
|
44442
44408
|
}());
|
|
44443
44409
|
|
|
@@ -45368,6 +45334,10 @@
|
|
|
45368
45334
|
return BuilderLine;
|
|
45369
45335
|
}(BuilderBase));
|
|
45370
45336
|
|
|
45337
|
+
/*
|
|
45338
|
+
* Copyright (C) 2019 Toshiba Corporation
|
|
45339
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
45340
|
+
*/
|
|
45371
45341
|
var TRIANGLE_LEGACY_VERTEX_COUNT = 7;
|
|
45372
45342
|
var TRIANGLE_LEGACY_INDEX_COUNT = 3;
|
|
45373
45343
|
var TRIANGLE_LEGACY_WORLD_SIZE = [0, 0, 0];
|
|
@@ -45845,6 +45815,10 @@
|
|
|
45845
45815
|
return BuilderNull;
|
|
45846
45816
|
}());
|
|
45847
45817
|
|
|
45818
|
+
/*
|
|
45819
|
+
* Copyright (C) 2019 Toshiba Corporation
|
|
45820
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
45821
|
+
*/
|
|
45848
45822
|
var RECTANGLE_LEGACY_VERTEX_COUNT = 16;
|
|
45849
45823
|
var RECTANGLE_LEGACY_INDEX_COUNT = 8;
|
|
45850
45824
|
var RECTANGLE_LEGACY_WORLD_SIZE = [0, 0];
|
|
@@ -47988,6 +47962,918 @@
|
|
|
47988
47962
|
EShapeCapabilities.set(EShapeType.EMBEDDED_ACCEPTOR_EDGE, EShapeCapability.EMBEDDED_ACCEPTOR_EDGE);
|
|
47989
47963
|
};
|
|
47990
47964
|
|
|
47965
|
+
/*
|
|
47966
|
+
* Copyright (C) 2019-2026 Toshiba Corporation
|
|
47967
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
47968
|
+
*/
|
|
47969
|
+
/**
|
|
47970
|
+
* Converts an angle ratio to the half central angle of a fan in [0, PI / 2].
|
|
47971
|
+
*/
|
|
47972
|
+
var toFanAngleCentric = function (angle) {
|
|
47973
|
+
return Math.PI * Math.max(0, Math.min(0.5, angle));
|
|
47974
|
+
};
|
|
47975
|
+
|
|
47976
|
+
/*
|
|
47977
|
+
* Copyright (C) 2019-2026 Toshiba Corporation
|
|
47978
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
47979
|
+
*/
|
|
47980
|
+
/**
|
|
47981
|
+
* Converts the half central angle of fans to the eccentric angle of the arc end points
|
|
47982
|
+
* of the fan whose arc is on the ellipse with the semi-axes (w, h).
|
|
47983
|
+
*/
|
|
47984
|
+
var toFanAngleEccentric = function (w, h, theta) {
|
|
47985
|
+
return Math.atan((h / w) * Math.tan(theta));
|
|
47986
|
+
};
|
|
47987
|
+
|
|
47988
|
+
/*
|
|
47989
|
+
* Copyright (C) 2019-2026 Toshiba Corporation
|
|
47990
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
47991
|
+
*/
|
|
47992
|
+
/**
|
|
47993
|
+
* Triangulates a fan whose arc is on the ellipse with the semi-axes (w, h) centered at the origin O.
|
|
47994
|
+
* The vertices are computed in the frame where w and h are positive and flipped at the end.
|
|
47995
|
+
*
|
|
47996
|
+
* ## Points
|
|
47997
|
+
*
|
|
47998
|
+
* - O: the apex of the fan, the origin
|
|
47999
|
+
* - A, B: the end points of the arc, (-w sin(ea), -h cos(ea)) and (+w sin(ea), -h cos(ea))
|
|
48000
|
+
* - C: the point where the area of the fan becomes zero when the fan shrinks, (0, -h / (1 + sin(ca)))
|
|
48001
|
+
* - P[k]: the points on the arc, k in [0, 2N] (P[0] = A, P[N] is the top, P[2N] = B)
|
|
48002
|
+
* - Q[k]: the points on the medial axis of the fan, which are on the normal of the arc at P[k]
|
|
48003
|
+
* and equidistant from the arc and the straight sides (Q[0] = A, Q[N] = C, Q[2N] = B)
|
|
48004
|
+
* - R[k]: the points P[k] shifted outward for the anti-aliasing
|
|
48005
|
+
* - O': the point O shifted outward for the anti-aliasing
|
|
48006
|
+
*
|
|
48007
|
+
* ## Stroke sides
|
|
48008
|
+
*
|
|
48009
|
+
* The clipping of a vertex is 1 on the outline and decreases toward the inside by (the distance from the outline) * fd,
|
|
48010
|
+
* where the outline is the arc and/or the straight sides depending on the stroke side.
|
|
48011
|
+
*
|
|
48012
|
+
* - ALL (and NONE): the stroke is at the arc and the straight sides.
|
|
48013
|
+
* The fan is triangulated into the strip P[k], P[k + 1], Q[k + 1], Q[k] and
|
|
48014
|
+
* the two polygons O', A', Q[0], ..., Q[N] and O', B', Q[2N], ..., Q[N] at the bottom.
|
|
48015
|
+
* - TOP: the stroke is only at the arc.
|
|
48016
|
+
* For a circle and a semi-ellipse, Q[k] are the points on the axis, which gives the exact fan with the strip only.
|
|
48017
|
+
* For the other ellipses, Q[k] are on the medial axis as ALL, and the two polygons
|
|
48018
|
+
* O, Q[0], ..., Q[N] and O, Q[2N], ..., Q[N] are added at the bottom without the stroke and the anti-aliasing.
|
|
48019
|
+
* - BOTTOM: the stroke is only at the straight sides.
|
|
48020
|
+
* It is the same as a polygon. Two triangle fans from C cover the area between the arc and the segments CA and CB,
|
|
48021
|
+
* and two quads O', A', A, C and O', B', B, C cover the rest.
|
|
48022
|
+
*/
|
|
48023
|
+
var EShapeFanTriangulatedImpl = /** @class */ (function () {
|
|
48024
|
+
function EShapeFanTriangulatedImpl(parent) {
|
|
48025
|
+
this._id = 0;
|
|
48026
|
+
this._parent = parent;
|
|
48027
|
+
this._width = 0;
|
|
48028
|
+
this._height = 0;
|
|
48029
|
+
this._strokeAlign = 0;
|
|
48030
|
+
this._strokeWidth = 0;
|
|
48031
|
+
this._strokeSideTop = true;
|
|
48032
|
+
this._strokeSideBottom = true;
|
|
48033
|
+
this._angle = 0;
|
|
48034
|
+
this._sizeX = 0;
|
|
48035
|
+
this._sizeY = 0;
|
|
48036
|
+
this._vertices = [];
|
|
48037
|
+
this._nvertices = 0;
|
|
48038
|
+
this._distances = [];
|
|
48039
|
+
this._lengths = [];
|
|
48040
|
+
this._clippings = [];
|
|
48041
|
+
this._uvs = [];
|
|
48042
|
+
this._indices = [];
|
|
48043
|
+
this._nindices = 0;
|
|
48044
|
+
this._boundary = [0, 0, 0, 0];
|
|
48045
|
+
}
|
|
48046
|
+
Object.defineProperty(EShapeFanTriangulatedImpl.prototype, "id", {
|
|
48047
|
+
get: function () {
|
|
48048
|
+
this.triangulate();
|
|
48049
|
+
return this._id;
|
|
48050
|
+
},
|
|
48051
|
+
enumerable: false,
|
|
48052
|
+
configurable: true
|
|
48053
|
+
});
|
|
48054
|
+
Object.defineProperty(EShapeFanTriangulatedImpl.prototype, "vertices", {
|
|
48055
|
+
get: function () {
|
|
48056
|
+
this.triangulate();
|
|
48057
|
+
return this._vertices;
|
|
48058
|
+
},
|
|
48059
|
+
enumerable: false,
|
|
48060
|
+
configurable: true
|
|
48061
|
+
});
|
|
48062
|
+
Object.defineProperty(EShapeFanTriangulatedImpl.prototype, "nvertices", {
|
|
48063
|
+
get: function () {
|
|
48064
|
+
this.triangulate();
|
|
48065
|
+
return this._nvertices;
|
|
48066
|
+
},
|
|
48067
|
+
enumerable: false,
|
|
48068
|
+
configurable: true
|
|
48069
|
+
});
|
|
48070
|
+
Object.defineProperty(EShapeFanTriangulatedImpl.prototype, "distances", {
|
|
48071
|
+
get: function () {
|
|
48072
|
+
this.triangulate();
|
|
48073
|
+
return this._distances;
|
|
48074
|
+
},
|
|
48075
|
+
enumerable: false,
|
|
48076
|
+
configurable: true
|
|
48077
|
+
});
|
|
48078
|
+
Object.defineProperty(EShapeFanTriangulatedImpl.prototype, "lengths", {
|
|
48079
|
+
get: function () {
|
|
48080
|
+
this.triangulate();
|
|
48081
|
+
return this._lengths;
|
|
48082
|
+
},
|
|
48083
|
+
enumerable: false,
|
|
48084
|
+
configurable: true
|
|
48085
|
+
});
|
|
48086
|
+
Object.defineProperty(EShapeFanTriangulatedImpl.prototype, "clippings", {
|
|
48087
|
+
get: function () {
|
|
48088
|
+
this.triangulate();
|
|
48089
|
+
return this._clippings;
|
|
48090
|
+
},
|
|
48091
|
+
enumerable: false,
|
|
48092
|
+
configurable: true
|
|
48093
|
+
});
|
|
48094
|
+
Object.defineProperty(EShapeFanTriangulatedImpl.prototype, "uvs", {
|
|
48095
|
+
get: function () {
|
|
48096
|
+
this.triangulate();
|
|
48097
|
+
return this._uvs;
|
|
48098
|
+
},
|
|
48099
|
+
enumerable: false,
|
|
48100
|
+
configurable: true
|
|
48101
|
+
});
|
|
48102
|
+
Object.defineProperty(EShapeFanTriangulatedImpl.prototype, "indices", {
|
|
48103
|
+
get: function () {
|
|
48104
|
+
this.triangulate();
|
|
48105
|
+
return this._indices;
|
|
48106
|
+
},
|
|
48107
|
+
enumerable: false,
|
|
48108
|
+
configurable: true
|
|
48109
|
+
});
|
|
48110
|
+
Object.defineProperty(EShapeFanTriangulatedImpl.prototype, "nindices", {
|
|
48111
|
+
get: function () {
|
|
48112
|
+
this.triangulate();
|
|
48113
|
+
return this._nindices;
|
|
48114
|
+
},
|
|
48115
|
+
enumerable: false,
|
|
48116
|
+
configurable: true
|
|
48117
|
+
});
|
|
48118
|
+
Object.defineProperty(EShapeFanTriangulatedImpl.prototype, "boundary", {
|
|
48119
|
+
get: function () {
|
|
48120
|
+
this.triangulate();
|
|
48121
|
+
return this._boundary;
|
|
48122
|
+
},
|
|
48123
|
+
enumerable: false,
|
|
48124
|
+
configurable: true
|
|
48125
|
+
});
|
|
48126
|
+
EShapeFanTriangulatedImpl.prototype.triangulate = function () {
|
|
48127
|
+
var isNotInitialized = this._id === 0;
|
|
48128
|
+
var parent = this._parent;
|
|
48129
|
+
var size = parent.size;
|
|
48130
|
+
var width = size.x;
|
|
48131
|
+
var height = size.y;
|
|
48132
|
+
var isRectChanged = this._width !== width || this._height !== height;
|
|
48133
|
+
var stroke = parent.stroke;
|
|
48134
|
+
var strokeAlign = stroke.align;
|
|
48135
|
+
var strokeSideTop = (stroke.side & EShapeStrokeSide.TOP) !== 0;
|
|
48136
|
+
var strokeSideBottom = (stroke.side & EShapeStrokeSide.BOTTOM) !== 0;
|
|
48137
|
+
var strokeWidth = stroke.enable && (strokeSideTop || strokeSideBottom) ? stroke.width : 0;
|
|
48138
|
+
var isStrokeChanged = this._strokeAlign !== strokeAlign || this._strokeWidth !== strokeWidth;
|
|
48139
|
+
var isStrokeSideChanged = this._strokeSideTop !== strokeSideTop || this._strokeSideBottom !== strokeSideBottom;
|
|
48140
|
+
var angle = parent.angle;
|
|
48141
|
+
var isAngleChanged = this._angle !== angle;
|
|
48142
|
+
var isSizeChanged = false;
|
|
48143
|
+
var sizeX = this._sizeX;
|
|
48144
|
+
var sizeY = this._sizeY;
|
|
48145
|
+
if (isRectChanged || isStrokeChanged) {
|
|
48146
|
+
this._width = width;
|
|
48147
|
+
this._height = height;
|
|
48148
|
+
this._strokeAlign = strokeAlign;
|
|
48149
|
+
this._strokeWidth = strokeWidth;
|
|
48150
|
+
var s = strokeAlign * strokeWidth;
|
|
48151
|
+
sizeX = width * 0.5 + (0 <= width ? +s : -s);
|
|
48152
|
+
sizeY = height * 0.5 + (0 <= height ? +s : -s);
|
|
48153
|
+
isSizeChanged = this._sizeX !== sizeX || this._sizeY !== sizeY;
|
|
48154
|
+
}
|
|
48155
|
+
if (isNotInitialized || isSizeChanged || isStrokeSideChanged || isAngleChanged) {
|
|
48156
|
+
this._sizeX = sizeX;
|
|
48157
|
+
this._sizeY = sizeY;
|
|
48158
|
+
this._strokeSideTop = strokeSideTop;
|
|
48159
|
+
this._strokeSideBottom = strokeSideBottom;
|
|
48160
|
+
this._angle = angle;
|
|
48161
|
+
this.update(sizeX, sizeY, angle, strokeSideTop, strokeSideBottom);
|
|
48162
|
+
}
|
|
48163
|
+
};
|
|
48164
|
+
EShapeFanTriangulatedImpl.prototype.update = function (sx, sy, angle, sst, ssb) {
|
|
48165
|
+
// The number of the arc segments is 2n and the number of the points on the arc is m.
|
|
48166
|
+
var n = EShapeDefaults.CIRCLE_SEGMENT_COUNT >> 2;
|
|
48167
|
+
var m = 2 * n + 1;
|
|
48168
|
+
var nv = 2 * m + 2 * (n + 3);
|
|
48169
|
+
var ni = 4 * n + 2 * (n + 1);
|
|
48170
|
+
this._nvertices = nv;
|
|
48171
|
+
this._nindices = ni;
|
|
48172
|
+
this._id += 1;
|
|
48173
|
+
// The eccentric angle ea of A and B, and the sine and cosine of it
|
|
48174
|
+
var ax = Math.abs(sx);
|
|
48175
|
+
var ay = Math.abs(sy);
|
|
48176
|
+
if (ax <= 0 || ay <= 0) {
|
|
48177
|
+
this.updateEmpty(ax, ay, nv, ni);
|
|
48178
|
+
return;
|
|
48179
|
+
}
|
|
48180
|
+
var ca = toFanAngleCentric(angle);
|
|
48181
|
+
var ea = toFanAngleEccentric(ax, ay, ca);
|
|
48182
|
+
var sea = Math.sin(ea);
|
|
48183
|
+
var cea = Math.cos(ea);
|
|
48184
|
+
var bx = ax * sea;
|
|
48185
|
+
var by = ay * cea;
|
|
48186
|
+
var bz = bx * bx + by * by;
|
|
48187
|
+
if (bx <= 0 || bz <= 0) {
|
|
48188
|
+
this.updateEmpty(ax, ay, nv, ni);
|
|
48189
|
+
return;
|
|
48190
|
+
}
|
|
48191
|
+
// The sine and cosine of the geometric half central angle
|
|
48192
|
+
var oa = Math.sqrt(bz);
|
|
48193
|
+
var st = bx / oa;
|
|
48194
|
+
var ct = by / oa;
|
|
48195
|
+
// The factors of the UVs and the signs of the flipping
|
|
48196
|
+
var fx = 1 / bx;
|
|
48197
|
+
var fy = 1 / ay;
|
|
48198
|
+
var gx = Math.sign(sx);
|
|
48199
|
+
var gy = Math.sign(sy);
|
|
48200
|
+
if (!sst && ssb) {
|
|
48201
|
+
this.updateBottom(ax, ay, n, ea, sea, cea, bx, by, st, ct, fx, fy, gx, gy, nv, ni);
|
|
48202
|
+
}
|
|
48203
|
+
else {
|
|
48204
|
+
this.updateArc(ax, ay, n, ea, sea, cea, bx, oa, st, ct, fx, fy, gx, gy, sst, ssb, nv, ni);
|
|
48205
|
+
}
|
|
48206
|
+
};
|
|
48207
|
+
/**
|
|
48208
|
+
* Fills the empty fan, which has no vertices to draw.
|
|
48209
|
+
*/
|
|
48210
|
+
EShapeFanTriangulatedImpl.prototype.updateEmpty = function (w, h, nv, ni) {
|
|
48211
|
+
var boundary = this._boundary;
|
|
48212
|
+
boundary[0] = -w;
|
|
48213
|
+
boundary[1] = -h;
|
|
48214
|
+
boundary[2] = +w;
|
|
48215
|
+
boundary[3] = +h;
|
|
48216
|
+
this.pad(0, 0, nv, ni, 0);
|
|
48217
|
+
};
|
|
48218
|
+
EShapeFanTriangulatedImpl.prototype.updateArc = function (w, h, n, ea, sea, cea, bx, oa, st, ct, fx, fy, gx, gy, sst, ssb, nv, ni) {
|
|
48219
|
+
var m = 2 * n + 1;
|
|
48220
|
+
// sided: the straight sides are the outline, which has the stroke and the anti-aliasing
|
|
48221
|
+
// capped: the polygons are added at the bottom to cover the sector with the hard straight sides
|
|
48222
|
+
// chained: Q is on the medial axis. Otherwise, Q is on the axis x = 0 (w <= h) or y = 0 (h < w)
|
|
48223
|
+
// For a circle and a semi-ellipse, Q on the axis gives the exact fan.
|
|
48224
|
+
var sided = !sst || ssb;
|
|
48225
|
+
var isExact = Math.abs(w - h) <= 1e-9 * w || Math.PI * 0.5 <= ea;
|
|
48226
|
+
var capped = !sided && !isExact;
|
|
48227
|
+
var chained = sided || capped;
|
|
48228
|
+
this.computeArcPoints(w, h, n, ea, sea, cea);
|
|
48229
|
+
this.computeArcNormals(w, h, n, ea);
|
|
48230
|
+
var dmax = this.computeMedialPoints(w, h, n, st, ct, chained);
|
|
48231
|
+
if (capped) {
|
|
48232
|
+
// The distance field of the arc must cover O, which is the farthest point from the arc,
|
|
48233
|
+
// because the clipping in the polygons at the bottom is interpolated from the arc to O.
|
|
48234
|
+
dmax = Math.max(dmax, h <= w ? h : oa);
|
|
48235
|
+
}
|
|
48236
|
+
if (dmax <= 0) {
|
|
48237
|
+
this.updateEmpty(w, h, nv, ni);
|
|
48238
|
+
return;
|
|
48239
|
+
}
|
|
48240
|
+
var boundary = this._boundary;
|
|
48241
|
+
boundary[0] = -bx;
|
|
48242
|
+
boundary[1] = -h;
|
|
48243
|
+
boundary[2] = +bx;
|
|
48244
|
+
boundary[3] = 0;
|
|
48245
|
+
var fd = 1 / dmax;
|
|
48246
|
+
var fs = (EShapeFanTriangulatedImpl.SCALE - 1) * dmax;
|
|
48247
|
+
this.computeRimPoints(w, h, n, fs, st, ct, sea, cea, sided);
|
|
48248
|
+
// Strip: 2m vertices and 2 * 3 * (m - 1) indices
|
|
48249
|
+
this.writeStrip(m, fd, fx, fy, gx, gy);
|
|
48250
|
+
var iv = 2 * m;
|
|
48251
|
+
var ii = 6 * (m - 1);
|
|
48252
|
+
// Polygons at the bottom: left (sign = -1) and right (sign = +1)
|
|
48253
|
+
if (sided) {
|
|
48254
|
+
for (var sign = -1; sign <= 1; sign += 2) {
|
|
48255
|
+
var count = this.writeSidePolygon(iv, ii, sign, n, w, oa, st, ct, fs, fd, fx, fy, gx, gy);
|
|
48256
|
+
iv += count;
|
|
48257
|
+
ii += 3 * (count - 2);
|
|
48258
|
+
}
|
|
48259
|
+
}
|
|
48260
|
+
else if (capped) {
|
|
48261
|
+
var co = Math.max(0, 1 - (w >= h ? h : oa) * fd);
|
|
48262
|
+
for (var sign = -1; sign <= 1; sign += 2) {
|
|
48263
|
+
var count = this.writeCapPolygon(iv, ii, sign, n, w, co, fd, fx, fy, gx, gy);
|
|
48264
|
+
iv += count;
|
|
48265
|
+
ii += 3 * (count - 2);
|
|
48266
|
+
}
|
|
48267
|
+
}
|
|
48268
|
+
this.pad(iv, ii, nv, ni, fd);
|
|
48269
|
+
};
|
|
48270
|
+
/**
|
|
48271
|
+
* Computes P[k], the points on the arc, in the work arrays.
|
|
48272
|
+
*
|
|
48273
|
+
* The sine and cosine of the angle are updated by the rotation to avoid calling Math.sin and Math.cos in the loop.
|
|
48274
|
+
* The points are symmetric with respect to the axis x = 0, so only the left half is computed
|
|
48275
|
+
* and the right half is mirrored from it.
|
|
48276
|
+
*/
|
|
48277
|
+
EShapeFanTriangulatedImpl.prototype.computeArcPoints = function (w, h, n, ea, sea, cea) {
|
|
48278
|
+
var m = 2 * n + 1;
|
|
48279
|
+
var px = EShapeFanTriangulatedImpl.WORK_ARC_X;
|
|
48280
|
+
var py = EShapeFanTriangulatedImpl.WORK_ARC_Y;
|
|
48281
|
+
var da = ea / n;
|
|
48282
|
+
var cda = Math.cos(da);
|
|
48283
|
+
var sda = Math.sin(da);
|
|
48284
|
+
var s = -sea;
|
|
48285
|
+
var c = cea;
|
|
48286
|
+
for (var k = 0; k <= n; ++k) {
|
|
48287
|
+
// Use the exact values at the center to prevent the accumulation of the errors.
|
|
48288
|
+
if (k === n) {
|
|
48289
|
+
s = 0;
|
|
48290
|
+
c = 1;
|
|
48291
|
+
}
|
|
48292
|
+
px[k] = w * s;
|
|
48293
|
+
py[k] = -h * c;
|
|
48294
|
+
// Rotate by da
|
|
48295
|
+
var ns = s * cda + c * sda;
|
|
48296
|
+
c = c * cda - s * sda;
|
|
48297
|
+
s = ns;
|
|
48298
|
+
}
|
|
48299
|
+
for (var k = 0; k < n; ++k) {
|
|
48300
|
+
px[m - 1 - k] = -px[k];
|
|
48301
|
+
py[m - 1 - k] = py[k];
|
|
48302
|
+
}
|
|
48303
|
+
};
|
|
48304
|
+
/**
|
|
48305
|
+
* Computes the unit inward normals of the arc, the speeds of the arc, and the arc lengths at P[k].
|
|
48306
|
+
*
|
|
48307
|
+
* The normal at P is Np = (-h x / w, -w y / h), whose magnitude is the speed of the arc.
|
|
48308
|
+
* The speed is used to approximate the arc length without extra square roots.
|
|
48309
|
+
*/
|
|
48310
|
+
EShapeFanTriangulatedImpl.prototype.computeArcNormals = function (w, h, n, ea) {
|
|
48311
|
+
var m = 2 * n + 1;
|
|
48312
|
+
var px = EShapeFanTriangulatedImpl.WORK_ARC_X;
|
|
48313
|
+
var py = EShapeFanTriangulatedImpl.WORK_ARC_Y;
|
|
48314
|
+
var nx = EShapeFanTriangulatedImpl.WORK_NORMAL_X;
|
|
48315
|
+
var ny = EShapeFanTriangulatedImpl.WORK_NORMAL_Y;
|
|
48316
|
+
var speeds = EShapeFanTriangulatedImpl.WORK_SPEED;
|
|
48317
|
+
var ls = EShapeFanTriangulatedImpl.WORK_ARC_L;
|
|
48318
|
+
var da = ea / n;
|
|
48319
|
+
var hw = h / w;
|
|
48320
|
+
var wh = w / h;
|
|
48321
|
+
var l = 0;
|
|
48322
|
+
var previous = 0;
|
|
48323
|
+
for (var k = 0; k <= n; ++k) {
|
|
48324
|
+
var dx = -hw * px[k];
|
|
48325
|
+
var dy = -wh * py[k];
|
|
48326
|
+
var speed = Math.sqrt(dx * dx + dy * dy);
|
|
48327
|
+
nx[k] = dx / speed;
|
|
48328
|
+
ny[k] = dy / speed;
|
|
48329
|
+
speeds[k] = speed;
|
|
48330
|
+
if (0 < k) {
|
|
48331
|
+
l += 0.5 * da * (previous + speed);
|
|
48332
|
+
}
|
|
48333
|
+
previous = speed;
|
|
48334
|
+
ls[k] = l;
|
|
48335
|
+
}
|
|
48336
|
+
for (var k = 0; k < n; ++k) {
|
|
48337
|
+
var j = m - 1 - k;
|
|
48338
|
+
nx[j] = -nx[k];
|
|
48339
|
+
ny[j] = ny[k];
|
|
48340
|
+
speeds[j] = speeds[k];
|
|
48341
|
+
ls[j] = 2 * ls[n] - ls[k];
|
|
48342
|
+
}
|
|
48343
|
+
};
|
|
48344
|
+
/**
|
|
48345
|
+
* Computes Q[k], the points on the normals, and their distances from P[k], and returns the maximum distance.
|
|
48346
|
+
*
|
|
48347
|
+
* If chained is true, Q is the point on the medial axis, that is, the point on the normal
|
|
48348
|
+
* whose distance to the arc is equal to the distance to the straight sides.
|
|
48349
|
+
* The distance delta is obtained from delta = -(n . P) - delta (n . normal) for the outward unit normals n of the sides.
|
|
48350
|
+
* The clamps keep Q on the same side of the axis x = 0 as P and before the center of curvature,
|
|
48351
|
+
* otherwise adjacent normals cross each other, which happens for tall ellipses.
|
|
48352
|
+
*
|
|
48353
|
+
* Otherwise, the normal is extended until it reaches x = 0 if w <= h, otherwise y = 0.
|
|
48354
|
+
*/
|
|
48355
|
+
EShapeFanTriangulatedImpl.prototype.computeMedialPoints = function (w, h, n, st, ct, chained) {
|
|
48356
|
+
var m = 2 * n + 1;
|
|
48357
|
+
var px = EShapeFanTriangulatedImpl.WORK_ARC_X;
|
|
48358
|
+
var py = EShapeFanTriangulatedImpl.WORK_ARC_Y;
|
|
48359
|
+
var nx = EShapeFanTriangulatedImpl.WORK_NORMAL_X;
|
|
48360
|
+
var ny = EShapeFanTriangulatedImpl.WORK_NORMAL_Y;
|
|
48361
|
+
var speeds = EShapeFanTriangulatedImpl.WORK_SPEED;
|
|
48362
|
+
var qx = EShapeFanTriangulatedImpl.WORK_MEDIAL_X;
|
|
48363
|
+
var qy = EShapeFanTriangulatedImpl.WORK_MEDIAL_Y;
|
|
48364
|
+
var qd = EShapeFanTriangulatedImpl.WORK_MEDIAL_D;
|
|
48365
|
+
var u = w <= h ? w / h : h / w;
|
|
48366
|
+
var dmax = 0;
|
|
48367
|
+
for (var k = 0; k <= n; ++k) {
|
|
48368
|
+
var x = px[k];
|
|
48369
|
+
var y = py[k];
|
|
48370
|
+
var nnx = nx[k];
|
|
48371
|
+
var nny = ny[k];
|
|
48372
|
+
var speed = speeds[k];
|
|
48373
|
+
var delta = Infinity;
|
|
48374
|
+
if (chained) {
|
|
48375
|
+
var da = 1 + -ct * nnx + st * nny;
|
|
48376
|
+
if (1e-9 < da) {
|
|
48377
|
+
delta = Math.min(delta, (ct * x - st * y) / da);
|
|
48378
|
+
}
|
|
48379
|
+
var db = 1 + ct * nnx + st * nny;
|
|
48380
|
+
if (1e-9 < db) {
|
|
48381
|
+
delta = Math.min(delta, (-ct * x - st * y) / db);
|
|
48382
|
+
}
|
|
48383
|
+
if (k !== n && 1e-12 < Math.abs(nnx)) {
|
|
48384
|
+
delta = Math.min(delta, -x / nnx);
|
|
48385
|
+
}
|
|
48386
|
+
delta = Math.max(0, Math.min(delta, (speed * speed * speed) / (w * h)));
|
|
48387
|
+
}
|
|
48388
|
+
// The distance between P and Q
|
|
48389
|
+
var d = void 0;
|
|
48390
|
+
if (Number.isFinite(delta)) {
|
|
48391
|
+
d = delta;
|
|
48392
|
+
}
|
|
48393
|
+
else {
|
|
48394
|
+
d = u * speed;
|
|
48395
|
+
}
|
|
48396
|
+
qx[k] = x + d * nnx;
|
|
48397
|
+
qy[k] = y + d * nny;
|
|
48398
|
+
qd[k] = d;
|
|
48399
|
+
dmax = Math.max(dmax, d);
|
|
48400
|
+
}
|
|
48401
|
+
for (var k = 0; k < n; ++k) {
|
|
48402
|
+
var j = m - 1 - k;
|
|
48403
|
+
qx[j] = -qx[k];
|
|
48404
|
+
qy[j] = qy[k];
|
|
48405
|
+
qd[j] = qd[k];
|
|
48406
|
+
}
|
|
48407
|
+
return dmax;
|
|
48408
|
+
};
|
|
48409
|
+
/**
|
|
48410
|
+
* Computes R[k], the points on the arc shifted outward by fs, and their lengths.
|
|
48411
|
+
* If the straight sides are the outline, the end points are shifted
|
|
48412
|
+
* to the intersections of the shifted arc and the shifted straight sides.
|
|
48413
|
+
*/
|
|
48414
|
+
EShapeFanTriangulatedImpl.prototype.computeRimPoints = function (w, h, n, fs, st, ct, sea, cea, sided) {
|
|
48415
|
+
var m = 2 * n + 1;
|
|
48416
|
+
var px = EShapeFanTriangulatedImpl.WORK_ARC_X;
|
|
48417
|
+
var py = EShapeFanTriangulatedImpl.WORK_ARC_Y;
|
|
48418
|
+
var nx = EShapeFanTriangulatedImpl.WORK_NORMAL_X;
|
|
48419
|
+
var ny = EShapeFanTriangulatedImpl.WORK_NORMAL_Y;
|
|
48420
|
+
var ls = EShapeFanTriangulatedImpl.WORK_ARC_L;
|
|
48421
|
+
var rx = EShapeFanTriangulatedImpl.WORK_RIM_X;
|
|
48422
|
+
var ry = EShapeFanTriangulatedImpl.WORK_RIM_Y;
|
|
48423
|
+
var rl = EShapeFanTriangulatedImpl.WORK_RIM_L;
|
|
48424
|
+
for (var k = 0; k < m; ++k) {
|
|
48425
|
+
var x = px[k] - fs * nx[k];
|
|
48426
|
+
var y = py[k] - fs * ny[k];
|
|
48427
|
+
var l = ls[k];
|
|
48428
|
+
if (sided && (k === 0 || k === m - 1)) {
|
|
48429
|
+
var sign = k === 0 ? -1 : +1;
|
|
48430
|
+
// The miter of the outward normal of the arc (n1) and that of the straight side (n2)
|
|
48431
|
+
var n1x = -nx[k];
|
|
48432
|
+
var n1y = -ny[k];
|
|
48433
|
+
var n2x = sign * ct;
|
|
48434
|
+
var n2y = st;
|
|
48435
|
+
var miter = fs / Math.max(1 + n1x * n2x + n1y * n2y, 0.05);
|
|
48436
|
+
x = px[k] + miter * (n1x + n2x);
|
|
48437
|
+
y = py[k] + miter * (n1y + n2y);
|
|
48438
|
+
// The length is shifted along the tangent (tx, ty) / speed
|
|
48439
|
+
var tx = w * cea;
|
|
48440
|
+
var ty = sign * h * sea;
|
|
48441
|
+
l +=
|
|
48442
|
+
((x - px[k]) * tx + (y - py[k]) * ty) / EShapeFanTriangulatedImpl.WORK_SPEED[0];
|
|
48443
|
+
}
|
|
48444
|
+
rx[k] = x;
|
|
48445
|
+
ry[k] = y;
|
|
48446
|
+
rl[k] = l;
|
|
48447
|
+
}
|
|
48448
|
+
};
|
|
48449
|
+
/**
|
|
48450
|
+
* Writes the strip P[k], P[k + 1], Q[k + 1], Q[k] with the vertices R[k] and Q[k].
|
|
48451
|
+
*/
|
|
48452
|
+
EShapeFanTriangulatedImpl.prototype.writeStrip = function (m, fd, fx, fy, gx, gy) {
|
|
48453
|
+
var qx = EShapeFanTriangulatedImpl.WORK_MEDIAL_X;
|
|
48454
|
+
var qy = EShapeFanTriangulatedImpl.WORK_MEDIAL_Y;
|
|
48455
|
+
var qd = EShapeFanTriangulatedImpl.WORK_MEDIAL_D;
|
|
48456
|
+
var ls = EShapeFanTriangulatedImpl.WORK_ARC_L;
|
|
48457
|
+
var rx = EShapeFanTriangulatedImpl.WORK_RIM_X;
|
|
48458
|
+
var ry = EShapeFanTriangulatedImpl.WORK_RIM_Y;
|
|
48459
|
+
var rl = EShapeFanTriangulatedImpl.WORK_RIM_L;
|
|
48460
|
+
var scale = EShapeFanTriangulatedImpl.SCALE;
|
|
48461
|
+
var indices = this._indices;
|
|
48462
|
+
var iv = 0;
|
|
48463
|
+
var ii = 0;
|
|
48464
|
+
for (var k = 0; k < m; ++k) {
|
|
48465
|
+
this.writeVertex(iv++, rx[k], ry[k], rl[k], scale, fd, fx, fy, gx, gy);
|
|
48466
|
+
this.writeVertex(iv++, qx[k], qy[k], ls[k], 1 - qd[k] * fd, fd, fx, fy, gx, gy);
|
|
48467
|
+
if (k < m - 1) {
|
|
48468
|
+
var a = 2 * k;
|
|
48469
|
+
indices[ii++] = a;
|
|
48470
|
+
indices[ii++] = a + 2;
|
|
48471
|
+
indices[ii++] = a + 3;
|
|
48472
|
+
indices[ii++] = a;
|
|
48473
|
+
indices[ii++] = a + 3;
|
|
48474
|
+
indices[ii++] = a + 1;
|
|
48475
|
+
}
|
|
48476
|
+
}
|
|
48477
|
+
};
|
|
48478
|
+
/**
|
|
48479
|
+
* Writes the polygon O', R[end], Q[end], ..., Q[N] where the end is 0 for the left (sign = -1)
|
|
48480
|
+
* and 2N for the right (sign = +1). The straight side OA (or OB) is the outline of the polygon.
|
|
48481
|
+
* Returns the number of the written vertices.
|
|
48482
|
+
*
|
|
48483
|
+
* The chain of Q ends at the first point on the axis because the following points go back along the axis.
|
|
48484
|
+
* Q is not always on the medial axis where it is clamped,
|
|
48485
|
+
* so the clipping must not be less than the one of the arc.
|
|
48486
|
+
*
|
|
48487
|
+
* The clipping and the length are computed from the straight side:
|
|
48488
|
+
* the outward unit normal is (sign * ct, st) and the length is oa + arc + (-st, sign * ct) . p.
|
|
48489
|
+
*/
|
|
48490
|
+
EShapeFanTriangulatedImpl.prototype.writeSidePolygon = function (iv, ii, sign, n, w, oa, st, ct, fs, fd, fx, fy, gx, gy) {
|
|
48491
|
+
var m = 2 * n + 1;
|
|
48492
|
+
var qx = EShapeFanTriangulatedImpl.WORK_MEDIAL_X;
|
|
48493
|
+
var qy = EShapeFanTriangulatedImpl.WORK_MEDIAL_Y;
|
|
48494
|
+
var qd = EShapeFanTriangulatedImpl.WORK_MEDIAL_D;
|
|
48495
|
+
var rx = EShapeFanTriangulatedImpl.WORK_RIM_X;
|
|
48496
|
+
var ry = EShapeFanTriangulatedImpl.WORK_RIM_Y;
|
|
48497
|
+
var l0 = oa + EShapeFanTriangulatedImpl.WORK_ARC_L[m - 1];
|
|
48498
|
+
var nx = sign * ct;
|
|
48499
|
+
var ly = sign * ct;
|
|
48500
|
+
var eps = 1e-9 * w;
|
|
48501
|
+
var end = sign < 0 ? 0 : m - 1;
|
|
48502
|
+
var count = 0;
|
|
48503
|
+
this.writeSideVertex(iv + count++, 0, fs / st, -Infinity, nx, st, l0, -st, ly, fd, fx, fy, gx, gy);
|
|
48504
|
+
this.writeSideVertex(iv + count++, rx[end], ry[end], -Infinity, nx, st, l0, -st, ly, fd, fx, fy, gx, gy);
|
|
48505
|
+
for (var j = 0; j <= n; ++j) {
|
|
48506
|
+
var k = sign < 0 ? j : m - 1 - j;
|
|
48507
|
+
var floor = 1 - qd[k] * fd;
|
|
48508
|
+
this.writeSideVertex(iv + count++, qx[k], qy[k], floor, nx, st, l0, -st, ly, fd, fx, fy, gx, gy);
|
|
48509
|
+
if (Math.abs(qx[k]) <= eps) {
|
|
48510
|
+
break;
|
|
48511
|
+
}
|
|
48512
|
+
}
|
|
48513
|
+
this.writeFan(ii, iv, count);
|
|
48514
|
+
return count;
|
|
48515
|
+
};
|
|
48516
|
+
/**
|
|
48517
|
+
* Writes the polygon O, Q[end], ..., Q[N] where the end is 0 for the left (sign = -1)
|
|
48518
|
+
* and 2N for the right (sign = +1). The straight sides are hard edges without the stroke.
|
|
48519
|
+
* Returns the number of the written vertices.
|
|
48520
|
+
*
|
|
48521
|
+
* The clipping of O is given by co, and the length of O is the one of the end point.
|
|
48522
|
+
*/
|
|
48523
|
+
EShapeFanTriangulatedImpl.prototype.writeCapPolygon = function (iv, ii, sign, n, w, co, fd, fx, fy, gx, gy) {
|
|
48524
|
+
var m = 2 * n + 1;
|
|
48525
|
+
var qx = EShapeFanTriangulatedImpl.WORK_MEDIAL_X;
|
|
48526
|
+
var qy = EShapeFanTriangulatedImpl.WORK_MEDIAL_Y;
|
|
48527
|
+
var qd = EShapeFanTriangulatedImpl.WORK_MEDIAL_D;
|
|
48528
|
+
var ls = EShapeFanTriangulatedImpl.WORK_ARC_L;
|
|
48529
|
+
var eps = 1e-9 * w;
|
|
48530
|
+
var end = sign < 0 ? 0 : m - 1;
|
|
48531
|
+
this.writeVertex(iv, 0, 0, ls[end], co, fd, fx, fy, gx, gy);
|
|
48532
|
+
var count = 1;
|
|
48533
|
+
for (var j = 0; j <= n; ++j) {
|
|
48534
|
+
var k = sign < 0 ? j : m - 1 - j;
|
|
48535
|
+
var clipping = 1 - qd[k] * fd;
|
|
48536
|
+
this.writeVertex(iv + count++, qx[k], qy[k], ls[k], clipping, fd, fx, fy, gx, gy);
|
|
48537
|
+
if (Math.abs(qx[k]) <= eps) {
|
|
48538
|
+
break;
|
|
48539
|
+
}
|
|
48540
|
+
}
|
|
48541
|
+
this.writeFan(ii, iv, count);
|
|
48542
|
+
return count;
|
|
48543
|
+
};
|
|
48544
|
+
/**
|
|
48545
|
+
* The clipping is 1 - (the distance from the straight side) / d where d is the distance from C to OA (or OB).
|
|
48546
|
+
*/
|
|
48547
|
+
EShapeFanTriangulatedImpl.prototype.updateBottom = function (w, h, n, ea, sea, cea, bx, by, st, ct, fx, fy, gx, gy, nv, ni) {
|
|
48548
|
+
var boundary = this._boundary;
|
|
48549
|
+
boundary[0] = -bx;
|
|
48550
|
+
boundary[1] = -h;
|
|
48551
|
+
boundary[2] = +bx;
|
|
48552
|
+
boundary[3] = 0;
|
|
48553
|
+
var yc = h / (1 + st);
|
|
48554
|
+
var fd = (1 + st) / (h * st);
|
|
48555
|
+
var fs = (EShapeFanTriangulatedImpl.SCALE - 1) / fd;
|
|
48556
|
+
this.computeArcPoints(w, h, n, ea, sea, cea);
|
|
48557
|
+
// Triangle fans from C to the arc: left (sign = -1) and right (sign = +1)
|
|
48558
|
+
var iv = 0;
|
|
48559
|
+
var ii = 0;
|
|
48560
|
+
for (var sign = -1; sign <= 1; sign += 2) {
|
|
48561
|
+
var count = this.writeBottomFan(iv, ii, sign, n, yc, st, ct, fd, fx, fy, gx, gy);
|
|
48562
|
+
iv += count;
|
|
48563
|
+
ii += 3 * (count - 2);
|
|
48564
|
+
}
|
|
48565
|
+
// Quads at the bottom: O', A', A, C and O', B', B, C
|
|
48566
|
+
for (var sign = -1; sign <= 1; sign += 2) {
|
|
48567
|
+
var count = this.writeBottomQuad(iv, ii, sign, bx, by, yc, fs, st, ct, fd, fx, fy, gx, gy);
|
|
48568
|
+
iv += count;
|
|
48569
|
+
ii += 3 * (count - 2);
|
|
48570
|
+
}
|
|
48571
|
+
this.pad(iv, ii, nv, ni, fd);
|
|
48572
|
+
};
|
|
48573
|
+
/**
|
|
48574
|
+
* Writes the triangle fan from C to the arc of the left half (sign = -1) or the right half (sign = +1).
|
|
48575
|
+
* Returns the number of the written vertices.
|
|
48576
|
+
*
|
|
48577
|
+
* The clipping is 1 + fd * (n . p) where n is the outward unit normal of the straight side,
|
|
48578
|
+
* and the length is the distance along the straight side measured from O.
|
|
48579
|
+
* The side OA has n = (-ct, st) and l = (-st, -ct), and the side OB has n = (ct, st) and l = (st, -ct).
|
|
48580
|
+
*/
|
|
48581
|
+
EShapeFanTriangulatedImpl.prototype.writeBottomFan = function (iv, ii, sign, n, yc, st, ct, fd, fx, fy, gx, gy) {
|
|
48582
|
+
var px = EShapeFanTriangulatedImpl.WORK_ARC_X;
|
|
48583
|
+
var py = EShapeFanTriangulatedImpl.WORK_ARC_Y;
|
|
48584
|
+
var nx = sign * ct;
|
|
48585
|
+
var lx = sign * st;
|
|
48586
|
+
var count = 0;
|
|
48587
|
+
this.writeSideVertex(iv + count++, 0, -yc, 0, nx, st, 0, lx, -ct, fd, fx, fy, gx, gy);
|
|
48588
|
+
for (var j = 0; j <= n; ++j) {
|
|
48589
|
+
var k = sign < 0 ? j : n + j;
|
|
48590
|
+
this.writeSideVertex(iv + count++, px[k], py[k], 0, nx, st, 0, lx, -ct, fd, fx, fy, gx, gy);
|
|
48591
|
+
}
|
|
48592
|
+
this.writeFan(ii, iv, count);
|
|
48593
|
+
return count;
|
|
48594
|
+
};
|
|
48595
|
+
/**
|
|
48596
|
+
* Writes the quad O', A', A, C (sign = -1) or O', B', B, C (sign = +1) at the bottom.
|
|
48597
|
+
* O' is shifted outward by fs / st, and A' (B') is shifted outward by fs perpendicular to the straight side.
|
|
48598
|
+
* Returns the number of the written vertices.
|
|
48599
|
+
*/
|
|
48600
|
+
EShapeFanTriangulatedImpl.prototype.writeBottomQuad = function (iv, ii, sign, bx, by, yc, fs, st, ct, fd, fx, fy, gx, gy) {
|
|
48601
|
+
var nx = sign * ct;
|
|
48602
|
+
var lx = sign * st;
|
|
48603
|
+
this.writeSideVertex(iv, 0, fs / st, 0, nx, st, 0, lx, -ct, fd, fx, fy, gx, gy);
|
|
48604
|
+
this.writeSideVertex(iv + 1, sign * (bx + fs * ct), -by + fs * st, 0, nx, st, 0, lx, -ct, fd, fx, fy, gx, gy);
|
|
48605
|
+
this.writeSideVertex(iv + 2, sign * bx, -by, 0, nx, st, 0, lx, -ct, fd, fx, fy, gx, gy);
|
|
48606
|
+
this.writeSideVertex(iv + 3, 0, -yc, 0, nx, st, 0, lx, -ct, fd, fx, fy, gx, gy);
|
|
48607
|
+
this.writeFan(ii, iv, 4);
|
|
48608
|
+
return 4;
|
|
48609
|
+
};
|
|
48610
|
+
// ----------------------------------------------------------------------------------------
|
|
48611
|
+
// Writers
|
|
48612
|
+
// ----------------------------------------------------------------------------------------
|
|
48613
|
+
/**
|
|
48614
|
+
* Writes a vertex whose clipping and length are computed from the parameters of a straight side.
|
|
48615
|
+
* The clipping is 1 + fd * (nx * x + ny * y), which is not less than the given floor,
|
|
48616
|
+
* and the length is l0 + lx * x + ly * y.
|
|
48617
|
+
*/
|
|
48618
|
+
EShapeFanTriangulatedImpl.prototype.writeSideVertex = function (vertex, x, y, floor, nx, ny, l0, lx, ly, fd, fx, fy, gx, gy) {
|
|
48619
|
+
var clipping = Math.max(floor, 1 + fd * (nx * x + ny * y));
|
|
48620
|
+
var length = l0 + lx * x + ly * y;
|
|
48621
|
+
this.writeVertex(vertex, x, y, length, clipping, fd, fx, fy, gx, gy);
|
|
48622
|
+
};
|
|
48623
|
+
/**
|
|
48624
|
+
* Writes the indices of a triangle fan from the first vertex.
|
|
48625
|
+
* The number of the written indices is 3 * (count - 2).
|
|
48626
|
+
*/
|
|
48627
|
+
EShapeFanTriangulatedImpl.prototype.writeFan = function (ii, iv, count) {
|
|
48628
|
+
var indices = this._indices;
|
|
48629
|
+
for (var i = 1; i < count - 1; ++i) {
|
|
48630
|
+
indices[ii++] = iv;
|
|
48631
|
+
indices[ii++] = iv + i;
|
|
48632
|
+
indices[ii++] = iv + i + 1;
|
|
48633
|
+
}
|
|
48634
|
+
};
|
|
48635
|
+
/**
|
|
48636
|
+
* Writes a vertex.
|
|
48637
|
+
*
|
|
48638
|
+
* @param x - The X coordinate in the frame where the sizes are positive
|
|
48639
|
+
* @param y - The Y coordinate in the frame where the sizes are positive
|
|
48640
|
+
* @param fd - The inverse of the distance where the clipping decreases from 1 to 0
|
|
48641
|
+
* @param fx - The factor to convert x to the UV
|
|
48642
|
+
* @param fy - The factor to convert y to the UV
|
|
48643
|
+
* @param gx - The sign of the X size, which flips the vertex
|
|
48644
|
+
* @param gy - The sign of the Y size, which flips the vertex
|
|
48645
|
+
*/
|
|
48646
|
+
EShapeFanTriangulatedImpl.prototype.writeVertex = function (vertex, x, y, length, clipping, fd, fx, fy, gx, gy) {
|
|
48647
|
+
var vertex2 = vertex << 1;
|
|
48648
|
+
this._vertices[vertex2] = gx * x;
|
|
48649
|
+
this._vertices[vertex2 + 1] = gy * y;
|
|
48650
|
+
this._distances[vertex] = fd;
|
|
48651
|
+
this._lengths[vertex] = length;
|
|
48652
|
+
this._clippings[vertex] = clipping;
|
|
48653
|
+
this._uvs[vertex2] = 0.5 * (x * fx + 1);
|
|
48654
|
+
this._uvs[vertex2 + 1] = 1 + y * fy;
|
|
48655
|
+
};
|
|
48656
|
+
/**
|
|
48657
|
+
* Fills the unused tail with degenerated triangles and trims the arrays
|
|
48658
|
+
* so that the buffers always hold exactly `nv` vertices and `ni` triangles.
|
|
48659
|
+
*/
|
|
48660
|
+
EShapeFanTriangulatedImpl.prototype.pad = function (iv, ii, nv, ni, distance) {
|
|
48661
|
+
for (var i = iv; i < nv; ++i) {
|
|
48662
|
+
var vertex2 = i << 1;
|
|
48663
|
+
this._vertices[vertex2] = 0;
|
|
48664
|
+
this._vertices[vertex2 + 1] = 0;
|
|
48665
|
+
this._distances[i] = distance;
|
|
48666
|
+
this._lengths[i] = 0;
|
|
48667
|
+
this._clippings[i] = 0;
|
|
48668
|
+
this._uvs[vertex2] = 0.5;
|
|
48669
|
+
this._uvs[vertex2 + 1] = 0.5;
|
|
48670
|
+
}
|
|
48671
|
+
for (var i = ii; i < ni * 3; ++i) {
|
|
48672
|
+
this._indices[i] = 0;
|
|
48673
|
+
}
|
|
48674
|
+
this._vertices.length = nv * 2;
|
|
48675
|
+
this._distances.length = nv;
|
|
48676
|
+
this._lengths.length = nv;
|
|
48677
|
+
this._clippings.length = nv;
|
|
48678
|
+
this._uvs.length = nv * 2;
|
|
48679
|
+
this._indices.length = ni * 3;
|
|
48680
|
+
};
|
|
48681
|
+
/** The ratio of the outer edge, where the clipping is 1, to the edge of the anti-aliasing */
|
|
48682
|
+
EShapeFanTriangulatedImpl.SCALE = 1.1;
|
|
48683
|
+
// Work arrays shared by all the instances because they are used only in a single synchronous triangulation.
|
|
48684
|
+
// All of them are indexed by k, which is in [0, 2N].
|
|
48685
|
+
/** P: the points on the arc */
|
|
48686
|
+
EShapeFanTriangulatedImpl.WORK_ARC_X = [];
|
|
48687
|
+
EShapeFanTriangulatedImpl.WORK_ARC_Y = [];
|
|
48688
|
+
/** The arc lengths measured from P[0] */
|
|
48689
|
+
EShapeFanTriangulatedImpl.WORK_ARC_L = [];
|
|
48690
|
+
/** The unit inward normals of the arc */
|
|
48691
|
+
EShapeFanTriangulatedImpl.WORK_NORMAL_X = [];
|
|
48692
|
+
EShapeFanTriangulatedImpl.WORK_NORMAL_Y = [];
|
|
48693
|
+
/** The magnitudes of the tangents, that is, the speeds of the arc */
|
|
48694
|
+
EShapeFanTriangulatedImpl.WORK_SPEED = [];
|
|
48695
|
+
/** Q: the points on the normals */
|
|
48696
|
+
EShapeFanTriangulatedImpl.WORK_MEDIAL_X = [];
|
|
48697
|
+
EShapeFanTriangulatedImpl.WORK_MEDIAL_Y = [];
|
|
48698
|
+
/** The distances from P to Q */
|
|
48699
|
+
EShapeFanTriangulatedImpl.WORK_MEDIAL_D = [];
|
|
48700
|
+
/** R: the points on the arc shifted outward, and their lengths */
|
|
48701
|
+
EShapeFanTriangulatedImpl.WORK_RIM_X = [];
|
|
48702
|
+
EShapeFanTriangulatedImpl.WORK_RIM_Y = [];
|
|
48703
|
+
EShapeFanTriangulatedImpl.WORK_RIM_L = [];
|
|
48704
|
+
return EShapeFanTriangulatedImpl;
|
|
48705
|
+
}());
|
|
48706
|
+
|
|
48707
|
+
/*
|
|
48708
|
+
* Copyright (C) 2019-2026 Toshiba Corporation
|
|
48709
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
48710
|
+
*/
|
|
48711
|
+
/**
|
|
48712
|
+
* Tests whether the point is in the fan shrunk by `sa` at the arc and by `ss` at the straight sides.
|
|
48713
|
+
*
|
|
48714
|
+
* @param st - The sine of the half central angle
|
|
48715
|
+
* @param ct - The cosine of the half central angle
|
|
48716
|
+
*/
|
|
48717
|
+
var isInFan = function (x, y, ax, ay, st, ct, sa, ss) {
|
|
48718
|
+
var wx = ax - sa;
|
|
48719
|
+
var wy = ay - sa;
|
|
48720
|
+
if (wx <= 0 || wy <= 0) {
|
|
48721
|
+
return false;
|
|
48722
|
+
}
|
|
48723
|
+
var ex = x * wy;
|
|
48724
|
+
var ey = y * wx;
|
|
48725
|
+
if (wx * wy * wx * wy < ex * ex + ey * ey) {
|
|
48726
|
+
return false;
|
|
48727
|
+
}
|
|
48728
|
+
var ay1 = st * y;
|
|
48729
|
+
return -ct * x + ay1 <= -ss && ct * x + ay1 <= -ss;
|
|
48730
|
+
};
|
|
48731
|
+
var hitTestFanFill = function (shape, x, y, bx, by) {
|
|
48732
|
+
var fill = shape.fill;
|
|
48733
|
+
if (fill.enable) {
|
|
48734
|
+
var percent = Math.max(0, Math.min(1, fill.percent));
|
|
48735
|
+
if (1 <= percent) {
|
|
48736
|
+
return true;
|
|
48737
|
+
}
|
|
48738
|
+
// The fill is relative to the bounding box [-bx, +bx] x [-by, 0] of the fan.
|
|
48739
|
+
switch (fill.direction) {
|
|
48740
|
+
case EShapeFillDirection.TOP:
|
|
48741
|
+
return y + by <= percent * by;
|
|
48742
|
+
case EShapeFillDirection.RIGHT:
|
|
48743
|
+
return (1 - percent) * (2 * bx) <= x + bx;
|
|
48744
|
+
case EShapeFillDirection.BOTTOM:
|
|
48745
|
+
return (1 - percent) * by <= y + by;
|
|
48746
|
+
case EShapeFillDirection.LEFT:
|
|
48747
|
+
return x + bx <= percent * (2 * bx);
|
|
48748
|
+
}
|
|
48749
|
+
}
|
|
48750
|
+
return false;
|
|
48751
|
+
};
|
|
48752
|
+
var hitTestFan = function (shape, x, y, ax, ay, sw, ss) {
|
|
48753
|
+
var ca = toFanAngleCentric(shape.angle);
|
|
48754
|
+
if (ca <= 0 || ax <= 0 || ay <= 0) {
|
|
48755
|
+
return false;
|
|
48756
|
+
}
|
|
48757
|
+
var ea = toFanAngleEccentric(ax, ay, ca);
|
|
48758
|
+
var bx = ax * Math.sin(ea);
|
|
48759
|
+
var st = Math.sin(ca);
|
|
48760
|
+
var ct = Math.cos(ca);
|
|
48761
|
+
var fill = shape.fill;
|
|
48762
|
+
var strokeSide = shape.stroke.side;
|
|
48763
|
+
var strokeSideTop = (strokeSide & EShapeStrokeSide.TOP) !== 0;
|
|
48764
|
+
var strokeSideBottom = (strokeSide & EShapeStrokeSide.BOTTOM) !== 0;
|
|
48765
|
+
var strokeWidth = strokeSideTop || strokeSideBottom ? sw : 0;
|
|
48766
|
+
if ((fill.enable || 0 < strokeWidth) && isInFan(x, y, ax, ay, st, ct, 0, 0)) {
|
|
48767
|
+
if (fill.enable && hitTestFanFill(shape, x, y, bx, ay)) {
|
|
48768
|
+
return true;
|
|
48769
|
+
}
|
|
48770
|
+
if (0 < strokeWidth) {
|
|
48771
|
+
var s = strokeWidth * ss;
|
|
48772
|
+
var arc = strokeSideTop ? s : 0;
|
|
48773
|
+
var sides = strokeSideBottom ? s : 0;
|
|
48774
|
+
if (!isInFan(x, y, ax, ay, st, ct, arc, sides)) {
|
|
48775
|
+
return true;
|
|
48776
|
+
}
|
|
48777
|
+
}
|
|
48778
|
+
}
|
|
48779
|
+
return false;
|
|
48780
|
+
};
|
|
48781
|
+
|
|
48782
|
+
/*
|
|
48783
|
+
* Copyright (C) 2019-2026 Toshiba Corporation
|
|
48784
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
48785
|
+
*/
|
|
48786
|
+
var EShapeFan = /** @class */ (function (_super) {
|
|
48787
|
+
__extends(EShapeFan, _super);
|
|
48788
|
+
function EShapeFan(type) {
|
|
48789
|
+
if (type === void 0) { type = EShapeType.FAN; }
|
|
48790
|
+
var _this = _super.call(this, type) || this;
|
|
48791
|
+
_this._angle = _this.newAngle();
|
|
48792
|
+
_this._triangulated = _this.newTriangulated();
|
|
48793
|
+
return _this;
|
|
48794
|
+
}
|
|
48795
|
+
EShapeFan.prototype.newAngle = function () {
|
|
48796
|
+
return EShapeDefaults.ANGLE;
|
|
48797
|
+
};
|
|
48798
|
+
EShapeFan.prototype.newTriangulated = function () {
|
|
48799
|
+
return new EShapeFanTriangulatedImpl(this);
|
|
48800
|
+
};
|
|
48801
|
+
Object.defineProperty(EShapeFan.prototype, "triangulated", {
|
|
48802
|
+
get: function () {
|
|
48803
|
+
return this._triangulated;
|
|
48804
|
+
},
|
|
48805
|
+
enumerable: false,
|
|
48806
|
+
configurable: true
|
|
48807
|
+
});
|
|
48808
|
+
Object.defineProperty(EShapeFan.prototype, "angle", {
|
|
48809
|
+
/**
|
|
48810
|
+
* The ratio of the half central angle of the fan to PI. Must be in [0, 0.5].
|
|
48811
|
+
* 0.5 results in a semicircle.
|
|
48812
|
+
*/
|
|
48813
|
+
get: function () {
|
|
48814
|
+
return this._angle;
|
|
48815
|
+
},
|
|
48816
|
+
set: function (angle) {
|
|
48817
|
+
if (this._angle !== angle) {
|
|
48818
|
+
this._angle = angle;
|
|
48819
|
+
this.updateUploaded();
|
|
48820
|
+
}
|
|
48821
|
+
},
|
|
48822
|
+
enumerable: false,
|
|
48823
|
+
configurable: true
|
|
48824
|
+
});
|
|
48825
|
+
EShapeFan.prototype.toHitTestStrokeShift = function (strokeWidth, strokeScale, strokeAlign) {
|
|
48826
|
+
if ((this.stroke.side & EShapeStrokeSide.TOP_OR_BOTTOM) !== 0) {
|
|
48827
|
+
return _super.prototype.toHitTestStrokeShift.call(this, strokeWidth, strokeScale, strokeAlign);
|
|
48828
|
+
}
|
|
48829
|
+
return 0;
|
|
48830
|
+
};
|
|
48831
|
+
EShapeFan.prototype.copy = function (source, part) {
|
|
48832
|
+
this.lock(EShapeLockPart.ALL);
|
|
48833
|
+
_super.prototype.copy.call(this, source, part);
|
|
48834
|
+
if ((part == null || part & EShapeCopyPart.STYLE) && source instanceof EShapeFan) {
|
|
48835
|
+
this._angle = source._angle;
|
|
48836
|
+
}
|
|
48837
|
+
this.unlock(EShapeLockPart.ALL, true);
|
|
48838
|
+
return this;
|
|
48839
|
+
};
|
|
48840
|
+
EShapeFan.prototype.clone = function () {
|
|
48841
|
+
return new EShapeFan(this.type).copy(this);
|
|
48842
|
+
};
|
|
48843
|
+
EShapeFan.prototype.containsAbs = function (x, y, ax, ay, sw, ss, sa) {
|
|
48844
|
+
if (_super.prototype.containsAbsBBox.call(this, x, y, ax, ay)) {
|
|
48845
|
+
return hitTestFan(this, x, y, ax, ay, sw, ss);
|
|
48846
|
+
}
|
|
48847
|
+
return false;
|
|
48848
|
+
};
|
|
48849
|
+
EShapeFan.prototype.serialize = function (manager) {
|
|
48850
|
+
var result = _super.prototype.serialize.call(this, manager);
|
|
48851
|
+
result[15] = this._angle;
|
|
48852
|
+
return result;
|
|
48853
|
+
};
|
|
48854
|
+
return EShapeFan;
|
|
48855
|
+
}(EShapePrimitive));
|
|
48856
|
+
|
|
48857
|
+
/*
|
|
48858
|
+
* Copyright (C) 2019-2026 Toshiba Corporation
|
|
48859
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
48860
|
+
*/
|
|
48861
|
+
var deserializeFan = function (item, manager, shape) {
|
|
48862
|
+
shape = shape || new EShapeFan();
|
|
48863
|
+
shape.angle = item[15];
|
|
48864
|
+
return deserializeBase(item, manager, shape);
|
|
48865
|
+
};
|
|
48866
|
+
|
|
48867
|
+
/*
|
|
48868
|
+
* Copyright (C) 2019-2026 Toshiba Corporation
|
|
48869
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
48870
|
+
*/
|
|
48871
|
+
var loadShapeFan = function () {
|
|
48872
|
+
EShapeUploadeds[EShapeType.FAN] = createPolygonUploaded;
|
|
48873
|
+
EShapeDeserializers[EShapeType.FAN] = deserializeFan;
|
|
48874
|
+
EShapeCapabilities.set(EShapeType.FAN, EShapeCapability.PRIMITIVE | EShapeCapability.STROKE_SIDE | EShapeCapability.ANGLE);
|
|
48875
|
+
};
|
|
48876
|
+
|
|
47991
48877
|
/*
|
|
47992
48878
|
* Copyright (C) 2019 Toshiba Corporation
|
|
47993
48879
|
* SPDX-License-Identifier: Apache-2.0
|
|
@@ -48624,7 +49510,7 @@
|
|
|
48624
49510
|
if (0 < children.length) {
|
|
48625
49511
|
return children[children.length - 1].radius;
|
|
48626
49512
|
}
|
|
48627
|
-
return
|
|
49513
|
+
return EShapeDefaults.RADIUS;
|
|
48628
49514
|
},
|
|
48629
49515
|
set: function (radius) {
|
|
48630
49516
|
var children = this.children;
|
|
@@ -48635,6 +49521,23 @@
|
|
|
48635
49521
|
enumerable: false,
|
|
48636
49522
|
configurable: true
|
|
48637
49523
|
});
|
|
49524
|
+
Object.defineProperty(EShapeGroup.prototype, "angle", {
|
|
49525
|
+
get: function () {
|
|
49526
|
+
var children = this.children;
|
|
49527
|
+
if (0 < children.length) {
|
|
49528
|
+
return children[children.length - 1].angle;
|
|
49529
|
+
}
|
|
49530
|
+
return EShapeDefaults.ANGLE;
|
|
49531
|
+
},
|
|
49532
|
+
set: function (angle) {
|
|
49533
|
+
var children = this.children;
|
|
49534
|
+
for (var i = 0, imax = children.length; i < imax; ++i) {
|
|
49535
|
+
children[i].angle = angle;
|
|
49536
|
+
}
|
|
49537
|
+
},
|
|
49538
|
+
enumerable: false,
|
|
49539
|
+
configurable: true
|
|
49540
|
+
});
|
|
48638
49541
|
Object.defineProperty(EShapeGroup.prototype, "image", {
|
|
48639
49542
|
get: function () {
|
|
48640
49543
|
var children = this.children;
|
|
@@ -50641,12 +51544,15 @@
|
|
|
50641
51544
|
EShapeDeserializers[EShapeType.LINE_OF_CIRCLES] = deserializeLineOfCircles;
|
|
50642
51545
|
};
|
|
50643
51546
|
|
|
51547
|
+
/*
|
|
51548
|
+
* Copyright (C) 2019 Toshiba Corporation
|
|
51549
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
51550
|
+
*/
|
|
50644
51551
|
var RECTANGLE_ROUNDED_LEGACY_VERTEX_COUNT = 44;
|
|
50645
51552
|
var RECTANGLE_ROUNDED_LEGACY_INDEX_COUNT = 24;
|
|
50646
51553
|
var RECTANGLE_ROUNDED_LEGACY_WORLD_SIZE = [
|
|
50647
51554
|
0, 0, 0, 0, 0
|
|
50648
51555
|
];
|
|
50649
|
-
var RECTANGLE_ROUNDED_LEGACY_WORK_POINT = new pixi_js.Point();
|
|
50650
51556
|
var buildRectangleRoundedLegacyIndex = function (indices, voffset, ioffset) {
|
|
50651
51557
|
// c0 c1 c4 c5
|
|
50652
51558
|
// |---| |---|
|
|
@@ -50760,22 +51666,21 @@
|
|
|
50760
51666
|
var sy = sizeY * 0.5 + (0 <= sizeY ? +s : -s);
|
|
50761
51667
|
var ax = Math.abs(sx);
|
|
50762
51668
|
var ay = Math.abs(sy);
|
|
50763
|
-
var
|
|
50764
|
-
var rx =
|
|
50765
|
-
var ry =
|
|
50766
|
-
var
|
|
50767
|
-
|
|
50768
|
-
internalTransform.
|
|
50769
|
-
var
|
|
50770
|
-
var
|
|
50771
|
-
|
|
50772
|
-
|
|
50773
|
-
var
|
|
50774
|
-
var
|
|
50775
|
-
|
|
50776
|
-
|
|
50777
|
-
var
|
|
50778
|
-
var b3y = work.y;
|
|
51669
|
+
var az = radius * Math.min(ax, ay);
|
|
51670
|
+
var rx = az / ax;
|
|
51671
|
+
var ry = az / ay;
|
|
51672
|
+
var a = internalTransform.a;
|
|
51673
|
+
var b = internalTransform.b;
|
|
51674
|
+
var c = internalTransform.c;
|
|
51675
|
+
var d = internalTransform.d;
|
|
51676
|
+
var tx = internalTransform.tx;
|
|
51677
|
+
var ty = internalTransform.ty;
|
|
51678
|
+
var b0x = a * (originX - sx) + c * (originY - sy) + tx;
|
|
51679
|
+
var b0y = b * (originX - sx) + d * (originY - sy) + ty;
|
|
51680
|
+
var b1x = a * originX + c * (originY - sy) + tx;
|
|
51681
|
+
var b1y = b * originX + d * (originY - sy) + ty;
|
|
51682
|
+
var b3x = a * (originX - sx) + c * originY + tx;
|
|
51683
|
+
var b3y = b * (originX - sx) + d * originY + ty;
|
|
50779
51684
|
var d01x = b1x - b0x;
|
|
50780
51685
|
var d01y = b1y - b0y;
|
|
50781
51686
|
var d03x = b3x - b0x;
|
|
@@ -51001,7 +51906,7 @@
|
|
|
51001
51906
|
// World size
|
|
51002
51907
|
worldSize[0] = ax;
|
|
51003
51908
|
worldSize[1] = ay;
|
|
51004
|
-
worldSize[2] =
|
|
51909
|
+
worldSize[2] = az;
|
|
51005
51910
|
worldSize[3] = rx;
|
|
51006
51911
|
worldSize[4] = ry;
|
|
51007
51912
|
};
|
|
@@ -52129,13 +53034,16 @@
|
|
|
52129
53034
|
EShapeCapabilities.set(EShapeType.LINE_OF_RECTANGLES, EShapeCapability.PRIMITIVE | EShapeCapability.STROKE_SIDE);
|
|
52130
53035
|
};
|
|
52131
53036
|
|
|
52132
|
-
|
|
52133
|
-
|
|
52134
|
-
|
|
53037
|
+
/*
|
|
53038
|
+
* Copyright (C) 2019 Toshiba Corporation
|
|
53039
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
53040
|
+
*/
|
|
53041
|
+
var TRIANGLE_ROUNDED_LEGACY_VERTEX_COUNT = 22;
|
|
53042
|
+
var TRIANGLE_ROUNDED_LEGACY_INDEX_COUNT = 15;
|
|
53043
|
+
var TRIANGLE_ROUNDED_LEGACY_WORLD_SIZE = [
|
|
52135
53044
|
0, 0, 0, 0, 0
|
|
52136
53045
|
];
|
|
52137
|
-
var
|
|
52138
|
-
var buildTriangleRoundedIndex = function (indices, voffset, ioffset) {
|
|
53046
|
+
var buildTriangleRoundedLegacyIndex = function (indices, voffset, ioffset) {
|
|
52139
53047
|
// Top corner
|
|
52140
53048
|
var ii = ioffset * 3 - 1;
|
|
52141
53049
|
indices[++ii] = voffset + 0;
|
|
@@ -52189,7 +53097,7 @@
|
|
|
52189
53097
|
indices[++ii] = voffset + 21;
|
|
52190
53098
|
indices[++ii] = voffset + 13;
|
|
52191
53099
|
};
|
|
52192
|
-
var
|
|
53100
|
+
var buildTriangleRoundedLegacyVertex = function (vertices, voffset, originX, originY, sizeX, sizeY, strokeAlign, strokeWidth, radius, internalTransform, worldSize) {
|
|
52193
53101
|
// Calculate the transformed positions
|
|
52194
53102
|
var s = strokeAlign * strokeWidth;
|
|
52195
53103
|
var sx = sizeX * 0.5 + (0 <= sizeX ? +s : -s);
|
|
@@ -52199,23 +53107,24 @@
|
|
|
52199
53107
|
var ry = (sw * radius) / (2 * sy);
|
|
52200
53108
|
var rz = (0.5 * (sz - sw) * radius) / sz;
|
|
52201
53109
|
var rx = (ry * sz) / (2 * sx);
|
|
52202
|
-
var
|
|
52203
|
-
|
|
52204
|
-
internalTransform.
|
|
52205
|
-
var
|
|
52206
|
-
var
|
|
52207
|
-
|
|
52208
|
-
|
|
52209
|
-
var
|
|
52210
|
-
var
|
|
52211
|
-
|
|
52212
|
-
|
|
52213
|
-
var
|
|
52214
|
-
var
|
|
52215
|
-
var
|
|
52216
|
-
var
|
|
52217
|
-
var
|
|
52218
|
-
var
|
|
53110
|
+
var a = internalTransform.a;
|
|
53111
|
+
var b = internalTransform.b;
|
|
53112
|
+
var c = internalTransform.c;
|
|
53113
|
+
var d = internalTransform.d;
|
|
53114
|
+
var tx = internalTransform.tx;
|
|
53115
|
+
var ty = internalTransform.ty;
|
|
53116
|
+
var x1 = a * originX + c * (originY - sy) + tx;
|
|
53117
|
+
var y1 = b * originX + d * (originY - sy) + ty;
|
|
53118
|
+
var ox = a * originX + c * originY + tx;
|
|
53119
|
+
var oy = b * originX + d * originY + ty;
|
|
53120
|
+
var dx = ox - x1;
|
|
53121
|
+
var dy = oy - y1;
|
|
53122
|
+
var wx = a * (originX + sx) + c * originY + tx;
|
|
53123
|
+
var wy = b * (originX + sx) + d * originY + ty;
|
|
53124
|
+
var x4 = wx + dx;
|
|
53125
|
+
var y4 = wy + dy;
|
|
53126
|
+
var x7 = ox + (ox - wx) + dx;
|
|
53127
|
+
var y7 = oy + (oy - wy) + dy;
|
|
52219
53128
|
var dx14 = x4 - x1;
|
|
52220
53129
|
var dy14 = y4 - y1;
|
|
52221
53130
|
var x2 = x1 + rz * dx14;
|
|
@@ -52234,10 +53143,8 @@
|
|
|
52234
53143
|
var y8 = y7 + ry * dy71;
|
|
52235
53144
|
var x9 = x1 - rz * dx71;
|
|
52236
53145
|
var y9 = y1 - rz * dy71;
|
|
52237
|
-
|
|
52238
|
-
|
|
52239
|
-
var x0 = work.x;
|
|
52240
|
-
var y0 = work.y;
|
|
53146
|
+
var x0 = a * originX + c * (originY + sy - sw) + tx;
|
|
53147
|
+
var y0 = b * originX + d * (originY + sy - sw) + ty;
|
|
52241
53148
|
var x10 = x1 + radius * (x0 - x1);
|
|
52242
53149
|
var y10 = y1 + radius * (y0 - y1);
|
|
52243
53150
|
var x11 = x4 + radius * (x0 - x4);
|
|
@@ -52245,8 +53152,8 @@
|
|
|
52245
53152
|
var x12 = x7 + radius * (x0 - x7);
|
|
52246
53153
|
var y12 = y7 + radius * (y0 - y7);
|
|
52247
53154
|
// World size
|
|
52248
|
-
var xb =
|
|
52249
|
-
var yb =
|
|
53155
|
+
var xb = ox + dx;
|
|
53156
|
+
var yb = oy + dy;
|
|
52250
53157
|
worldSize[0] = toLength(xb, yb, x0, y0);
|
|
52251
53158
|
worldSize[1] = rx;
|
|
52252
53159
|
worldSize[2] = ry;
|
|
@@ -52303,7 +53210,7 @@
|
|
|
52303
53210
|
vertices[++iv] = x9;
|
|
52304
53211
|
vertices[++iv] = y9;
|
|
52305
53212
|
};
|
|
52306
|
-
var
|
|
53213
|
+
var buildTriangleRoundedLegacyStep = function (steps, voffset, strokeWidth, strokeStyle, corner, radius, worldSize) {
|
|
52307
53214
|
var scaleInvariant = toScaleInvariant(strokeStyle);
|
|
52308
53215
|
var s = worldSize[0];
|
|
52309
53216
|
var sr = radius * s;
|
|
@@ -52574,7 +53481,7 @@
|
|
|
52574
53481
|
steps[++is] = c10;
|
|
52575
53482
|
steps[++is] = 0;
|
|
52576
53483
|
};
|
|
52577
|
-
var
|
|
53484
|
+
var buildTriangleRoundedLegacyUv = function (uvs, voffset, textureUvs, radius, worldSize) {
|
|
52578
53485
|
var x0 = textureUvs.x0;
|
|
52579
53486
|
var x1 = textureUvs.x1;
|
|
52580
53487
|
var x2 = textureUvs.x2;
|
|
@@ -52680,8 +53587,8 @@
|
|
|
52680
53587
|
var ioffset = this.indexOffset;
|
|
52681
53588
|
var pointCountReserved = this.pointCountReserved;
|
|
52682
53589
|
if (0 < pointCountReserved) {
|
|
52683
|
-
|
|
52684
|
-
copyIndex(buffer.indices,
|
|
53590
|
+
buildTriangleRoundedLegacyIndex(buffer.indices, voffset, ioffset);
|
|
53591
|
+
copyIndex(buffer.indices, TRIANGLE_ROUNDED_LEGACY_VERTEX_COUNT, ioffset, TRIANGLE_ROUNDED_LEGACY_INDEX_COUNT, pointCountReserved);
|
|
52685
53592
|
}
|
|
52686
53593
|
this.inited |= BuilderFlag.INDEX;
|
|
52687
53594
|
};
|
|
@@ -52690,7 +53597,7 @@
|
|
|
52690
53597
|
if (points instanceof EShapeLineOfAnyPointsImpl) {
|
|
52691
53598
|
var buffer = this.buffer;
|
|
52692
53599
|
this.updateVertexStepAndUv(buffer, shape, points);
|
|
52693
|
-
this.updateLineOfAnyColor(buffer, shape, points,
|
|
53600
|
+
this.updateLineOfAnyColor(buffer, shape, points, TRIANGLE_ROUNDED_LEGACY_VERTEX_COUNT);
|
|
52694
53601
|
}
|
|
52695
53602
|
};
|
|
52696
53603
|
BuilderLineOfTriangleRoundeds.prototype.updateVertexStepAndUv = function (buffer, shape, points) {
|
|
@@ -52768,17 +53675,17 @@
|
|
|
52768
53675
|
var pointSizeX = pointSize.getX(0);
|
|
52769
53676
|
var pointSizeY = pointSize.getY(0);
|
|
52770
53677
|
// Vertices
|
|
52771
|
-
|
|
52772
|
-
copyVertex(vertices, internalTransform, voffset,
|
|
53678
|
+
buildTriangleRoundedLegacyVertex(vertices, voffset, 0, 0, pointSizeX, pointSizeY, strokeAlign, strokeWidth, radius, internalTransform, TRIANGLE_ROUNDED_LEGACY_WORLD_SIZE);
|
|
53679
|
+
copyVertex(vertices, internalTransform, voffset, TRIANGLE_ROUNDED_LEGACY_VERTEX_COUNT, pointCount, pointsValues, pointOffset);
|
|
52773
53680
|
// Steps
|
|
52774
53681
|
if (isNotInited || isVertexChanged || isTransformChanged || isCornerChanged) {
|
|
52775
|
-
|
|
52776
|
-
copyStep(steps, voffset,
|
|
53682
|
+
buildTriangleRoundedLegacyStep(steps, voffset, strokeWidth, strokeStyle, corner, radius, TRIANGLE_ROUNDED_LEGACY_WORLD_SIZE);
|
|
53683
|
+
copyStep(steps, voffset, TRIANGLE_ROUNDED_LEGACY_VERTEX_COUNT, pointCount);
|
|
52777
53684
|
}
|
|
52778
53685
|
// UVs
|
|
52779
53686
|
if (isNotInited || isVertexChanged || isTextureChanged) {
|
|
52780
|
-
|
|
52781
|
-
copyUvs(uvs, voffset,
|
|
53687
|
+
buildTriangleRoundedLegacyUv(uvs, voffset, textureUvs, radius, TRIANGLE_ROUNDED_LEGACY_WORLD_SIZE);
|
|
53688
|
+
copyUvs(uvs, voffset, TRIANGLE_ROUNDED_LEGACY_VERTEX_COUNT, pointCount);
|
|
52782
53689
|
}
|
|
52783
53690
|
}
|
|
52784
53691
|
else {
|
|
@@ -52788,23 +53695,23 @@
|
|
|
52788
53695
|
var py = pointsValues[ip + 1] + pointOffset.getY(i);
|
|
52789
53696
|
var pointSizeX = pointSize.getX(i);
|
|
52790
53697
|
var pointSizeY = pointSize.getY(i);
|
|
52791
|
-
var iv = voffset + i *
|
|
53698
|
+
var iv = voffset + i * TRIANGLE_ROUNDED_LEGACY_VERTEX_COUNT;
|
|
52792
53699
|
// Vertices
|
|
52793
|
-
|
|
53700
|
+
buildTriangleRoundedLegacyVertex(vertices, iv, px, py, pointSizeX, pointSizeY, strokeAlign, strokeWidth, radius, internalTransform, TRIANGLE_ROUNDED_LEGACY_WORLD_SIZE);
|
|
52794
53701
|
// Steps
|
|
52795
53702
|
if (isNotInited || isVertexChanged || isTransformChanged || isCornerChanged) {
|
|
52796
|
-
|
|
53703
|
+
buildTriangleRoundedLegacyStep(steps, iv, strokeWidth, strokeStyle, corner, radius, TRIANGLE_ROUNDED_LEGACY_WORLD_SIZE);
|
|
52797
53704
|
}
|
|
52798
53705
|
// UVs
|
|
52799
53706
|
if (isNotInited || isVertexChanged || isTextureChanged) {
|
|
52800
|
-
|
|
53707
|
+
buildTriangleRoundedLegacyUv(uvs, iv, textureUvs, radius, TRIANGLE_ROUNDED_LEGACY_WORLD_SIZE);
|
|
52801
53708
|
}
|
|
52802
53709
|
}
|
|
52803
53710
|
}
|
|
52804
53711
|
// Fill the rest
|
|
52805
53712
|
var pointCountReserved = this.pointCountReserved;
|
|
52806
|
-
var voffsetReserved = voffset + pointCount *
|
|
52807
|
-
var vcountReserved =
|
|
53713
|
+
var voffsetReserved = voffset + pointCount * TRIANGLE_ROUNDED_LEGACY_VERTEX_COUNT;
|
|
53714
|
+
var vcountReserved = TRIANGLE_ROUNDED_LEGACY_VERTEX_COUNT * (pointCountReserved - pointCount);
|
|
52808
53715
|
buildNullVertex(vertices, voffsetReserved, vcountReserved);
|
|
52809
53716
|
buildNullStep(steps, voffsetReserved, vcountReserved);
|
|
52810
53717
|
buildNullUv(uvs, voffsetReserved, vcountReserved);
|
|
@@ -52818,16 +53725,15 @@
|
|
|
52818
53725
|
* SPDX-License-Identifier: Apache-2.0
|
|
52819
53726
|
*/
|
|
52820
53727
|
var createLineOfTriangleRoundedsUploaded = function (buffer, shape, voffset, ioffset, antialiasWeight) {
|
|
52821
|
-
return createLineOfAnyUploaded(buffer, shape, voffset,
|
|
53728
|
+
return createLineOfAnyUploaded(buffer, shape, voffset, TRIANGLE_ROUNDED_LEGACY_VERTEX_COUNT, ioffset, TRIANGLE_ROUNDED_LEGACY_INDEX_COUNT, antialiasWeight, BuilderLineOfTriangleRoundeds);
|
|
52822
53729
|
};
|
|
52823
53730
|
|
|
52824
53731
|
/*
|
|
52825
53732
|
* Copyright (C) 2019 Toshiba Corporation
|
|
52826
53733
|
* SPDX-License-Identifier: Apache-2.0
|
|
52827
53734
|
*/
|
|
52828
|
-
var containsCorner_ = function (
|
|
52829
|
-
|
|
52830
|
-
if (fill.enable) {
|
|
53735
|
+
var containsCorner_ = function (x, y, r, aw, sw, ss, filled) {
|
|
53736
|
+
if (filled) {
|
|
52831
53737
|
if (x * x + y * y <= r * r) {
|
|
52832
53738
|
return true;
|
|
52833
53739
|
}
|
|
@@ -52845,7 +53751,7 @@
|
|
|
52845
53751
|
}
|
|
52846
53752
|
return false;
|
|
52847
53753
|
};
|
|
52848
|
-
var containsCorner = function (
|
|
53754
|
+
var containsCorner = function (x, y, x0, y0, x1, y1, x2, y2, x3, y3, r12, r13, aw, radius, sw, ss, filled) {
|
|
52849
53755
|
var xl = x1 + r12 * (x2 - x1) - x0;
|
|
52850
53756
|
var yl = y1 + r12 * (y2 - y1) - y0;
|
|
52851
53757
|
var n = Math.sqrt(xl * xl + yl * yl);
|
|
@@ -52865,14 +53771,14 @@
|
|
|
52865
53771
|
var yc = y - y0;
|
|
52866
53772
|
var dx = (+nry * xc - nrx * yc) * deti;
|
|
52867
53773
|
var dy = (-nly * xc + nlx * yc) * deti;
|
|
52868
|
-
if (containsCorner_(
|
|
53774
|
+
if (containsCorner_(dx, dy, n, aw * radius, sw, ss, filled)) {
|
|
52869
53775
|
return true;
|
|
52870
53776
|
}
|
|
52871
53777
|
}
|
|
52872
53778
|
}
|
|
52873
53779
|
return false;
|
|
52874
53780
|
};
|
|
52875
|
-
var
|
|
53781
|
+
var hitTestTriangleRoundedImpl = function (shape, x, y, ax, ay, sw, ss, filled) {
|
|
52876
53782
|
var a = (2 * ay) / ax;
|
|
52877
53783
|
if (hitTestTriangleFilled(x, y, a, -ay, +ay)) {
|
|
52878
53784
|
var az = Math.sqrt(ax * ax + 4 * ay * ay);
|
|
@@ -52899,7 +53805,7 @@
|
|
|
52899
53805
|
if (!c0 && !c1 && corner & EShapeCorner.TOP) {
|
|
52900
53806
|
// Top corner
|
|
52901
53807
|
var rz = (0.5 * (az - aw) * radius) / az;
|
|
52902
|
-
if (containsCorner(
|
|
53808
|
+
if (containsCorner(x, y, x10, y10, x1, y1, x7, y7, x4, y4, rz, rz, aw, radius, sw, ss, filled)) {
|
|
52903
53809
|
return true;
|
|
52904
53810
|
}
|
|
52905
53811
|
}
|
|
@@ -52907,7 +53813,7 @@
|
|
|
52907
53813
|
// Bottom-left corner
|
|
52908
53814
|
var ry = (aw * radius) / (2 * ay);
|
|
52909
53815
|
var rx = (ry * az) / (2 * ax);
|
|
52910
|
-
if (containsCorner(
|
|
53816
|
+
if (containsCorner(x, y, x12, y12, x7, y7, x4, y4, x1, y1, rx, ry, aw, radius, sw, ss, filled)) {
|
|
52911
53817
|
return true;
|
|
52912
53818
|
}
|
|
52913
53819
|
}
|
|
@@ -52915,14 +53821,13 @@
|
|
|
52915
53821
|
// Bottom-right corner
|
|
52916
53822
|
var ry = (aw * radius) / (2 * ay);
|
|
52917
53823
|
var rx = (ry * az) / (2 * ax);
|
|
52918
|
-
if (containsCorner(
|
|
53824
|
+
if (containsCorner(x, y, x11, y11, x4, y4, x1, y1, x7, y7, ry, rx, aw, radius, sw, ss, filled)) {
|
|
52919
53825
|
return true;
|
|
52920
53826
|
}
|
|
52921
53827
|
}
|
|
52922
53828
|
else {
|
|
52923
53829
|
// Others
|
|
52924
|
-
|
|
52925
|
-
if (fill.enable) {
|
|
53830
|
+
if (filled) {
|
|
52926
53831
|
return true;
|
|
52927
53832
|
}
|
|
52928
53833
|
else {
|
|
@@ -52940,27 +53845,88 @@
|
|
|
52940
53845
|
}
|
|
52941
53846
|
return false;
|
|
52942
53847
|
};
|
|
53848
|
+
var hitTestTriangleRoundedLegacy = function (shape, x, y, ax, ay, sw, ss) {
|
|
53849
|
+
return hitTestTriangleRoundedImpl(shape, x, y, ax, ay, sw, ss, shape.fill.enable);
|
|
53850
|
+
};
|
|
53851
|
+
/**
|
|
53852
|
+
* Returns true if the point is in the cone with the apex (cx, cy) spanned by the unit normals n1 and n2
|
|
53853
|
+
* but outside the circle of radius `rho`, that is, in the part cut off by a rounded corner.
|
|
53854
|
+
*/
|
|
53855
|
+
var isCutByCorner = function (x, y, cx, cy, n1x, n1y, n2x, n2y, rho) {
|
|
53856
|
+
var dx = x - cx;
|
|
53857
|
+
var dy = y - cy;
|
|
53858
|
+
var det = n1x * n2y - n1y * n2x;
|
|
53859
|
+
var a = (dx * n2y - dy * n2x) / det;
|
|
53860
|
+
var b = (n1x * dy - n1y * dx) / det;
|
|
53861
|
+
return 0 <= a && 0 <= b && rho * rho < dx * dx + dy * dy;
|
|
53862
|
+
};
|
|
53863
|
+
/**
|
|
53864
|
+
* Tests whether the point is in the rounded triangle shrunk by `s`.
|
|
53865
|
+
* Sharp corners and corners whose radius is not larger than `s` stay sharp.
|
|
53866
|
+
*/
|
|
53867
|
+
var hitTestTriangleRoundedInset = function (shape, x, y, ax, ay, s) {
|
|
53868
|
+
var az = Math.sqrt(ax * ax + 4 * ay * ay);
|
|
53869
|
+
// The outward unit normals of the left side (nlx, nly) and the right side (-nlx, nly)
|
|
53870
|
+
var nlx = (-2 * ay) / az;
|
|
53871
|
+
var nly = -ax / az;
|
|
53872
|
+
var yt = y + ay;
|
|
53873
|
+
if (-s < nlx * x + nly * yt || -s < -nlx * x + nly * yt || ay - s < y) {
|
|
53874
|
+
return false;
|
|
53875
|
+
}
|
|
53876
|
+
var radius = shape.radius;
|
|
53877
|
+
var aw = (2 * ax * ay) / (ax + az);
|
|
53878
|
+
var rho = radius * aw - s;
|
|
53879
|
+
if (0 < rho) {
|
|
53880
|
+
var corner = shape.corner;
|
|
53881
|
+
var cby = ay - radius * aw;
|
|
53882
|
+
if (corner & EShapeCorner.TOP &&
|
|
53883
|
+
isCutByCorner(x, y, 0, -ay + radius * (2 * ay - aw), nlx, nly, -nlx, nly, rho)) {
|
|
53884
|
+
return false;
|
|
53885
|
+
}
|
|
53886
|
+
if (corner & EShapeCorner.BOTTOM_RIGHT &&
|
|
53887
|
+
isCutByCorner(x, y, ax * (1 - radius), cby, -nlx, nly, 0, 1, rho)) {
|
|
53888
|
+
return false;
|
|
53889
|
+
}
|
|
53890
|
+
if (corner & EShapeCorner.BOTTOM_LEFT &&
|
|
53891
|
+
isCutByCorner(x, y, -ax * (1 - radius), cby, nlx, nly, 0, 1, rho)) {
|
|
53892
|
+
return false;
|
|
53893
|
+
}
|
|
53894
|
+
}
|
|
53895
|
+
return true;
|
|
53896
|
+
};
|
|
53897
|
+
var hitTestTriangleRounded = function (shape, x, y, ax, ay, sw, ss) {
|
|
53898
|
+
var fill = shape.fill;
|
|
53899
|
+
if ((fill.enable || 0 < sw) && hitTestTriangleRoundedInset(shape, x, y, ax, ay, 0)) {
|
|
53900
|
+
if (fill.enable && hitTestFill(x, y, ax, ay, fill)) {
|
|
53901
|
+
return true;
|
|
53902
|
+
}
|
|
53903
|
+
if (0 < sw && !hitTestTriangleRoundedInset(shape, x, y, ax, ay, sw * ss)) {
|
|
53904
|
+
return true;
|
|
53905
|
+
}
|
|
53906
|
+
}
|
|
53907
|
+
return false;
|
|
53908
|
+
};
|
|
52943
53909
|
|
|
52944
53910
|
/*
|
|
52945
53911
|
* Copyright (C) 2019 Toshiba Corporation
|
|
52946
53912
|
* SPDX-License-Identifier: Apache-2.0
|
|
52947
53913
|
*/
|
|
52948
|
-
var
|
|
52949
|
-
__extends(
|
|
52950
|
-
function
|
|
52951
|
-
if (type === void 0) { type = EShapeType.
|
|
53914
|
+
var EShapeTriangleRoundedLegacy = /** @class */ (function (_super) {
|
|
53915
|
+
__extends(EShapeTriangleRoundedLegacy, _super);
|
|
53916
|
+
function EShapeTriangleRoundedLegacy(type) {
|
|
53917
|
+
if (type === void 0) { type = EShapeType.TRIANGLE_ROUNDED_LEGACY; }
|
|
52952
53918
|
return _super.call(this, type) || this;
|
|
52953
53919
|
}
|
|
52954
|
-
|
|
52955
|
-
return new
|
|
53920
|
+
EShapeTriangleRoundedLegacy.prototype.clone = function () {
|
|
53921
|
+
return new EShapeTriangleRoundedLegacy(this.type).copy(this);
|
|
52956
53922
|
};
|
|
52957
|
-
|
|
53923
|
+
EShapeTriangleRoundedLegacy.prototype.containsAbs = function (x, y, ax, ay, sw, ss, sa) {
|
|
52958
53924
|
if (_super.prototype.containsAbsBBox.call(this, x, y, ax, ay)) {
|
|
52959
|
-
return
|
|
53925
|
+
return hitTestTriangleRoundedLegacy(this, x, y, ax, ay, sw, ss);
|
|
52960
53926
|
}
|
|
52961
53927
|
return false;
|
|
52962
53928
|
};
|
|
52963
|
-
return
|
|
53929
|
+
return EShapeTriangleRoundedLegacy;
|
|
52964
53930
|
}(EShapePrimitive));
|
|
52965
53931
|
|
|
52966
53932
|
/*
|
|
@@ -53007,7 +53973,7 @@
|
|
|
53007
53973
|
return false;
|
|
53008
53974
|
};
|
|
53009
53975
|
return EShapeLineOfTriangleRoundeds;
|
|
53010
|
-
}(
|
|
53976
|
+
}(EShapeTriangleRoundedLegacy));
|
|
53011
53977
|
|
|
53012
53978
|
/*
|
|
53013
53979
|
* Copyright (C) 2019 Toshiba Corporation
|
|
@@ -53309,7 +54275,7 @@
|
|
|
53309
54275
|
boundary[2] = +ax;
|
|
53310
54276
|
boundary[3] = +ay;
|
|
53311
54277
|
// # of vertices and # of indices
|
|
53312
|
-
var nv =
|
|
54278
|
+
var nv = 9;
|
|
53313
54279
|
var ni = 3;
|
|
53314
54280
|
this._nvertices = nv;
|
|
53315
54281
|
this._nindices = ni;
|
|
@@ -53364,11 +54330,7 @@
|
|
|
53364
54330
|
// vertices (-sx, sy) and (sx, sy). The signs of sx and
|
|
53365
54331
|
// sy intentionally preserve horizontal and vertical reflections.
|
|
53366
54332
|
// The sloped edge spans ax horizontally and 2 * ay vertically.
|
|
53367
|
-
var
|
|
53368
|
-
// The base is horizontal, so its length is twice the half-width.
|
|
53369
|
-
var base = 2 * ax;
|
|
53370
|
-
// Length values are measured along the triangle perimeter.
|
|
53371
|
-
var perimeter = 2 * side + base;
|
|
54333
|
+
var b = Math.sqrt(ax * ax + 4 * ay * ay);
|
|
53372
54334
|
// The incenter lies on the vertical center line. This is its y-coordinate.
|
|
53373
54335
|
// Along the median, the distances from the top vertex to the incenter and
|
|
53374
54336
|
// from the incenter to the base are in the ratio 2 * side : base.
|
|
@@ -53380,42 +54342,47 @@
|
|
|
53380
54342
|
// cy = ay (2 side - 2 ax) / (2 side + 2 ax)
|
|
53381
54343
|
// cy = ay (side - ax) / (side + ax)
|
|
53382
54344
|
var cx = 0;
|
|
53383
|
-
var cy = (sy * (
|
|
54345
|
+
var cy = (sy * (b - ax)) / (b + ax);
|
|
53384
54346
|
// The distance from the incenter to every edge is the inradius.
|
|
53385
54347
|
// Since 0 <= (side - ax) / (side + ax) <= 1, the incenter remains
|
|
53386
54348
|
// between the apex and the base even when sy is negative.
|
|
53387
|
-
var
|
|
53388
|
-
var
|
|
54349
|
+
var d = Math.abs(sy - cy);
|
|
54350
|
+
var fd = 1 / d;
|
|
53389
54351
|
// Expand the triangle around its incenter for anti-aliasing and strokes.
|
|
53390
|
-
// The outer vertices are shared where their interpolated attributes match.
|
|
53391
54352
|
var x0 = 0;
|
|
53392
54353
|
var y0 = cy + scale * (-sy - cy);
|
|
53393
54354
|
var x1 = scale * sx;
|
|
53394
54355
|
var y1 = cy + scale * (sy - cy);
|
|
53395
54356
|
var x2 = -x1;
|
|
53396
54357
|
var y2 = y1;
|
|
53397
|
-
//
|
|
53398
|
-
|
|
53399
|
-
|
|
53400
|
-
this.updateVertex(2, cx, cy, fdistance, side - ax, 0, fx, fy);
|
|
54358
|
+
// Each cell has its own vertices because `length` is the arc length projected onto
|
|
54359
|
+
// the cell's edge. It is `lc` at the incenter (the tangent point) and
|
|
54360
|
+
// `lc + scale * (l - lc)` at the outer vertices so that it equals `l` at clipping = 1.
|
|
53401
54361
|
var indices = this._indices;
|
|
53402
|
-
|
|
53403
|
-
|
|
53404
|
-
|
|
53405
|
-
|
|
53406
|
-
this.
|
|
53407
|
-
this.
|
|
53408
|
-
|
|
53409
|
-
|
|
53410
|
-
|
|
53411
|
-
|
|
53412
|
-
this.
|
|
53413
|
-
this.
|
|
53414
|
-
|
|
53415
|
-
|
|
53416
|
-
|
|
53417
|
-
|
|
53418
|
-
|
|
54362
|
+
// Top-to-right edge cell
|
|
54363
|
+
var l0 = 0;
|
|
54364
|
+
var l1 = l0 + b;
|
|
54365
|
+
var lc0 = b - ax;
|
|
54366
|
+
this.writeVertex(0, x0, y0, fd, lc0 + scale * (l0 - lc0), scale, fx, fy);
|
|
54367
|
+
this.writeVertex(1, x1, y1, fd, lc0 + scale * (l1 - lc0), scale, fx, fy);
|
|
54368
|
+
this.writeVertex(2, cx, cy, fd, lc0, 0, fx, fy);
|
|
54369
|
+
// Right-to-left base edge cell
|
|
54370
|
+
var l2 = l1 + 2 * ax;
|
|
54371
|
+
var lc1 = b + ax;
|
|
54372
|
+
this.writeVertex(3, x1, y1, fd, lc1 + scale * (l1 - lc1), scale, fx, fy);
|
|
54373
|
+
this.writeVertex(4, x2, y2, fd, lc1 + scale * (l2 - lc1), scale, fx, fy);
|
|
54374
|
+
this.writeVertex(5, cx, cy, fd, lc1, 0, fx, fy);
|
|
54375
|
+
// Left-to-top edge cell
|
|
54376
|
+
var l3 = l2 + b;
|
|
54377
|
+
var lc2 = b + 3 * ax;
|
|
54378
|
+
this.writeVertex(6, x2, y2, fd, lc2 + scale * (l2 - lc2), scale, fx, fy);
|
|
54379
|
+
this.writeVertex(7, x0, y0, fd, lc2 + scale * (l3 - lc2), scale, fx, fy);
|
|
54380
|
+
this.writeVertex(8, cx, cy, fd, lc2, 0, fx, fy);
|
|
54381
|
+
for (var i = 0; i < 9; ++i) {
|
|
54382
|
+
indices[i] = i;
|
|
54383
|
+
}
|
|
54384
|
+
};
|
|
54385
|
+
EShapeTriangleTriangulatedImpl.prototype.writeVertex = function (vertex, x, y, distance, length, clipping, fx, fy) {
|
|
53419
54386
|
var vertex2 = vertex << 1;
|
|
53420
54387
|
this._vertices[vertex2] = x;
|
|
53421
54388
|
this._vertices[vertex2 + 1] = y;
|
|
@@ -55426,14 +56393,13 @@
|
|
|
55426
56393
|
return new EShapePolygon(this.type).copy(this);
|
|
55427
56394
|
};
|
|
55428
56395
|
EShapePolygon.prototype.copy = function (source, part) {
|
|
55429
|
-
if (part === void 0) { part = EShapeCopyPart.ALL; }
|
|
55430
56396
|
this.lock(EShapeLockPart.ALL);
|
|
55431
|
-
|
|
55432
|
-
if (part & EShapeCopyPart.POINTS && source instanceof EShapePolygon) {
|
|
56397
|
+
_super.prototype.copy.call(this, source, part);
|
|
56398
|
+
if ((part == null || part & EShapeCopyPart.POINTS) && source instanceof EShapePolygon) {
|
|
55433
56399
|
this._triangulated.copy(source._triangulated);
|
|
55434
56400
|
}
|
|
55435
56401
|
this.unlock(EShapeLockPart.ALL, true);
|
|
55436
|
-
return
|
|
56402
|
+
return this;
|
|
55437
56403
|
};
|
|
55438
56404
|
EShapePolygon.prototype.serialize = function (manager) {
|
|
55439
56405
|
var result = _super.prototype.serialize.call(this, manager);
|
|
@@ -55770,11 +56736,84 @@
|
|
|
55770
56736
|
EShapeCapabilities.set(EShapeType.RECTANGLE_ROUNDED_LEGACY, EShapeCapability.PRIMITIVE | EShapeCapability.STROKE_SIDE | EShapeCapability.BORDER_RADIUS);
|
|
55771
56737
|
};
|
|
55772
56738
|
|
|
55773
|
-
|
|
55774
|
-
|
|
55775
|
-
|
|
55776
|
-
|
|
55777
|
-
|
|
56739
|
+
/*
|
|
56740
|
+
* Copyright (C) 2019-2026 Toshiba Corporation
|
|
56741
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
56742
|
+
*/
|
|
56743
|
+
/**
|
|
56744
|
+
* A semicircle shape.
|
|
56745
|
+
*/
|
|
56746
|
+
var EShapeSemicircle = /** @class */ (function (_super) {
|
|
56747
|
+
__extends(EShapeSemicircle, _super);
|
|
56748
|
+
function EShapeSemicircle(type) {
|
|
56749
|
+
if (type === void 0) { type = EShapeType.SEMICIRCLE; }
|
|
56750
|
+
var _this = _super.call(this, type) || this;
|
|
56751
|
+
_this._triangulated = _this.newTriangulated();
|
|
56752
|
+
return _this;
|
|
56753
|
+
}
|
|
56754
|
+
EShapeSemicircle.prototype.newStroke = function () {
|
|
56755
|
+
return new EShapeStrokeImpl(this, true, EShapeDefaults.STROKE_COLOR, EShapeDefaults.STROKE_ALPHA, EShapeDefaults.STROKE_WIDTH, EShapeDefaults.STROKE_ALIGN, EShapeDefaults.STROKE_SIDE & ~EShapeStrokeSide.BOTTOM, EShapeDefaults.STROKE_STYLE);
|
|
56756
|
+
};
|
|
56757
|
+
EShapeSemicircle.prototype.newTriangulated = function () {
|
|
56758
|
+
return new EShapeFanTriangulatedImpl(this);
|
|
56759
|
+
};
|
|
56760
|
+
Object.defineProperty(EShapeSemicircle.prototype, "triangulated", {
|
|
56761
|
+
get: function () {
|
|
56762
|
+
return this._triangulated;
|
|
56763
|
+
},
|
|
56764
|
+
enumerable: false,
|
|
56765
|
+
configurable: true
|
|
56766
|
+
});
|
|
56767
|
+
Object.defineProperty(EShapeSemicircle.prototype, "angle", {
|
|
56768
|
+
get: function () {
|
|
56769
|
+
return 0.5;
|
|
56770
|
+
},
|
|
56771
|
+
set: function (angle) {
|
|
56772
|
+
// DO NOTHING
|
|
56773
|
+
},
|
|
56774
|
+
enumerable: false,
|
|
56775
|
+
configurable: true
|
|
56776
|
+
});
|
|
56777
|
+
EShapeSemicircle.prototype.toHitTestStrokeShift = function (strokeWidth, strokeScale, strokeAlign) {
|
|
56778
|
+
if ((this.stroke.side & EShapeStrokeSide.TOP_OR_BOTTOM) !== 0) {
|
|
56779
|
+
return _super.prototype.toHitTestStrokeShift.call(this, strokeWidth, strokeScale, strokeAlign);
|
|
56780
|
+
}
|
|
56781
|
+
return 0;
|
|
56782
|
+
};
|
|
56783
|
+
EShapeSemicircle.prototype.clone = function () {
|
|
56784
|
+
return new EShapeSemicircle(this.type).copy(this);
|
|
56785
|
+
};
|
|
56786
|
+
EShapeSemicircle.prototype.containsAbs = function (x, y, ax, ay, sw, ss, sa) {
|
|
56787
|
+
if (_super.prototype.containsAbsBBox.call(this, x, y, ax, ay)) {
|
|
56788
|
+
return hitTestFan(this, x, y, ax, ay, sw, ss);
|
|
56789
|
+
}
|
|
56790
|
+
return false;
|
|
56791
|
+
};
|
|
56792
|
+
return EShapeSemicircle;
|
|
56793
|
+
}(EShapePrimitive));
|
|
56794
|
+
|
|
56795
|
+
/*
|
|
56796
|
+
* Copyright (C) 2019 Toshiba Corporation
|
|
56797
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
56798
|
+
*/
|
|
56799
|
+
var deserializeSemicircle = function (item, manager, shape) {
|
|
56800
|
+
return deserializeBase(item, manager, shape || new EShapeSemicircle());
|
|
56801
|
+
};
|
|
56802
|
+
|
|
56803
|
+
/*
|
|
56804
|
+
* Copyright (C) 2019 Toshiba Corporation
|
|
56805
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
56806
|
+
*/
|
|
56807
|
+
var loadShapeSemicircle = function () {
|
|
56808
|
+
EShapeUploadeds[EShapeType.SEMICIRCLE] = createPolygonUploaded;
|
|
56809
|
+
EShapeDeserializers[EShapeType.SEMICIRCLE] = deserializeSemicircle;
|
|
56810
|
+
EShapeCapabilities.set(EShapeType.SEMICIRCLE, EShapeCapability.PRIMITIVE | EShapeCapability.STROKE_SIDE);
|
|
56811
|
+
};
|
|
56812
|
+
|
|
56813
|
+
var SEMICIRCLE_LEGACY_VERTEX_COUNT = 6;
|
|
56814
|
+
var SEMICIRCLE_LEGACY_INDEX_COUNT = 4;
|
|
56815
|
+
var SEMICIRCLE_LEGACY_WORLD_SIZE = [0, 0];
|
|
56816
|
+
var buildSemicircleLegacyIndex = function (indices, voffset, ioffset) {
|
|
55778
56817
|
var ii = ioffset * 3 - 1;
|
|
55779
56818
|
indices[++ii] = voffset;
|
|
55780
56819
|
indices[++ii] = voffset + 1;
|
|
@@ -55789,7 +56828,7 @@
|
|
|
55789
56828
|
indices[++ii] = voffset + 5;
|
|
55790
56829
|
indices[++ii] = voffset + 4;
|
|
55791
56830
|
};
|
|
55792
|
-
var
|
|
56831
|
+
var buildSemicircleLegacyVertex = function (vertices, voffset, originX, originY, sizeX, sizeY, strokeAlign, strokeWidth, internalTransform, worldSize) {
|
|
55793
56832
|
// Calculate the transformed positions
|
|
55794
56833
|
//
|
|
55795
56834
|
// 0 1 2
|
|
@@ -55797,24 +56836,23 @@
|
|
|
55797
56836
|
// |3 |4 |5
|
|
55798
56837
|
// |-------|-------|
|
|
55799
56838
|
//
|
|
55800
|
-
var work = SEMICIRCLE_WORK_POINT;
|
|
55801
56839
|
var s = strokeAlign * strokeWidth;
|
|
55802
56840
|
var sx = sizeX * 0.5 + (0 <= sizeX ? +s : -s);
|
|
55803
56841
|
var sy = sizeY * 0.5 + (0 <= sizeY ? +s : -s);
|
|
55804
|
-
|
|
55805
|
-
internalTransform.
|
|
55806
|
-
var
|
|
55807
|
-
var
|
|
55808
|
-
|
|
55809
|
-
internalTransform.
|
|
55810
|
-
var
|
|
55811
|
-
var
|
|
56842
|
+
var a = internalTransform.a;
|
|
56843
|
+
var b = internalTransform.b;
|
|
56844
|
+
var c = internalTransform.c;
|
|
56845
|
+
var d = internalTransform.d;
|
|
56846
|
+
var tx = internalTransform.tx;
|
|
56847
|
+
var ty = internalTransform.ty;
|
|
56848
|
+
var x0 = a * (-sx + originX) + c * (-sy + originY) + tx;
|
|
56849
|
+
var y0 = b * (-sx + originX) + d * (-sy + originY) + ty;
|
|
56850
|
+
var x1 = a * originX + c * (-sy + originY) + tx;
|
|
56851
|
+
var y1 = b * originX + d * (-sy + originY) + ty;
|
|
55812
56852
|
var dx = x1 - x0;
|
|
55813
56853
|
var dy = y1 - y0;
|
|
55814
|
-
|
|
55815
|
-
|
|
55816
|
-
var x4 = work.x;
|
|
55817
|
-
var y4 = work.y;
|
|
56854
|
+
var x4 = a * originX + c * originY + tx;
|
|
56855
|
+
var y4 = b * originX + d * originY + ty;
|
|
55818
56856
|
var x3 = x4 - dx;
|
|
55819
56857
|
var y3 = y4 - dy;
|
|
55820
56858
|
// Vertices
|
|
@@ -55834,7 +56872,7 @@
|
|
|
55834
56872
|
worldSize[0] = toLength(x0, y0, x1, y1);
|
|
55835
56873
|
worldSize[1] = toLength(x0, y0, x3, y3);
|
|
55836
56874
|
};
|
|
55837
|
-
var
|
|
56875
|
+
var buildSemicircleLegacyStep = function (steps, voffset, strokeWidth, strokeStyle, worldSize) {
|
|
55838
56876
|
var scaleInvariant = toScaleInvariant(strokeStyle);
|
|
55839
56877
|
var ws0 = worldSize[0];
|
|
55840
56878
|
var ws1 = worldSize[1];
|
|
@@ -55881,7 +56919,7 @@
|
|
|
55881
56919
|
steps[++is] = c10;
|
|
55882
56920
|
steps[++is] = 0;
|
|
55883
56921
|
};
|
|
55884
|
-
var
|
|
56922
|
+
var buildSemicircleLegacyUv = function (uvs, voffset, textureUvs) {
|
|
55885
56923
|
var x0 = textureUvs.x0;
|
|
55886
56924
|
var x1 = textureUvs.x1;
|
|
55887
56925
|
var x2 = textureUvs.x2;
|
|
@@ -55910,25 +56948,25 @@
|
|
|
55910
56948
|
* Copyright (C) 2019 Toshiba Corporation
|
|
55911
56949
|
* SPDX-License-Identifier: Apache-2.0
|
|
55912
56950
|
*/
|
|
55913
|
-
var
|
|
55914
|
-
__extends(
|
|
55915
|
-
function
|
|
55916
|
-
return _super.call(this, buffer, vertexOffset, indexOffset,
|
|
56951
|
+
var BuilderSemicircleLegacy = /** @class */ (function (_super) {
|
|
56952
|
+
__extends(BuilderSemicircleLegacy, _super);
|
|
56953
|
+
function BuilderSemicircleLegacy(buffer, vertexOffset, indexOffset) {
|
|
56954
|
+
return _super.call(this, buffer, vertexOffset, indexOffset, SEMICIRCLE_LEGACY_VERTEX_COUNT, SEMICIRCLE_LEGACY_INDEX_COUNT) || this;
|
|
55917
56955
|
}
|
|
55918
|
-
|
|
56956
|
+
BuilderSemicircleLegacy.prototype.init = function () {
|
|
55919
56957
|
var buffer = this.buffer;
|
|
55920
56958
|
buffer.updateIndices();
|
|
55921
56959
|
var voffset = this.vertexOffset;
|
|
55922
|
-
|
|
56960
|
+
buildSemicircleLegacyIndex(buffer.indices, voffset, this.indexOffset);
|
|
55923
56961
|
this.inited |= BuilderFlag.INDEX;
|
|
55924
56962
|
};
|
|
55925
|
-
|
|
56963
|
+
BuilderSemicircleLegacy.prototype.update = function (shape) {
|
|
55926
56964
|
var buffer = this.buffer;
|
|
55927
56965
|
this.updateVertexAndStep(buffer, shape);
|
|
55928
56966
|
this.updateColor(buffer, shape);
|
|
55929
56967
|
this.updateUv(buffer, shape);
|
|
55930
56968
|
};
|
|
55931
|
-
|
|
56969
|
+
BuilderSemicircleLegacy.prototype.updateVertexAndStep = function (buffer, shape) {
|
|
55932
56970
|
var size = shape.size;
|
|
55933
56971
|
var sizeX = size.x;
|
|
55934
56972
|
var sizeY = size.y;
|
|
@@ -55954,11 +56992,11 @@
|
|
|
55954
56992
|
// Buffer
|
|
55955
56993
|
buffer.updateVertices();
|
|
55956
56994
|
buffer.updateSteps();
|
|
55957
|
-
|
|
55958
|
-
|
|
56995
|
+
buildSemicircleLegacyVertex(buffer.vertices, this.vertexOffset, 0, 0, sizeX, sizeY, strokeAlign, strokeWidth, shape.transform.internalTransform, SEMICIRCLE_LEGACY_WORLD_SIZE);
|
|
56996
|
+
buildSemicircleLegacyStep(buffer.steps, this.vertexOffset, strokeWidth, strokeStyle, SEMICIRCLE_LEGACY_WORLD_SIZE);
|
|
55959
56997
|
}
|
|
55960
56998
|
};
|
|
55961
|
-
|
|
56999
|
+
BuilderSemicircleLegacy.prototype.updateUv = function (buffer, shape) {
|
|
55962
57000
|
var texture = toTexture(shape);
|
|
55963
57001
|
var textureTransformId = toTextureTransformId(texture);
|
|
55964
57002
|
var isNotInited = !(this.inited & BuilderFlag.UV);
|
|
@@ -55970,26 +57008,26 @@
|
|
|
55970
57008
|
this.textureTransformId = textureTransformId;
|
|
55971
57009
|
buffer.updateUvs();
|
|
55972
57010
|
var textureUvs = toTextureUvs(texture);
|
|
55973
|
-
|
|
57011
|
+
buildSemicircleLegacyUv(buffer.uvs, this.vertexOffset, textureUvs);
|
|
55974
57012
|
}
|
|
55975
57013
|
};
|
|
55976
|
-
return
|
|
57014
|
+
return BuilderSemicircleLegacy;
|
|
55977
57015
|
}(BuilderBase));
|
|
55978
57016
|
|
|
55979
57017
|
/*
|
|
55980
57018
|
* Copyright (C) 2019 Toshiba Corporation
|
|
55981
57019
|
* SPDX-License-Identifier: Apache-2.0
|
|
55982
57020
|
*/
|
|
55983
|
-
var
|
|
57021
|
+
var createSemicircleLegacyUploaded = function (buffer, shape, voffset, ioffset, antialiasWeight) {
|
|
55984
57022
|
var tcount = toTextBufferCount(shape);
|
|
55985
57023
|
var tvcount = tcount << TEXT_VERTEX_COUNT_SHIFT;
|
|
55986
57024
|
var ticount = tcount << TEXT_INDEX_COUNT_SHIFT;
|
|
55987
|
-
var vcount =
|
|
55988
|
-
var icount =
|
|
57025
|
+
var vcount = SEMICIRCLE_LEGACY_VERTEX_COUNT + tvcount;
|
|
57026
|
+
var icount = SEMICIRCLE_LEGACY_INDEX_COUNT + ticount;
|
|
55989
57027
|
if (buffer.check(voffset, ioffset, vcount, icount)) {
|
|
55990
57028
|
return new EShapeUploadedImpl(buffer, voffset, ioffset, vcount, icount, [
|
|
55991
|
-
new
|
|
55992
|
-
new BuilderText(buffer, voffset +
|
|
57029
|
+
new BuilderSemicircleLegacy(buffer, voffset, ioffset),
|
|
57030
|
+
new BuilderText(buffer, voffset + SEMICIRCLE_LEGACY_VERTEX_COUNT, ioffset + SEMICIRCLE_LEGACY_INDEX_COUNT, tvcount, ticount)
|
|
55993
57031
|
]).init(shape);
|
|
55994
57032
|
}
|
|
55995
57033
|
return null;
|
|
@@ -56012,44 +57050,42 @@
|
|
|
56012
57050
|
*/
|
|
56013
57051
|
/**
|
|
56014
57052
|
* A semicircle shape.
|
|
56015
|
-
*
|
|
56016
|
-
* @beta
|
|
56017
57053
|
*/
|
|
56018
|
-
var
|
|
56019
|
-
__extends(
|
|
56020
|
-
function
|
|
56021
|
-
if (type === void 0) { type = EShapeType.
|
|
57054
|
+
var EShapeSemicircleLegacy = /** @class */ (function (_super) {
|
|
57055
|
+
__extends(EShapeSemicircleLegacy, _super);
|
|
57056
|
+
function EShapeSemicircleLegacy(type) {
|
|
57057
|
+
if (type === void 0) { type = EShapeType.SEMICIRCLE_LEGACY; }
|
|
56022
57058
|
var _this = _super.call(this, type) || this;
|
|
56023
57059
|
_this.stroke.side = EShapeStrokeSide.ALL & ~EShapeStrokeSide.BOTTOM;
|
|
56024
57060
|
return _this;
|
|
56025
57061
|
}
|
|
56026
|
-
|
|
56027
|
-
return new
|
|
57062
|
+
EShapeSemicircleLegacy.prototype.clone = function () {
|
|
57063
|
+
return new EShapeSemicircleLegacy(this.type).copy(this);
|
|
56028
57064
|
};
|
|
56029
|
-
|
|
57065
|
+
EShapeSemicircleLegacy.prototype.containsAbs = function (x, y, ax, ay, sw, ss, sa) {
|
|
56030
57066
|
if (_super.prototype.containsAbsBBox.call(this, x, y, ax, ay)) {
|
|
56031
57067
|
return hitTestSemicircle(this, x, y, ax, ay, sw, ss);
|
|
56032
57068
|
}
|
|
56033
57069
|
return false;
|
|
56034
57070
|
};
|
|
56035
|
-
return
|
|
57071
|
+
return EShapeSemicircleLegacy;
|
|
56036
57072
|
}(EShapePrimitive));
|
|
56037
57073
|
|
|
56038
57074
|
/*
|
|
56039
57075
|
* Copyright (C) 2019 Toshiba Corporation
|
|
56040
57076
|
* SPDX-License-Identifier: Apache-2.0
|
|
56041
57077
|
*/
|
|
56042
|
-
var
|
|
56043
|
-
return deserializeBase(item, manager, shape || new
|
|
57078
|
+
var deserializeSemicircleLegacy = function (item, manager, shape) {
|
|
57079
|
+
return deserializeBase(item, manager, shape || new EShapeSemicircleLegacy());
|
|
56044
57080
|
};
|
|
56045
57081
|
|
|
56046
57082
|
/*
|
|
56047
57083
|
* Copyright (C) 2019 Toshiba Corporation
|
|
56048
57084
|
* SPDX-License-Identifier: Apache-2.0
|
|
56049
57085
|
*/
|
|
56050
|
-
var
|
|
56051
|
-
EShapeUploadeds[EShapeType.
|
|
56052
|
-
EShapeDeserializers[EShapeType.
|
|
57086
|
+
var loadShapeSemicircleLegacy = function () {
|
|
57087
|
+
EShapeUploadeds[EShapeType.SEMICIRCLE_LEGACY] = createSemicircleLegacyUploaded;
|
|
57088
|
+
EShapeDeserializers[EShapeType.SEMICIRCLE_LEGACY] = deserializeSemicircleLegacy;
|
|
56053
57089
|
};
|
|
56054
57090
|
|
|
56055
57091
|
/*
|
|
@@ -56192,30 +57228,516 @@
|
|
|
56192
57228
|
EShapeDeserializers[EShapeType.TRIANGLE_LEGACY] = deserializeTriangleLegacy;
|
|
56193
57229
|
};
|
|
56194
57230
|
|
|
57231
|
+
/*
|
|
57232
|
+
* Copyright (C) 2019-2026 Toshiba Corporation
|
|
57233
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
57234
|
+
*/
|
|
57235
|
+
var EShapeTriangleRoundedTriangulatedImpl = /** @class */ (function () {
|
|
57236
|
+
function EShapeTriangleRoundedTriangulatedImpl(parent) {
|
|
57237
|
+
this._id = 0;
|
|
57238
|
+
this._parent = parent;
|
|
57239
|
+
this._width = 0;
|
|
57240
|
+
this._height = 0;
|
|
57241
|
+
this._strokeAlign = 0;
|
|
57242
|
+
this._strokeWidth = 0;
|
|
57243
|
+
this._sizeX = 0;
|
|
57244
|
+
this._sizeY = 0;
|
|
57245
|
+
this._radius = 0;
|
|
57246
|
+
this._corner = EShapeCorner.NONE;
|
|
57247
|
+
this._vertices = [];
|
|
57248
|
+
this._nvertices = 0;
|
|
57249
|
+
this._distances = [];
|
|
57250
|
+
this._lengths = [];
|
|
57251
|
+
this._clippings = [];
|
|
57252
|
+
this._uvs = [];
|
|
57253
|
+
this._indices = [];
|
|
57254
|
+
this._nindices = 0;
|
|
57255
|
+
this._boundary = [0, 0, 0, 0];
|
|
57256
|
+
}
|
|
57257
|
+
Object.defineProperty(EShapeTriangleRoundedTriangulatedImpl.prototype, "id", {
|
|
57258
|
+
get: function () {
|
|
57259
|
+
this.triangulate();
|
|
57260
|
+
return this._id;
|
|
57261
|
+
},
|
|
57262
|
+
enumerable: false,
|
|
57263
|
+
configurable: true
|
|
57264
|
+
});
|
|
57265
|
+
Object.defineProperty(EShapeTriangleRoundedTriangulatedImpl.prototype, "vertices", {
|
|
57266
|
+
get: function () {
|
|
57267
|
+
this.triangulate();
|
|
57268
|
+
return this._vertices;
|
|
57269
|
+
},
|
|
57270
|
+
enumerable: false,
|
|
57271
|
+
configurable: true
|
|
57272
|
+
});
|
|
57273
|
+
Object.defineProperty(EShapeTriangleRoundedTriangulatedImpl.prototype, "nvertices", {
|
|
57274
|
+
get: function () {
|
|
57275
|
+
this.triangulate();
|
|
57276
|
+
return this._nvertices;
|
|
57277
|
+
},
|
|
57278
|
+
enumerable: false,
|
|
57279
|
+
configurable: true
|
|
57280
|
+
});
|
|
57281
|
+
Object.defineProperty(EShapeTriangleRoundedTriangulatedImpl.prototype, "distances", {
|
|
57282
|
+
get: function () {
|
|
57283
|
+
this.triangulate();
|
|
57284
|
+
return this._distances;
|
|
57285
|
+
},
|
|
57286
|
+
enumerable: false,
|
|
57287
|
+
configurable: true
|
|
57288
|
+
});
|
|
57289
|
+
Object.defineProperty(EShapeTriangleRoundedTriangulatedImpl.prototype, "lengths", {
|
|
57290
|
+
get: function () {
|
|
57291
|
+
this.triangulate();
|
|
57292
|
+
return this._lengths;
|
|
57293
|
+
},
|
|
57294
|
+
enumerable: false,
|
|
57295
|
+
configurable: true
|
|
57296
|
+
});
|
|
57297
|
+
Object.defineProperty(EShapeTriangleRoundedTriangulatedImpl.prototype, "clippings", {
|
|
57298
|
+
get: function () {
|
|
57299
|
+
this.triangulate();
|
|
57300
|
+
return this._clippings;
|
|
57301
|
+
},
|
|
57302
|
+
enumerable: false,
|
|
57303
|
+
configurable: true
|
|
57304
|
+
});
|
|
57305
|
+
Object.defineProperty(EShapeTriangleRoundedTriangulatedImpl.prototype, "uvs", {
|
|
57306
|
+
get: function () {
|
|
57307
|
+
this.triangulate();
|
|
57308
|
+
return this._uvs;
|
|
57309
|
+
},
|
|
57310
|
+
enumerable: false,
|
|
57311
|
+
configurable: true
|
|
57312
|
+
});
|
|
57313
|
+
Object.defineProperty(EShapeTriangleRoundedTriangulatedImpl.prototype, "indices", {
|
|
57314
|
+
get: function () {
|
|
57315
|
+
this.triangulate();
|
|
57316
|
+
return this._indices;
|
|
57317
|
+
},
|
|
57318
|
+
enumerable: false,
|
|
57319
|
+
configurable: true
|
|
57320
|
+
});
|
|
57321
|
+
Object.defineProperty(EShapeTriangleRoundedTriangulatedImpl.prototype, "nindices", {
|
|
57322
|
+
get: function () {
|
|
57323
|
+
this.triangulate();
|
|
57324
|
+
return this._nindices;
|
|
57325
|
+
},
|
|
57326
|
+
enumerable: false,
|
|
57327
|
+
configurable: true
|
|
57328
|
+
});
|
|
57329
|
+
Object.defineProperty(EShapeTriangleRoundedTriangulatedImpl.prototype, "boundary", {
|
|
57330
|
+
get: function () {
|
|
57331
|
+
this.triangulate();
|
|
57332
|
+
return this._boundary;
|
|
57333
|
+
},
|
|
57334
|
+
enumerable: false,
|
|
57335
|
+
configurable: true
|
|
57336
|
+
});
|
|
57337
|
+
EShapeTriangleRoundedTriangulatedImpl.prototype.triangulate = function () {
|
|
57338
|
+
var isNotInitialized = this._id === 0;
|
|
57339
|
+
var parent = this._parent;
|
|
57340
|
+
var size = parent.size;
|
|
57341
|
+
var width = size.x;
|
|
57342
|
+
var height = size.y;
|
|
57343
|
+
var isRectChanged = this._width !== width || this._height !== height;
|
|
57344
|
+
var stroke = parent.stroke;
|
|
57345
|
+
var strokeAlign = stroke.align;
|
|
57346
|
+
var strokeWidth = stroke.enable ? stroke.width : 0;
|
|
57347
|
+
var isStrokeChanged = this._strokeAlign !== strokeAlign || this._strokeWidth !== strokeWidth;
|
|
57348
|
+
var radius = parent.radius;
|
|
57349
|
+
var isRadiusChanged = this._radius !== radius;
|
|
57350
|
+
var corner = parent.corner;
|
|
57351
|
+
var isCornerChanged = this._corner !== corner;
|
|
57352
|
+
var isSizeChanged = false;
|
|
57353
|
+
var sizeX = this._sizeX;
|
|
57354
|
+
var sizeY = this._sizeY;
|
|
57355
|
+
if (isRectChanged || isStrokeChanged) {
|
|
57356
|
+
this._width = width;
|
|
57357
|
+
this._height = height;
|
|
57358
|
+
this._strokeAlign = strokeAlign;
|
|
57359
|
+
this._strokeWidth = strokeWidth;
|
|
57360
|
+
var s = strokeAlign * strokeWidth;
|
|
57361
|
+
sizeX = width * 0.5 + (0 <= width ? +s : -s);
|
|
57362
|
+
sizeY = height * 0.5 + (0 <= height ? +s : -s);
|
|
57363
|
+
isSizeChanged = this._sizeX !== sizeX || this._sizeY !== sizeY;
|
|
57364
|
+
}
|
|
57365
|
+
if (isNotInitialized ||
|
|
57366
|
+
isSizeChanged ||
|
|
57367
|
+
isStrokeChanged ||
|
|
57368
|
+
isRadiusChanged ||
|
|
57369
|
+
isCornerChanged) {
|
|
57370
|
+
this._sizeX = sizeX;
|
|
57371
|
+
this._sizeY = sizeY;
|
|
57372
|
+
this._radius = radius;
|
|
57373
|
+
this._corner = corner;
|
|
57374
|
+
this.update(sizeX, sizeY, radius, corner);
|
|
57375
|
+
}
|
|
57376
|
+
};
|
|
57377
|
+
EShapeTriangleRoundedTriangulatedImpl.prototype.update = function (sx, sy, radius, corner) {
|
|
57378
|
+
var boundary = this._boundary;
|
|
57379
|
+
var ax = Math.abs(sx);
|
|
57380
|
+
var ay = Math.abs(sy);
|
|
57381
|
+
boundary[0] = -ax;
|
|
57382
|
+
boundary[1] = -ay;
|
|
57383
|
+
boundary[2] = +ax;
|
|
57384
|
+
boundary[3] = +ay;
|
|
57385
|
+
var n = EShapeDefaults.CIRCLE_SEGMENT_COUNT >> 2;
|
|
57386
|
+
var nv = 9 * n + 6;
|
|
57387
|
+
var ni = 3 * n + 6;
|
|
57388
|
+
this._nvertices = nv;
|
|
57389
|
+
this._nindices = ni;
|
|
57390
|
+
this._id += 1;
|
|
57391
|
+
if (ax <= 0 || ay <= 0) {
|
|
57392
|
+
this.pad(0, 0, nv, ni, 0);
|
|
57393
|
+
return;
|
|
57394
|
+
}
|
|
57395
|
+
var scale = 1.1;
|
|
57396
|
+
var az = 2 * ay;
|
|
57397
|
+
var b0 = Math.sqrt(ax * ax + az * az);
|
|
57398
|
+
var r0 = (ax * az) / (ax + b0);
|
|
57399
|
+
var r = radius * r0;
|
|
57400
|
+
var fs = (scale - 1) * r0;
|
|
57401
|
+
var rs = r + fs;
|
|
57402
|
+
var r0i = 1 / r0;
|
|
57403
|
+
var rr0 = r * r0i;
|
|
57404
|
+
var a0 = ax * rr0;
|
|
57405
|
+
var b1 = b0 - a0;
|
|
57406
|
+
var b2 = b0 - ax;
|
|
57407
|
+
var b3 = b2 * rr0;
|
|
57408
|
+
var b0i = 1 / b0;
|
|
57409
|
+
var b1b0 = b1 * b0i;
|
|
57410
|
+
var b3b0 = b3 * b0i;
|
|
57411
|
+
var b2b0 = b2 * b0i;
|
|
57412
|
+
var gx = Math.sign(sx);
|
|
57413
|
+
var x0 = -sx;
|
|
57414
|
+
var x1 = -sx + gx * ax * (1 - b1b0);
|
|
57415
|
+
var x2 = -sx + gx * ax * rr0;
|
|
57416
|
+
var x3 = -sx + gx * ax * (1 - b3b0);
|
|
57417
|
+
var x4 = 0;
|
|
57418
|
+
var x6 = -x2;
|
|
57419
|
+
var xl = -sx + gx * ax * (1 - b2b0);
|
|
57420
|
+
var gy = Math.sign(sy);
|
|
57421
|
+
var y0 = -sy;
|
|
57422
|
+
var y1 = -sy + gy * az * b3b0;
|
|
57423
|
+
var y2 = -sy + gy * (az - r0) * rr0;
|
|
57424
|
+
var y3 = -sy + gy * (az - r0);
|
|
57425
|
+
var y4 = -sy + gy * az * b1b0;
|
|
57426
|
+
var y5 = -sy + gy * (az - r);
|
|
57427
|
+
var y6 = +sy;
|
|
57428
|
+
var yc = -sy + gy * az * b2b0;
|
|
57429
|
+
var dlx = xl - x4;
|
|
57430
|
+
var dly = yc - y3;
|
|
57431
|
+
var nlx = dlx * r0i;
|
|
57432
|
+
var nly = dly * r0i;
|
|
57433
|
+
var nrx = -nlx;
|
|
57434
|
+
var nry = nly;
|
|
57435
|
+
var nbx = 0;
|
|
57436
|
+
var nby = gy;
|
|
57437
|
+
var tt = (nrx * (nrx - nlx) + nry * (nry - nly)) / (nry * nlx - nrx * nly);
|
|
57438
|
+
var tl = (nbx * (nbx - nlx) + nby * (nby - nly)) / (nby * nlx - nbx * nly);
|
|
57439
|
+
var sx0 = x0 + (nlx - nly * tl) * fs;
|
|
57440
|
+
var sx1 = x1 + nlx * fs;
|
|
57441
|
+
var sx3 = x3 + nlx * fs;
|
|
57442
|
+
var sx5 = -sx3;
|
|
57443
|
+
var sx7 = -sx1;
|
|
57444
|
+
var sx8 = -sx0;
|
|
57445
|
+
var sy0 = y0 + (nly + nlx * tt) * fs;
|
|
57446
|
+
var sy1 = y1 + nly * fs;
|
|
57447
|
+
var sy4 = y4 + nly * fs;
|
|
57448
|
+
var sy6 = y6 + gy * fs;
|
|
57449
|
+
var fd = r0i;
|
|
57450
|
+
var fx = 1 / sx;
|
|
57451
|
+
var fy = 1 / sy;
|
|
57452
|
+
var ct = 0 < r && !!(corner & EShapeCorner.TOP);
|
|
57453
|
+
var cr = 0 < r && !!(corner & EShapeCorner.BOTTOM_RIGHT);
|
|
57454
|
+
var cl = 0 < r && !!(corner & EShapeCorner.BOTTOM_LEFT);
|
|
57455
|
+
var aapex = ct || cr || cl ? Math.atan2(ax, az) : 0;
|
|
57456
|
+
var gz = gx * gy;
|
|
57457
|
+
var atop = gz * (Math.PI - 2 * aapex);
|
|
57458
|
+
var abottom = gz * (Math.PI * 0.5 + aapex);
|
|
57459
|
+
// Top Fan
|
|
57460
|
+
var iv = 0;
|
|
57461
|
+
var ii = 0;
|
|
57462
|
+
var l = 0;
|
|
57463
|
+
if (ct) {
|
|
57464
|
+
l = this.writeFan(x4, y2, sx3, sy1, atop, nlx, nly, l, r, rs, fd, scale, fx, fy, n, iv, ii);
|
|
57465
|
+
iv += 3 * (n - 1);
|
|
57466
|
+
ii += 3 * (n - 1);
|
|
57467
|
+
}
|
|
57468
|
+
// Right Pentagon
|
|
57469
|
+
var p1x = sx5;
|
|
57470
|
+
var p1y = sy1;
|
|
57471
|
+
var ttx = x3;
|
|
57472
|
+
var tty = y1;
|
|
57473
|
+
if (!ct) {
|
|
57474
|
+
p1x = x4;
|
|
57475
|
+
p1y = sy0;
|
|
57476
|
+
ttx = x4;
|
|
57477
|
+
tty = y0;
|
|
57478
|
+
}
|
|
57479
|
+
var p2x = sx7;
|
|
57480
|
+
var p2y = sy4;
|
|
57481
|
+
var trbx = -x1;
|
|
57482
|
+
var trby = y4;
|
|
57483
|
+
if (!cr) {
|
|
57484
|
+
p2x = sx8;
|
|
57485
|
+
p2y = sy6;
|
|
57486
|
+
trbx = -x0;
|
|
57487
|
+
trby = y6;
|
|
57488
|
+
}
|
|
57489
|
+
var lr = Math.sqrt((trbx + ttx) * (trbx + ttx) + (trby - tty) * (trby - tty));
|
|
57490
|
+
var lrc = Math.sqrt((ttx - xl) * (ttx - xl) + (yc - tty) * (yc - tty));
|
|
57491
|
+
var nlr = l + lr;
|
|
57492
|
+
var tdx = sx * b0i;
|
|
57493
|
+
var tdy = 2 * sy * b0i;
|
|
57494
|
+
var lr1 = l + (p1x + ttx) * tdx + (p1y - tty) * tdy;
|
|
57495
|
+
var lr2 = nlr + (p2x - trbx) * tdx + (p2y - trby) * tdy;
|
|
57496
|
+
var c0 = scale;
|
|
57497
|
+
var c1 = 1 - radius;
|
|
57498
|
+
this.writePenta(ct ? x4 : p1x, ct ? y2 : p1y, p1x, p1y, p2x, p2y, cr ? x6 : p2x, cr ? y5 : p2y, x4, y3, ct ? l : lr1, lr1, lr2, cr ? nlr : lr2, l + lrc, ct ? c1 : c0, c0, c0, cr ? c1 : c0, 0, fd, fx, fy, iv, ii);
|
|
57499
|
+
iv += 5;
|
|
57500
|
+
ii += 9;
|
|
57501
|
+
l = nlr;
|
|
57502
|
+
// Right Fan
|
|
57503
|
+
if (cr) {
|
|
57504
|
+
l = this.writeFan(x6, y5, sx7, sy4, abottom, nrx, nry, l, r, rs, fd, scale, fx, fy, n, iv, ii);
|
|
57505
|
+
iv += 3 * (n - 1);
|
|
57506
|
+
ii += 3 * (n - 1);
|
|
57507
|
+
}
|
|
57508
|
+
// Bottom Pentagon
|
|
57509
|
+
var p3x = x6;
|
|
57510
|
+
var p3y = sy6;
|
|
57511
|
+
var q3x = x6;
|
|
57512
|
+
var q3y = y5;
|
|
57513
|
+
var tbrx = x6;
|
|
57514
|
+
if (!cr) {
|
|
57515
|
+
p3x = sx8;
|
|
57516
|
+
q3x = p3x;
|
|
57517
|
+
q3y = p3y;
|
|
57518
|
+
tbrx = -x0;
|
|
57519
|
+
}
|
|
57520
|
+
var p4x = x2;
|
|
57521
|
+
var p4y = sy6;
|
|
57522
|
+
var q4x = x2;
|
|
57523
|
+
var q4y = y5;
|
|
57524
|
+
var tblx = x2;
|
|
57525
|
+
if (!cl) {
|
|
57526
|
+
p4x = sx0;
|
|
57527
|
+
q4x = p4x;
|
|
57528
|
+
q4y = p4y;
|
|
57529
|
+
tblx = x0;
|
|
57530
|
+
}
|
|
57531
|
+
var lb = Math.abs(tbrx - tblx);
|
|
57532
|
+
var lbc = Math.abs(tbrx - x4);
|
|
57533
|
+
var nlb = l + lb;
|
|
57534
|
+
var lb1 = l - gx * (p3x - tbrx);
|
|
57535
|
+
var lb2 = nlb - gx * (p4x - tblx);
|
|
57536
|
+
this.writePenta(q3x, q3y, p3x, p3y, p4x, p4y, q4x, q4y, x4, y3, cr ? l : lb1, lb1, lb2, cl ? nlb : lb2, l + lbc, cr ? c1 : c0, c0, c0, cl ? c1 : c0, 0, fd, fx, fy, iv, ii);
|
|
57537
|
+
iv += 5;
|
|
57538
|
+
ii += 9;
|
|
57539
|
+
l = nlb;
|
|
57540
|
+
// Left Fan
|
|
57541
|
+
if (cl) {
|
|
57542
|
+
l = this.writeFan(x2, y5, x2, sy6, abottom, nbx, nby, l, r, rs, fd, scale, fx, fy, n, iv, ii);
|
|
57543
|
+
iv += 3 * (n - 1);
|
|
57544
|
+
ii += 3 * (n - 1);
|
|
57545
|
+
}
|
|
57546
|
+
// Left Pentagon
|
|
57547
|
+
var p5x = sx1;
|
|
57548
|
+
var p5y = sy4;
|
|
57549
|
+
var q5x = x2;
|
|
57550
|
+
var q5y = y5;
|
|
57551
|
+
var tlbx = x1;
|
|
57552
|
+
var tlby = y4;
|
|
57553
|
+
if (!cl) {
|
|
57554
|
+
p5x = sx0;
|
|
57555
|
+
p5y = sy6;
|
|
57556
|
+
q5x = p5x;
|
|
57557
|
+
q5y = p5y;
|
|
57558
|
+
tlbx = x0;
|
|
57559
|
+
tlby = y6;
|
|
57560
|
+
}
|
|
57561
|
+
var p6x = sx3;
|
|
57562
|
+
var p6y = sy1;
|
|
57563
|
+
var q6x = x4;
|
|
57564
|
+
var q6y = y2;
|
|
57565
|
+
if (!ct) {
|
|
57566
|
+
p6x = x4;
|
|
57567
|
+
p6y = sy0;
|
|
57568
|
+
q6x = p6x;
|
|
57569
|
+
q6y = p6y;
|
|
57570
|
+
}
|
|
57571
|
+
var ll = Math.sqrt((tlbx - ttx) * (tlbx - ttx) + (tlby - tty) * (tlby - tty));
|
|
57572
|
+
var llc = Math.sqrt((xl - tlbx) * (xl - tlbx) + (yc - tlby) * (yc - tlby));
|
|
57573
|
+
var nll = l + ll;
|
|
57574
|
+
var ll0 = nll + (p6x - ttx) * tdx - (p6y - tty) * tdy;
|
|
57575
|
+
var ll4 = l + (p5x - tlbx) * tdx - (p5y - tlby) * tdy;
|
|
57576
|
+
this.writePenta(p6x, p6y, q6x, q6y, x4, y3, q5x, q5y, p5x, p5y, ll0, ct ? nll : ll0, l + llc, cl ? l : ll4, ll4, c0, ct ? c1 : c0, 0, cl ? c1 : c0, c0, fd, fx, fy, iv, ii);
|
|
57577
|
+
iv += 5;
|
|
57578
|
+
ii += 9;
|
|
57579
|
+
this.pad(iv, ii, nv, ni, fd);
|
|
57580
|
+
};
|
|
57581
|
+
EShapeTriangleRoundedTriangulatedImpl.prototype.writePenta = function (x0, y0, x1, y1, x2, y2, x3, y3, x4, y4, length0, length1, length2, length3, length4, clipping0, clipping1, clipping2, clipping3, clipping4, distance, fx, fy, iv, ii) {
|
|
57582
|
+
this.writeVertex(iv + 0, x0, y0, distance, length0, clipping0, fx, fy);
|
|
57583
|
+
this.writeVertex(iv + 1, x1, y1, distance, length1, clipping1, fx, fy);
|
|
57584
|
+
this.writeVertex(iv + 2, x2, y2, distance, length2, clipping2, fx, fy);
|
|
57585
|
+
this.writeVertex(iv + 3, x3, y3, distance, length3, clipping3, fx, fy);
|
|
57586
|
+
this.writeVertex(iv + 4, x4, y4, distance, length4, clipping4, fx, fy);
|
|
57587
|
+
var indices = this._indices;
|
|
57588
|
+
indices[ii + 0] = iv + 0;
|
|
57589
|
+
indices[ii + 1] = iv + 1;
|
|
57590
|
+
indices[ii + 2] = iv + 2;
|
|
57591
|
+
indices[ii + 3] = iv + 0;
|
|
57592
|
+
indices[ii + 4] = iv + 2;
|
|
57593
|
+
indices[ii + 5] = iv + 3;
|
|
57594
|
+
indices[ii + 6] = iv + 0;
|
|
57595
|
+
indices[ii + 7] = iv + 3;
|
|
57596
|
+
indices[ii + 8] = iv + 4;
|
|
57597
|
+
};
|
|
57598
|
+
EShapeTriangleRoundedTriangulatedImpl.prototype.writeFan = function (cx, cy, x0, y0, dt, nx, ny, l0, r, rs, fd, scale, fx, fy, n, iv, ii) {
|
|
57599
|
+
var m = n - 1;
|
|
57600
|
+
var da = dt / m;
|
|
57601
|
+
var dl = Math.abs(da) * r;
|
|
57602
|
+
// Rim vertices at radius rs sit dl / 2 * (rs / r) from the chord midpoint, so the length is exact at radius r.
|
|
57603
|
+
var dlm = 0.5 * dl * (rs / r - 1);
|
|
57604
|
+
var c0 = scale;
|
|
57605
|
+
var c1 = 1 - r * fd;
|
|
57606
|
+
var indices = this._indices;
|
|
57607
|
+
var l = l0;
|
|
57608
|
+
var xa = x0;
|
|
57609
|
+
var ya = y0;
|
|
57610
|
+
for (var i = 0; i < m; i += 1) {
|
|
57611
|
+
var angle = (i + 1) * da;
|
|
57612
|
+
var ca = Math.cos(angle);
|
|
57613
|
+
var sa = Math.sin(angle);
|
|
57614
|
+
var xb = cx + rs * (nx * ca - ny * sa);
|
|
57615
|
+
var yb = cy + rs * (nx * sa + ny * ca);
|
|
57616
|
+
var nl = l + dl;
|
|
57617
|
+
this.writeVertex(iv + 0, xa, ya, fd, l - dlm, c0, fx, fy);
|
|
57618
|
+
this.writeVertex(iv + 1, xb, yb, fd, nl + dlm, c0, fx, fy);
|
|
57619
|
+
this.writeVertex(iv + 2, cx, cy, fd, l + 0.5 * dl, c1, fx, fy);
|
|
57620
|
+
indices[ii + 0] = iv + 2;
|
|
57621
|
+
indices[ii + 1] = iv + 0;
|
|
57622
|
+
indices[ii + 2] = iv + 1;
|
|
57623
|
+
iv += 3;
|
|
57624
|
+
ii += 3;
|
|
57625
|
+
l = nl;
|
|
57626
|
+
xa = xb;
|
|
57627
|
+
ya = yb;
|
|
57628
|
+
}
|
|
57629
|
+
return l;
|
|
57630
|
+
};
|
|
57631
|
+
EShapeTriangleRoundedTriangulatedImpl.prototype.writeVertex = function (vertex, x, y, distance, length, clipping, fx, fy) {
|
|
57632
|
+
var vertex2 = vertex << 1;
|
|
57633
|
+
this._vertices[vertex2] = x;
|
|
57634
|
+
this._vertices[vertex2 + 1] = y;
|
|
57635
|
+
this._distances[vertex] = distance;
|
|
57636
|
+
this._lengths[vertex] = length;
|
|
57637
|
+
this._clippings[vertex] = clipping;
|
|
57638
|
+
this._uvs[vertex2] = 0.5 * (x * fx + 1);
|
|
57639
|
+
this._uvs[vertex2 + 1] = 0.5 * (y * fy + 1);
|
|
57640
|
+
};
|
|
57641
|
+
EShapeTriangleRoundedTriangulatedImpl.prototype.pad = function (iv, ii, nv, ni, distance) {
|
|
57642
|
+
for (var i = iv; i < nv; ++i) {
|
|
57643
|
+
var vertex2 = i << 1;
|
|
57644
|
+
this._vertices[vertex2] = 0;
|
|
57645
|
+
this._vertices[vertex2 + 1] = 0;
|
|
57646
|
+
this._distances[i] = distance;
|
|
57647
|
+
this._lengths[i] = 0;
|
|
57648
|
+
this._clippings[i] = 0;
|
|
57649
|
+
this._uvs[vertex2] = 0.5;
|
|
57650
|
+
this._uvs[vertex2 + 1] = 0.5;
|
|
57651
|
+
}
|
|
57652
|
+
for (var i = ii; i < ni * 3; ++i) {
|
|
57653
|
+
this._indices[i] = 0;
|
|
57654
|
+
}
|
|
57655
|
+
this._vertices.length = nv * 2;
|
|
57656
|
+
this._distances.length = nv;
|
|
57657
|
+
this._lengths.length = nv;
|
|
57658
|
+
this._clippings.length = nv;
|
|
57659
|
+
this._uvs.length = nv * 2;
|
|
57660
|
+
this._indices.length = ni * 3;
|
|
57661
|
+
};
|
|
57662
|
+
return EShapeTriangleRoundedTriangulatedImpl;
|
|
57663
|
+
}());
|
|
57664
|
+
|
|
57665
|
+
/*
|
|
57666
|
+
* Copyright (C) 2019-2026 Toshiba Corporation
|
|
57667
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
57668
|
+
*/
|
|
57669
|
+
var EShapeTriangleRounded = /** @class */ (function (_super) {
|
|
57670
|
+
__extends(EShapeTriangleRounded, _super);
|
|
57671
|
+
function EShapeTriangleRounded(type) {
|
|
57672
|
+
if (type === void 0) { type = EShapeType.TRIANGLE_ROUNDED; }
|
|
57673
|
+
var _this = _super.call(this, type) || this;
|
|
57674
|
+
_this._triangulated = _this.newTriangulated();
|
|
57675
|
+
return _this;
|
|
57676
|
+
}
|
|
57677
|
+
EShapeTriangleRounded.prototype.newTriangulated = function () {
|
|
57678
|
+
return new EShapeTriangleRoundedTriangulatedImpl(this);
|
|
57679
|
+
};
|
|
57680
|
+
Object.defineProperty(EShapeTriangleRounded.prototype, "triangulated", {
|
|
57681
|
+
get: function () {
|
|
57682
|
+
return this._triangulated;
|
|
57683
|
+
},
|
|
57684
|
+
enumerable: false,
|
|
57685
|
+
configurable: true
|
|
57686
|
+
});
|
|
57687
|
+
EShapeTriangleRounded.prototype.clone = function () {
|
|
57688
|
+
return new EShapeTriangleRounded(this.type).copy(this);
|
|
57689
|
+
};
|
|
57690
|
+
EShapeTriangleRounded.prototype.containsAbs = function (x, y, ax, ay, sw, ss, sa) {
|
|
57691
|
+
if (_super.prototype.containsAbsBBox.call(this, x, y, ax, ay)) {
|
|
57692
|
+
return hitTestTriangleRounded(this, x, y, ax, ay, sw, ss);
|
|
57693
|
+
}
|
|
57694
|
+
return false;
|
|
57695
|
+
};
|
|
57696
|
+
return EShapeTriangleRounded;
|
|
57697
|
+
}(EShapePrimitive));
|
|
57698
|
+
|
|
57699
|
+
/*
|
|
57700
|
+
* Copyright (C) 2019 Toshiba Corporation
|
|
57701
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
57702
|
+
*/
|
|
57703
|
+
var deserializeTriangleRounded = function (item, manager, shape) {
|
|
57704
|
+
return deserializeBase(item, manager, shape || new EShapeTriangleRounded());
|
|
57705
|
+
};
|
|
57706
|
+
|
|
57707
|
+
/*
|
|
57708
|
+
* Copyright (C) 2019 Toshiba Corporation
|
|
57709
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
57710
|
+
*/
|
|
57711
|
+
var loadShapeTriangleRounded = function () {
|
|
57712
|
+
EShapeUploadeds[EShapeType.TRIANGLE_ROUNDED] = createPolygonUploaded;
|
|
57713
|
+
EShapeDeserializers[EShapeType.TRIANGLE_ROUNDED] = deserializeTriangleRounded;
|
|
57714
|
+
EShapeCapabilities.set(EShapeType.TRIANGLE_ROUNDED, EShapeCapability.PRIMITIVE | EShapeCapability.BORDER_RADIUS);
|
|
57715
|
+
};
|
|
57716
|
+
|
|
56195
57717
|
/*
|
|
56196
57718
|
* Copyright (C) 2019 Toshiba Corporation
|
|
56197
57719
|
* SPDX-License-Identifier: Apache-2.0
|
|
56198
57720
|
*/
|
|
56199
|
-
var
|
|
56200
|
-
__extends(
|
|
56201
|
-
function
|
|
56202
|
-
var _this = _super.call(this, buffer, vertexOffset, indexOffset,
|
|
57721
|
+
var BuilderTriangleRoundedLegacy = /** @class */ (function (_super) {
|
|
57722
|
+
__extends(BuilderTriangleRoundedLegacy, _super);
|
|
57723
|
+
function BuilderTriangleRoundedLegacy(buffer, vertexOffset, indexOffset) {
|
|
57724
|
+
var _this = _super.call(this, buffer, vertexOffset, indexOffset, TRIANGLE_ROUNDED_LEGACY_VERTEX_COUNT, TRIANGLE_ROUNDED_LEGACY_INDEX_COUNT) || this;
|
|
56203
57725
|
_this.radius = 0;
|
|
56204
57726
|
_this.corner = 0;
|
|
56205
57727
|
return _this;
|
|
56206
57728
|
}
|
|
56207
|
-
|
|
57729
|
+
BuilderTriangleRoundedLegacy.prototype.init = function () {
|
|
56208
57730
|
var buffer = this.buffer;
|
|
56209
57731
|
buffer.updateIndices();
|
|
56210
|
-
|
|
57732
|
+
buildTriangleRoundedLegacyIndex(buffer.indices, this.vertexOffset, this.indexOffset);
|
|
56211
57733
|
this.inited |= BuilderFlag.INDEX;
|
|
56212
57734
|
};
|
|
56213
|
-
|
|
57735
|
+
BuilderTriangleRoundedLegacy.prototype.update = function (shape) {
|
|
56214
57736
|
var buffer = this.buffer;
|
|
56215
57737
|
this.updateVertexStepAndUv(buffer, shape);
|
|
56216
57738
|
this.updateColor(buffer, shape);
|
|
56217
57739
|
};
|
|
56218
|
-
|
|
57740
|
+
BuilderTriangleRoundedLegacy.prototype.updateVertexStepAndUv = function (buffer, shape) {
|
|
56219
57741
|
var size = shape.size;
|
|
56220
57742
|
var sizeX = size.x;
|
|
56221
57743
|
var sizeY = size.y;
|
|
@@ -56256,55 +57778,55 @@
|
|
|
56256
57778
|
this.textureTransformId = textureTransformId;
|
|
56257
57779
|
var voffset = this.vertexOffset;
|
|
56258
57780
|
buffer.updateVertices();
|
|
56259
|
-
|
|
57781
|
+
buildTriangleRoundedLegacyVertex(buffer.vertices, voffset, 0, 0, sizeX, sizeY, strokeAlign, strokeWidth, radius, shape.transform.internalTransform, TRIANGLE_ROUNDED_LEGACY_WORLD_SIZE);
|
|
56260
57782
|
if (isNotInited || isVertexChanged || isTransformChanged || isCornerChanged) {
|
|
56261
57783
|
buffer.updateSteps();
|
|
56262
|
-
|
|
57784
|
+
buildTriangleRoundedLegacyStep(buffer.steps, voffset, strokeWidth, strokeStyle, corner, radius, TRIANGLE_ROUNDED_LEGACY_WORLD_SIZE);
|
|
56263
57785
|
}
|
|
56264
57786
|
if (isNotInited || isVertexChanged || isTextureChanged) {
|
|
56265
57787
|
buffer.updateUvs();
|
|
56266
|
-
|
|
57788
|
+
buildTriangleRoundedLegacyUv(buffer.uvs, voffset, toTextureUvs(texture), radius, TRIANGLE_ROUNDED_LEGACY_WORLD_SIZE);
|
|
56267
57789
|
}
|
|
56268
57790
|
}
|
|
56269
57791
|
};
|
|
56270
|
-
return
|
|
57792
|
+
return BuilderTriangleRoundedLegacy;
|
|
56271
57793
|
}(BuilderBase));
|
|
56272
57794
|
|
|
56273
57795
|
/*
|
|
56274
57796
|
* Copyright (C) 2019 Toshiba Corporation
|
|
56275
57797
|
* SPDX-License-Identifier: Apache-2.0
|
|
56276
57798
|
*/
|
|
56277
|
-
var
|
|
57799
|
+
var createTriangleRoundedLegacyUploaded = function (buffer, shape, voffset, ioffset, antialiasWeight) {
|
|
56278
57800
|
var tcount = toTextBufferCount(shape);
|
|
56279
57801
|
var tvcount = tcount << TEXT_VERTEX_COUNT_SHIFT;
|
|
56280
57802
|
var ticount = tcount << TEXT_INDEX_COUNT_SHIFT;
|
|
56281
|
-
var vcount =
|
|
56282
|
-
var icount =
|
|
57803
|
+
var vcount = TRIANGLE_ROUNDED_LEGACY_VERTEX_COUNT + tvcount;
|
|
57804
|
+
var icount = TRIANGLE_ROUNDED_LEGACY_INDEX_COUNT + ticount;
|
|
56283
57805
|
if (buffer.check(voffset, ioffset, vcount, icount)) {
|
|
56284
57806
|
return new EShapeUploadedImpl(buffer, voffset, ioffset, vcount, icount, [
|
|
56285
|
-
new
|
|
56286
|
-
new BuilderText(buffer, voffset +
|
|
57807
|
+
new BuilderTriangleRoundedLegacy(buffer, voffset, ioffset),
|
|
57808
|
+
new BuilderText(buffer, voffset + TRIANGLE_ROUNDED_LEGACY_VERTEX_COUNT, ioffset + TRIANGLE_ROUNDED_LEGACY_INDEX_COUNT, tvcount, ticount)
|
|
56287
57809
|
]).init(shape);
|
|
56288
57810
|
}
|
|
56289
57811
|
return null;
|
|
56290
57812
|
};
|
|
56291
57813
|
|
|
56292
57814
|
/*
|
|
56293
|
-
* Copyright (C) 2019 Toshiba Corporation
|
|
57815
|
+
* Copyright (C) 2019-2026 Toshiba Corporation
|
|
56294
57816
|
* SPDX-License-Identifier: Apache-2.0
|
|
56295
57817
|
*/
|
|
56296
|
-
var
|
|
56297
|
-
return deserializeBase(item, manager, shape || new
|
|
57818
|
+
var deserializeTriangleRoundedLegacy = function (item, manager, shape) {
|
|
57819
|
+
return deserializeBase(item, manager, shape || new EShapeTriangleRoundedLegacy());
|
|
56298
57820
|
};
|
|
56299
57821
|
|
|
56300
57822
|
/*
|
|
56301
57823
|
* Copyright (C) 2019 Toshiba Corporation
|
|
56302
57824
|
* SPDX-License-Identifier: Apache-2.0
|
|
56303
57825
|
*/
|
|
56304
|
-
var
|
|
56305
|
-
EShapeUploadeds[EShapeType.
|
|
56306
|
-
EShapeDeserializers[EShapeType.
|
|
56307
|
-
EShapeCapabilities.set(EShapeType.
|
|
57826
|
+
var loadShapeTriangleRoundedLegacy = function () {
|
|
57827
|
+
EShapeUploadeds[EShapeType.TRIANGLE_ROUNDED_LEGACY] = createTriangleRoundedLegacyUploaded;
|
|
57828
|
+
EShapeDeserializers[EShapeType.TRIANGLE_ROUNDED_LEGACY] = deserializeTriangleRoundedLegacy;
|
|
57829
|
+
EShapeCapabilities.set(EShapeType.TRIANGLE_ROUNDED_LEGACY, EShapeCapability.PRIMITIVE | EShapeCapability.BORDER_RADIUS);
|
|
56308
57830
|
};
|
|
56309
57831
|
|
|
56310
57832
|
/*
|
|
@@ -56319,6 +57841,7 @@
|
|
|
56319
57841
|
loadShapeConnectorElbow();
|
|
56320
57842
|
loadShapeConnectorLine();
|
|
56321
57843
|
loadShapeEmbedded();
|
|
57844
|
+
loadShapeFan();
|
|
56322
57845
|
loadShapeGroupShadowed();
|
|
56323
57846
|
loadShapeGroup();
|
|
56324
57847
|
loadShapeImage();
|
|
@@ -56332,8 +57855,10 @@
|
|
|
56332
57855
|
loadShapeRectangleRoundedLegacy();
|
|
56333
57856
|
loadShapeRectangleRounded();
|
|
56334
57857
|
loadShapeRectangle();
|
|
57858
|
+
loadShapeSemicircleLegacy();
|
|
56335
57859
|
loadShapeSemicircle();
|
|
56336
57860
|
loadShapeTriangleLegacy();
|
|
57861
|
+
loadShapeTriangleRoundedLegacy();
|
|
56337
57862
|
loadShapeTriangleRounded();
|
|
56338
57863
|
loadShapeTriangle();
|
|
56339
57864
|
loadShapeLineOfCircles();
|
|
@@ -88391,6 +89916,7 @@
|
|
|
88391
89916
|
loadShapeConnectorElbow: loadShapeConnectorElbow,
|
|
88392
89917
|
loadShapeConnectorLine: loadShapeConnectorLine,
|
|
88393
89918
|
loadShapeEmbedded: loadShapeEmbedded,
|
|
89919
|
+
loadShapeFan: loadShapeFan,
|
|
88394
89920
|
loadShapeGroupShadowed: loadShapeGroupShadowed,
|
|
88395
89921
|
loadShapeGroup: loadShapeGroup,
|
|
88396
89922
|
loadShapeImage: loadShapeImage,
|
|
@@ -88408,8 +89934,10 @@
|
|
|
88408
89934
|
loadShapeRectangleRoundedLegacy: loadShapeRectangleRoundedLegacy,
|
|
88409
89935
|
loadShapeRectangleRounded: loadShapeRectangleRounded,
|
|
88410
89936
|
loadShapeRectangle: loadShapeRectangle,
|
|
89937
|
+
loadShapeSemicircleLegacy: loadShapeSemicircleLegacy,
|
|
88411
89938
|
loadShapeSemicircle: loadShapeSemicircle,
|
|
88412
89939
|
loadShapeTriangleLegacy: loadShapeTriangleLegacy,
|
|
89940
|
+
loadShapeTriangleRoundedLegacy: loadShapeTriangleRoundedLegacy,
|
|
88413
89941
|
loadShapeTriangleRounded: loadShapeTriangleRounded,
|
|
88414
89942
|
loadShapeTriangle: loadShapeTriangle,
|
|
88415
89943
|
BAR_VERTEX_COUNT: BAR_VERTEX_COUNT,
|
|
@@ -88486,13 +90014,20 @@
|
|
|
88486
90014
|
RECTANGLE_INDEX_COUNT: RECTANGLE_LEGACY_INDEX_COUNT,
|
|
88487
90015
|
RECTANGLE_VERTEX_COUNT: RECTANGLE_LEGACY_VERTEX_COUNT,
|
|
88488
90016
|
RECTANGLE_WORLD_SIZE: RECTANGLE_LEGACY_WORLD_SIZE,
|
|
88489
|
-
|
|
88490
|
-
|
|
88491
|
-
|
|
88492
|
-
|
|
88493
|
-
|
|
88494
|
-
|
|
88495
|
-
|
|
90017
|
+
SEMICIRCLE_LEGACY_VERTEX_COUNT: SEMICIRCLE_LEGACY_VERTEX_COUNT,
|
|
90018
|
+
SEMICIRCLE_LEGACY_INDEX_COUNT: SEMICIRCLE_LEGACY_INDEX_COUNT,
|
|
90019
|
+
SEMICIRCLE_LEGACY_WORLD_SIZE: SEMICIRCLE_LEGACY_WORLD_SIZE,
|
|
90020
|
+
buildSemicircleLegacyIndex: buildSemicircleLegacyIndex,
|
|
90021
|
+
buildSemicircleLegacyVertex: buildSemicircleLegacyVertex,
|
|
90022
|
+
buildSemicircleLegacyStep: buildSemicircleLegacyStep,
|
|
90023
|
+
buildSemicircleLegacyUv: buildSemicircleLegacyUv,
|
|
90024
|
+
SEMICIRCLE_VERTEX_COUNT: SEMICIRCLE_LEGACY_VERTEX_COUNT,
|
|
90025
|
+
SEMICIRCLE_INDEX_COUNT: SEMICIRCLE_LEGACY_INDEX_COUNT,
|
|
90026
|
+
SEMICIRCLE_WORLD_SIZE: SEMICIRCLE_LEGACY_WORLD_SIZE,
|
|
90027
|
+
buildSemicircleIndex: buildSemicircleLegacyIndex,
|
|
90028
|
+
buildSemicircleVertex: buildSemicircleLegacyVertex,
|
|
90029
|
+
buildSemicircleStep: buildSemicircleLegacyStep,
|
|
90030
|
+
buildSemicircleUv: buildSemicircleLegacyUv,
|
|
88496
90031
|
TEXT_VERTEX_COUNT: TEXT_VERTEX_COUNT,
|
|
88497
90032
|
TEXT_VERTEX_COUNT_SHIFT: TEXT_VERTEX_COUNT_SHIFT,
|
|
88498
90033
|
TEXT_INDEX_COUNT: TEXT_INDEX_COUNT,
|
|
@@ -88509,13 +90044,20 @@
|
|
|
88509
90044
|
buildTriangleLegacyVertex: buildTriangleLegacyVertex,
|
|
88510
90045
|
buildTriangleLegacyStep: buildTriangleLegacyStep,
|
|
88511
90046
|
buildTriangleLegacyUv: buildTriangleLegacyUv,
|
|
88512
|
-
|
|
88513
|
-
|
|
88514
|
-
|
|
88515
|
-
|
|
88516
|
-
|
|
88517
|
-
|
|
88518
|
-
|
|
90047
|
+
buildTriangleRoundedIndex: buildTriangleRoundedLegacyIndex,
|
|
90048
|
+
buildTriangleRoundedStep: buildTriangleRoundedLegacyStep,
|
|
90049
|
+
buildTriangleRoundedUv: buildTriangleRoundedLegacyUv,
|
|
90050
|
+
buildTriangleRoundedVertex: buildTriangleRoundedLegacyVertex,
|
|
90051
|
+
TRIANGLE_ROUNDED_INDEX_COUNT: TRIANGLE_ROUNDED_LEGACY_INDEX_COUNT,
|
|
90052
|
+
TRIANGLE_ROUNDED_VERTEX_COUNT: TRIANGLE_ROUNDED_LEGACY_VERTEX_COUNT,
|
|
90053
|
+
TRIANGLE_ROUNDED_WORLD_SIZE: TRIANGLE_ROUNDED_LEGACY_WORLD_SIZE,
|
|
90054
|
+
TRIANGLE_ROUNDED_LEGACY_VERTEX_COUNT: TRIANGLE_ROUNDED_LEGACY_VERTEX_COUNT,
|
|
90055
|
+
TRIANGLE_ROUNDED_LEGACY_INDEX_COUNT: TRIANGLE_ROUNDED_LEGACY_INDEX_COUNT,
|
|
90056
|
+
TRIANGLE_ROUNDED_LEGACY_WORLD_SIZE: TRIANGLE_ROUNDED_LEGACY_WORLD_SIZE,
|
|
90057
|
+
buildTriangleRoundedLegacyIndex: buildTriangleRoundedLegacyIndex,
|
|
90058
|
+
buildTriangleRoundedLegacyVertex: buildTriangleRoundedLegacyVertex,
|
|
90059
|
+
buildTriangleRoundedLegacyStep: buildTriangleRoundedLegacyStep,
|
|
90060
|
+
buildTriangleRoundedLegacyUv: buildTriangleRoundedLegacyUv,
|
|
88519
90061
|
buildTriangleIndex: buildTriangleLegacyIndex,
|
|
88520
90062
|
buildTriangleStep: buildTriangleLegacyStep,
|
|
88521
90063
|
buildTriangleUv: buildTriangleLegacyUv,
|
|
@@ -88552,10 +90094,11 @@
|
|
|
88552
90094
|
BuilderRectangleRoundedLegacy: BuilderRectangleRoundedLegacy,
|
|
88553
90095
|
BuilderRectangleRounded: BuilderRectangleRoundedLegacy,
|
|
88554
90096
|
BuilderRectangle: BuilderRectangleLegacy,
|
|
88555
|
-
BuilderSemicircle:
|
|
90097
|
+
BuilderSemicircle: BuilderSemicircleLegacy,
|
|
88556
90098
|
BuilderText: BuilderText,
|
|
88557
90099
|
BuilderTriangleLegacy: BuilderTriangleLegacy,
|
|
88558
|
-
BuilderTriangleRounded:
|
|
90100
|
+
BuilderTriangleRounded: BuilderTriangleRoundedLegacy,
|
|
90101
|
+
BuilderTriangleRoundedLegacy: BuilderTriangleRoundedLegacy,
|
|
88559
90102
|
BuilderTriangle: BuilderTriangleLegacy,
|
|
88560
90103
|
BuilderFlag: BuilderFlag,
|
|
88561
90104
|
toTransformLocalId: toTransformLocalId,
|
|
@@ -88591,9 +90134,11 @@
|
|
|
88591
90134
|
createRectangleRoundedLegacyUploaded: createRectangleRoundedLegacyUploaded,
|
|
88592
90135
|
createRectangleRoundedUploaded: createRectangleRoundedLegacyUploaded,
|
|
88593
90136
|
createRectangleUploaded: createRectangleLegacyUploaded,
|
|
88594
|
-
|
|
90137
|
+
createSemicircleLegacyUploaded: createSemicircleLegacyUploaded,
|
|
90138
|
+
createSemicircleUploaded: createSemicircleLegacyUploaded,
|
|
88595
90139
|
createTriangleLegacyUploaded: createTriangleLegacyUploaded,
|
|
88596
|
-
createTriangleRoundedUploaded:
|
|
90140
|
+
createTriangleRoundedUploaded: createTriangleRoundedLegacyUploaded,
|
|
90141
|
+
createTriangleRoundedLegacyUploaded: createTriangleRoundedLegacyUploaded,
|
|
88597
90142
|
createTriangleUploaded: createTriangleLegacyUploaded,
|
|
88598
90143
|
deserializeAll: deserializeAll,
|
|
88599
90144
|
deserializeBar: deserializeBar,
|
|
@@ -88607,6 +90152,7 @@
|
|
|
88607
90152
|
deserializeEmbeddedAcceptorEdge: deserializeEmbeddedAcceptorEdge,
|
|
88608
90153
|
deserializeEmbeddedLayer: deserializeEmbeddedLayer,
|
|
88609
90154
|
deserializeEmbedded: deserializeEmbedded,
|
|
90155
|
+
deserializeFan: deserializeFan,
|
|
88610
90156
|
deserializeGradient: deserializeGradient,
|
|
88611
90157
|
deserializeGroupShadowed: deserializeGroupShadowed,
|
|
88612
90158
|
deserializeGroup: deserializeGroup,
|
|
@@ -88626,9 +90172,11 @@
|
|
|
88626
90172
|
deserializeRectangleRoundedLegacy: deserializeRectangleRoundedLegacy,
|
|
88627
90173
|
deserializeRectangleRounded: deserializeRectangleRounded,
|
|
88628
90174
|
deserializeRectangle: deserializeRectangle,
|
|
90175
|
+
deserializeSemicircleLegacy: deserializeSemicircleLegacy,
|
|
88629
90176
|
deserializeSemicircle: deserializeSemicircle,
|
|
88630
90177
|
deserializeTriangleLegacy: deserializeTriangleLegacy,
|
|
88631
90178
|
deserializeTriangleRounded: deserializeTriangleRounded,
|
|
90179
|
+
deserializeTriangleRoundedLegacy: deserializeTriangleRoundedLegacy,
|
|
88632
90180
|
deserializeTriangle: deserializeTriangle,
|
|
88633
90181
|
deserialize: deserialize,
|
|
88634
90182
|
EShapeBarPoints: EShapeBarPoints,
|
|
@@ -88653,6 +90201,8 @@
|
|
|
88653
90201
|
EShapeEmbeddedLayer: EShapeEmbeddedLayer,
|
|
88654
90202
|
EShapeEmbedded: EShapeEmbedded,
|
|
88655
90203
|
EShapeEmbeddeds: EShapeEmbeddeds,
|
|
90204
|
+
EShapeFanTriangulatedImpl: EShapeFanTriangulatedImpl,
|
|
90205
|
+
EShapeFan: EShapeFan,
|
|
88656
90206
|
EShapeFillImpl: EShapeFillImpl,
|
|
88657
90207
|
EShapeGroupFillEditor: EShapeGroupFillEditor,
|
|
88658
90208
|
EShapeGroupFillViewer: EShapeGroupFillViewer,
|
|
@@ -88696,6 +90246,7 @@
|
|
|
88696
90246
|
EShapeRectangleRounded: EShapeRectangleRounded,
|
|
88697
90247
|
EShapeRectangleTriangulatedImpl: EShapeRectangleTriangulatedImpl,
|
|
88698
90248
|
EShapeRectangle: EShapeRectangle,
|
|
90249
|
+
EShapeSemicircleLegacy: EShapeSemicircleLegacy,
|
|
88699
90250
|
EShapeSemicircle: EShapeSemicircle,
|
|
88700
90251
|
EShapeStrokeImpl: EShapeStrokeImpl,
|
|
88701
90252
|
EShapeTextAlignImpl: EShapeTextAlignImpl,
|
|
@@ -88704,16 +90255,20 @@
|
|
|
88704
90255
|
EShapeTextOutlineImpl: EShapeTextOutlineImpl,
|
|
88705
90256
|
EShapeTriangleLegacy: EShapeTriangleLegacy,
|
|
88706
90257
|
EShapeTriangleRounded: EShapeTriangleRounded,
|
|
90258
|
+
EShapeTriangleRoundedLegacy: EShapeTriangleRoundedLegacy,
|
|
90259
|
+
EShapeTriangleRoundedTriangulatedImpl: EShapeTriangleRoundedTriangulatedImpl,
|
|
88707
90260
|
EShapeTriangleTriangulatedImpl: EShapeTriangleTriangulatedImpl,
|
|
88708
90261
|
EShapeTriangle: EShapeTriangle,
|
|
88709
90262
|
hitTestBBox: hitTestBBox,
|
|
88710
90263
|
hitTestCircleLegacy: hitTestCircleLegacy,
|
|
88711
90264
|
hitTestCircle: hitTestCircle,
|
|
90265
|
+
hitTestFan: hitTestFan,
|
|
88712
90266
|
hitTestSemicircle: hitTestSemicircle,
|
|
88713
90267
|
hitTestRectangleRoundedLegacy: hitTestRectangleRoundedLegacy,
|
|
88714
90268
|
hitTestRectangleRounded: hitTestRectangleRounded,
|
|
88715
90269
|
hitTestRectangleLegacy: hitTestRectangleLegacy,
|
|
88716
90270
|
hitTestRectangle: hitTestRectangle,
|
|
90271
|
+
hitTestTriangleRoundedLegacy: hitTestTriangleRoundedLegacy,
|
|
88717
90272
|
hitTestTriangleRounded: hitTestTriangleRounded,
|
|
88718
90273
|
hitTestTriangleFilled: hitTestTriangleFilled,
|
|
88719
90274
|
hitTestTriangleLegacy: hitTestTriangleLegacy,
|
|
@@ -88722,6 +90277,8 @@
|
|
|
88722
90277
|
isStatic: isStatic,
|
|
88723
90278
|
toComputed: toComputed,
|
|
88724
90279
|
toDash: toDash,
|
|
90280
|
+
toFanAngleCentric: toFanAngleCentric,
|
|
90281
|
+
toFanAngleEccentric: toFanAngleEccentric,
|
|
88725
90282
|
toGradientImageUrl: toGradientImageUrl,
|
|
88726
90283
|
toGradientSerialized: toGradientSerialized,
|
|
88727
90284
|
toImageElement: toImageElement,
|