@wcardinal/wcardinal-ui 0.466.0 → 0.466.2-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.
Files changed (108) hide show
  1. package/dist/types/wcardinal/ui/shape/e-shape-transform.d.ts +8 -0
  2. package/dist/types/wcardinal/ui/shape/e-shape-type.d.ts +1 -0
  3. package/dist/types/wcardinal/ui/shape/load/index.d.ts +1 -0
  4. package/dist/types/wcardinal/ui/shape/load/load-shape-triangle-legacy.d.ts +1 -0
  5. package/dist/types/wcardinal/ui/shape/variant/build-triangle-legacy.d.ts +9 -0
  6. package/dist/types/wcardinal/ui/shape/variant/build-triangle.d.ts +1 -9
  7. package/dist/types/wcardinal/ui/shape/variant/builder-triangle-legacy.d.ts +9 -0
  8. package/dist/types/wcardinal/ui/shape/variant/builder-triangle.d.ts +1 -9
  9. package/dist/types/wcardinal/ui/shape/variant/create-triangle-legacy-uploaded.d.ts +4 -0
  10. package/dist/types/wcardinal/ui/shape/variant/create-triangle-uploaded.d.ts +1 -4
  11. package/dist/types/wcardinal/ui/shape/variant/deserialize-triangle-legacy.d.ts +4 -0
  12. package/dist/types/wcardinal/ui/shape/variant/e-shape-rectangle-triangulated-impl.d.ts +2 -2
  13. package/dist/types/wcardinal/ui/shape/variant/e-shape-triangle-legacy.d.ts +7 -0
  14. package/dist/types/wcardinal/ui/shape/variant/e-shape-triangle-triangulated-impl.d.ts +42 -0
  15. package/dist/types/wcardinal/ui/shape/variant/e-shape-triangle-triangulated.d.ts +3 -0
  16. package/dist/types/wcardinal/ui/shape/variant/e-shape-triangle.d.ts +4 -0
  17. package/dist/types/wcardinal/ui/shape/variant/hit-test-circle.d.ts +1 -0
  18. package/dist/types/wcardinal/ui/shape/variant/hit-test-rectangle.d.ts +1 -0
  19. package/dist/types/wcardinal/ui/shape/variant/hit-test-triangle.d.ts +1 -0
  20. package/dist/types/wcardinal/ui/shape/variant/index.d.ts +7 -0
  21. package/dist/wcardinal/ui/shape/action/e-shape-action-runtime-transform-move-forward-or-backward.js +1 -3
  22. package/dist/wcardinal/ui/shape/action/e-shape-action-runtime-transform-move-forward-or-backward.js.map +1 -1
  23. package/dist/wcardinal/ui/shape/action/e-shape-action-runtime-transform-move-left-or-right.js +1 -3
  24. package/dist/wcardinal/ui/shape/action/e-shape-action-runtime-transform-move-left-or-right.js.map +1 -1
  25. package/dist/wcardinal/ui/shape/action/e-shape-action-runtime-transform-resize.js +1 -3
  26. package/dist/wcardinal/ui/shape/action/e-shape-action-runtime-transform-resize.js.map +1 -1
  27. package/dist/wcardinal/ui/shape/e-shape-renderer.js +1 -1
  28. package/dist/wcardinal/ui/shape/e-shape-renderer.js.map +1 -1
  29. package/dist/wcardinal/ui/shape/e-shape-transform.js +28 -0
  30. package/dist/wcardinal/ui/shape/e-shape-transform.js.map +1 -1
  31. package/dist/wcardinal/ui/shape/e-shape-type.js +1 -0
  32. package/dist/wcardinal/ui/shape/e-shape-type.js.map +1 -1
  33. package/dist/wcardinal/ui/shape/load/index.js +1 -0
  34. package/dist/wcardinal/ui/shape/load/index.js.map +1 -1
  35. package/dist/wcardinal/ui/shape/load/load-shape-all.js +2 -0
  36. package/dist/wcardinal/ui/shape/load/load-shape-all.js.map +1 -1
  37. package/dist/wcardinal/ui/shape/load/load-shape-triangle-legacy.js +14 -0
  38. package/dist/wcardinal/ui/shape/load/load-shape-triangle-legacy.js.map +1 -0
  39. package/dist/wcardinal/ui/shape/load/load-shape-triangle-rounded.js +1 -1
  40. package/dist/wcardinal/ui/shape/load/load-shape-triangle-rounded.js.map +1 -1
  41. package/dist/wcardinal/ui/shape/load/load-shape-triangle.js +2 -2
  42. package/dist/wcardinal/ui/shape/load/load-shape-triangle.js.map +1 -1
  43. package/dist/wcardinal/ui/shape/variant/build-triangle-legacy.js +160 -0
  44. package/dist/wcardinal/ui/shape/variant/build-triangle-legacy.js.map +1 -0
  45. package/dist/wcardinal/ui/shape/variant/build-triangle.js +5 -159
  46. package/dist/wcardinal/ui/shape/variant/build-triangle.js.map +1 -1
  47. package/dist/wcardinal/ui/shape/variant/builder-line-of-triangles.js +16 -16
  48. package/dist/wcardinal/ui/shape/variant/builder-line-of-triangles.js.map +1 -1
  49. package/dist/wcardinal/ui/shape/variant/builder-marker-triangle.js +6 -6
  50. package/dist/wcardinal/ui/shape/variant/builder-marker-triangle.js.map +1 -1
  51. package/dist/wcardinal/ui/shape/variant/builder-triangle-legacy.js +71 -0
  52. package/dist/wcardinal/ui/shape/variant/builder-triangle-legacy.js.map +1 -0
  53. package/dist/wcardinal/ui/shape/variant/builder-triangle.js +1 -66
  54. package/dist/wcardinal/ui/shape/variant/builder-triangle.js.map +1 -1
  55. package/dist/wcardinal/ui/shape/variant/create-line-of-triangles-uploaded.js +2 -2
  56. package/dist/wcardinal/ui/shape/variant/create-line-of-triangles-uploaded.js.map +1 -1
  57. package/dist/wcardinal/ui/shape/variant/create-line-uploaded.js +3 -3
  58. package/dist/wcardinal/ui/shape/variant/create-line-uploaded.js.map +1 -1
  59. package/dist/wcardinal/ui/shape/variant/create-triangle-legacy-uploaded.js +24 -0
  60. package/dist/wcardinal/ui/shape/variant/create-triangle-legacy-uploaded.js.map +1 -0
  61. package/dist/wcardinal/ui/shape/variant/create-triangle-uploaded.js +1 -19
  62. package/dist/wcardinal/ui/shape/variant/create-triangle-uploaded.js.map +1 -1
  63. package/dist/wcardinal/ui/shape/variant/deserialize-triangle-legacy.js +10 -0
  64. package/dist/wcardinal/ui/shape/variant/deserialize-triangle-legacy.js.map +1 -0
  65. package/dist/wcardinal/ui/shape/variant/e-shape-circle-legacy.js +2 -2
  66. package/dist/wcardinal/ui/shape/variant/e-shape-circle-legacy.js.map +1 -1
  67. package/dist/wcardinal/ui/shape/variant/e-shape-line-base.js +6 -6
  68. package/dist/wcardinal/ui/shape/variant/e-shape-line-base.js.map +1 -1
  69. package/dist/wcardinal/ui/shape/variant/e-shape-line-of-circles.js +2 -2
  70. package/dist/wcardinal/ui/shape/variant/e-shape-line-of-circles.js.map +1 -1
  71. package/dist/wcardinal/ui/shape/variant/e-shape-rectangle-legacy.js +2 -2
  72. package/dist/wcardinal/ui/shape/variant/e-shape-rectangle-legacy.js.map +1 -1
  73. package/dist/wcardinal/ui/shape/variant/e-shape-rectangle-triangulated-impl.js.map +1 -1
  74. package/dist/wcardinal/ui/shape/variant/e-shape-triangle-legacy.js +27 -0
  75. package/dist/wcardinal/ui/shape/variant/e-shape-triangle-legacy.js.map +1 -0
  76. package/dist/wcardinal/ui/shape/variant/e-shape-triangle-triangulated-impl.js +264 -0
  77. package/dist/wcardinal/ui/shape/variant/e-shape-triangle-triangulated-impl.js.map +1 -0
  78. package/dist/wcardinal/ui/shape/variant/e-shape-triangle-triangulated.js +6 -0
  79. package/dist/wcardinal/ui/shape/variant/e-shape-triangle-triangulated.js.map +1 -0
  80. package/dist/wcardinal/ui/shape/variant/e-shape-triangle.js +14 -1
  81. package/dist/wcardinal/ui/shape/variant/e-shape-triangle.js.map +1 -1
  82. package/dist/wcardinal/ui/shape/variant/hit-test-circle.js +54 -20
  83. package/dist/wcardinal/ui/shape/variant/hit-test-circle.js.map +1 -1
  84. package/dist/wcardinal/ui/shape/variant/hit-test-rectangle.js +82 -42
  85. package/dist/wcardinal/ui/shape/variant/hit-test-rectangle.js.map +1 -1
  86. package/dist/wcardinal/ui/shape/variant/hit-test-semicircle.js +2 -2
  87. package/dist/wcardinal/ui/shape/variant/hit-test-semicircle.js.map +1 -1
  88. package/dist/wcardinal/ui/shape/variant/hit-test-triangle.js +53 -12
  89. package/dist/wcardinal/ui/shape/variant/hit-test-triangle.js.map +1 -1
  90. package/dist/wcardinal/ui/shape/variant/index.js +7 -0
  91. package/dist/wcardinal/ui/shape/variant/index.js.map +1 -1
  92. package/dist/wcardinal-ui-theme-dark-en-us.js +1 -1
  93. package/dist/wcardinal-ui-theme-dark-en-us.min.js +1 -1
  94. package/dist/wcardinal-ui-theme-dark-ja-jp.js +1 -1
  95. package/dist/wcardinal-ui-theme-dark-ja-jp.min.js +1 -1
  96. package/dist/wcardinal-ui-theme-dark.js +1 -1
  97. package/dist/wcardinal-ui-theme-dark.min.js +1 -1
  98. package/dist/wcardinal-ui-theme-white-en-us.js +1 -1
  99. package/dist/wcardinal-ui-theme-white-en-us.min.js +1 -1
  100. package/dist/wcardinal-ui-theme-white-ja-jp.js +1 -1
  101. package/dist/wcardinal-ui-theme-white-ja-jp.min.js +1 -1
  102. package/dist/wcardinal-ui-theme-white.js +1 -1
  103. package/dist/wcardinal-ui-theme-white.min.js +1 -1
  104. package/dist/wcardinal-ui.cjs.js +803 -336
  105. package/dist/wcardinal-ui.js +803 -336
  106. package/dist/wcardinal-ui.min.js +2 -2
  107. package/dist/wcardinal-ui.min.js.map +1 -1
  108. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  /*!
2
- Winter Cardinal UI v0.466.0
2
+ Winter Cardinal UI v0.466.2-beta.0
3
3
  Copyright (C) 2019-2026 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -56,6 +56,7 @@
56
56
  POLYGON: 26,
57
57
  CIRCLE_LEGACY: 27,
58
58
  RECTANGLE_LEGACY: 28,
59
+ TRIANGLE_LEGACY: 29,
59
60
  EXTENSION: 1000
60
61
  };
61
62
 
@@ -4577,6 +4578,34 @@
4577
4578
  EShapeTransformImpl.prototype.getWorldId = function () {
4578
4579
  return this._worldID;
4579
4580
  };
4581
+ Object.defineProperty(EShapeTransformImpl.prototype, "cx", {
4582
+ get: function () {
4583
+ return this._cx;
4584
+ },
4585
+ enumerable: false,
4586
+ configurable: true
4587
+ });
4588
+ Object.defineProperty(EShapeTransformImpl.prototype, "sx", {
4589
+ get: function () {
4590
+ return this._sx;
4591
+ },
4592
+ enumerable: false,
4593
+ configurable: true
4594
+ });
4595
+ Object.defineProperty(EShapeTransformImpl.prototype, "cy", {
4596
+ get: function () {
4597
+ return this._cy;
4598
+ },
4599
+ enumerable: false,
4600
+ configurable: true
4601
+ });
4602
+ Object.defineProperty(EShapeTransformImpl.prototype, "sy", {
4603
+ get: function () {
4604
+ return this._sy;
4605
+ },
4606
+ enumerable: false,
4607
+ configurable: true
4608
+ });
4580
4609
  EShapeTransformImpl.prototype.updateTransform = function (parentTransform) {
4581
4610
  var oldLocalId = this._currentLocalID;
4582
4611
  var oldWorldId = this._worldID;
@@ -8444,92 +8473,129 @@
8444
8473
  * Copyright (C) 2019 Toshiba Corporation
8445
8474
  * SPDX-License-Identifier: Apache-2.0
8446
8475
  */
8447
- var hitTestCircle = function (shape, x, y, ax, ay, sw, ss) {
8476
+ var hitTestCircleLegacy = function (shape, x, y, ax, ay, sw, ss) {
8448
8477
  var fill = shape.fill;
8449
8478
  if (fill.enable) {
8479
+ return hitTestCircleFilled(x, y, ax, ay);
8480
+ }
8481
+ return hitTestCircleStroke(x, y, ax, ay, sw, ss);
8482
+ };
8483
+ var hitTestCircleFilled = function (x, y, ax, ay) {
8484
+ var x2 = x * x;
8485
+ var y2 = y * y;
8486
+ var ax2 = ax * ax;
8487
+ var ay2 = ay * ay;
8488
+ return x2 * ay2 + y2 * ax2 <= ax2 * ay2;
8489
+ };
8490
+ var hitTestCircleStroke = function (x, y, ax, ay, sw, ss) {
8491
+ if (0 < sw) {
8492
+ var s = sw * ss;
8450
8493
  var x2 = x * x;
8451
8494
  var y2 = y * y;
8452
- var ax2 = ax * ax;
8453
- var ay2 = ay * ay;
8454
- if (x2 * ay2 + y2 * ax2 <= ax2 * ay2) {
8455
- return true;
8495
+ var wx = Math.max(0.0, ax - s);
8496
+ var wy = Math.max(0.0, ay - s);
8497
+ var wx2 = wx * wx;
8498
+ var wy2 = wy * wy;
8499
+ if (wx2 * wy2 <= x2 * wy2 + y2 * wx2) {
8500
+ return hitTestCircleFilled(x, y, ax, ay);
8456
8501
  }
8457
8502
  }
8458
- else {
8459
- if (0 < sw) {
8460
- var s = sw * ss;
8461
- var x2 = x * x;
8462
- var y2 = y * y;
8463
- var wx = Math.max(0.0, ax - s);
8464
- var wy = Math.max(0.0, ay - s);
8465
- var wx2 = wx * wx;
8466
- var wy2 = wy * wy;
8467
- if (wx2 * wy2 <= x2 * wy2 + y2 * wx2) {
8468
- var ax2 = ax * ax;
8469
- var ay2 = ay * ay;
8470
- if (x2 * ay2 + y2 * ax2 <= ax2 * ay2) {
8503
+ return false;
8504
+ };
8505
+ var hitTestCircle = function (shape, x, y, ax, ay, sw, ss) {
8506
+ if (!hitTestCircleFilled(x, y, ax, ay)) {
8507
+ return false;
8508
+ }
8509
+ var fill = shape.fill;
8510
+ if (fill.enable) {
8511
+ var percent = Math.max(0, Math.min(1, fill.percent));
8512
+ if (1 <= percent) {
8513
+ return true;
8514
+ }
8515
+ switch (fill.direction) {
8516
+ case EShapeFillDirection.TOP:
8517
+ if (y + ay <= percent * (2 * ay)) {
8471
8518
  return true;
8472
8519
  }
8473
- }
8520
+ break;
8521
+ case EShapeFillDirection.RIGHT:
8522
+ if ((1 - percent) * (2 * ax) <= x + ax) {
8523
+ return true;
8524
+ }
8525
+ break;
8526
+ case EShapeFillDirection.BOTTOM:
8527
+ if ((1 - percent) * (2 * ay) <= y + ay) {
8528
+ return true;
8529
+ }
8530
+ break;
8531
+ case EShapeFillDirection.LEFT:
8532
+ if (x + ax <= percent * (2 * ax)) {
8533
+ return true;
8534
+ }
8535
+ break;
8474
8536
  }
8475
8537
  }
8476
- return false;
8538
+ return hitTestCircleStroke(x, y, ax, ay, sw, ss);
8477
8539
  };
8478
8540
 
8479
8541
  /*
8480
8542
  * Copyright (C) 2019 Toshiba Corporation
8481
8543
  * SPDX-License-Identifier: Apache-2.0
8482
8544
  */
8483
- var hitTestRectangle = function (shape, x, y, ax, ay, sw, ss) {
8545
+ var hitTestRectangleLegacy = function (shape, x, y, ax, ay, sw, ss) {
8484
8546
  if (hitTestBBox(x, y, ax, ay)) {
8485
8547
  var fill = shape.fill;
8486
8548
  if (fill.enable) {
8487
8549
  return true;
8488
8550
  }
8489
8551
  else {
8490
- var strokeSide = shape.stroke.side;
8491
- if (0 < sw && strokeSide !== EShapeStrokeSide.NONE) {
8492
- var s = sw * ss;
8493
- var wx = Math.max(0.0, ax - s);
8494
- var wy = Math.max(0.0, ay - s);
8495
- if (!hitTestBBox(x, y, wx, wy)) {
8496
- if (strokeSide === EShapeStrokeSide.ALL) {
8497
- return true;
8552
+ return hitTestRectangleStroke(shape, x, y, ax, ay, sw, ss);
8553
+ }
8554
+ }
8555
+ return false;
8556
+ };
8557
+ var hitTestRectangleStroke = function (shape, x, y, ax, ay, sw, ss) {
8558
+ var strokeSide = shape.stroke.side;
8559
+ if (0 < sw && strokeSide !== EShapeStrokeSide.NONE) {
8560
+ var s = sw * ss;
8561
+ var wx = Math.max(0.0, ax - s);
8562
+ var wy = Math.max(0.0, ay - s);
8563
+ if (!hitTestBBox(x, y, wx, wy)) {
8564
+ if (strokeSide === EShapeStrokeSide.ALL) {
8565
+ return true;
8566
+ }
8567
+ else {
8568
+ if (x <= -wx) {
8569
+ if (y <= -wy) {
8570
+ return !!(strokeSide & EShapeStrokeSide.TOP_OR_LEFT);
8571
+ }
8572
+ else if (+wy <= y) {
8573
+ return !!(strokeSide & EShapeStrokeSide.BOTTOM_OR_LEFT);
8498
8574
  }
8499
8575
  else {
8500
- if (x <= -wx) {
8501
- if (y <= -wy) {
8502
- return !!(strokeSide & EShapeStrokeSide.TOP_OR_LEFT);
8503
- }
8504
- else if (+wy <= y) {
8505
- return !!(strokeSide & EShapeStrokeSide.BOTTOM_OR_LEFT);
8506
- }
8507
- else {
8508
- return !!(strokeSide & EShapeStrokeSide.LEFT);
8509
- }
8510
- }
8511
- else if (+wx <= x) {
8512
- if (y <= -wy) {
8513
- return !!(strokeSide & EShapeStrokeSide.TOP_OR_RIGHT);
8514
- }
8515
- else if (+wy <= y) {
8516
- return !!(strokeSide & EShapeStrokeSide.BOTTOM_OR_RIGHT);
8517
- }
8518
- else {
8519
- return !!(strokeSide & EShapeStrokeSide.RIGHT);
8520
- }
8521
- }
8522
- else {
8523
- if (y <= -wy) {
8524
- return !!(strokeSide & EShapeStrokeSide.TOP);
8525
- }
8526
- else if (+wy <= y) {
8527
- return !!(strokeSide & EShapeStrokeSide.BOTTOM);
8528
- }
8529
- else {
8530
- return false;
8531
- }
8532
- }
8576
+ return !!(strokeSide & EShapeStrokeSide.LEFT);
8577
+ }
8578
+ }
8579
+ else if (+wx <= x) {
8580
+ if (y <= -wy) {
8581
+ return !!(strokeSide & EShapeStrokeSide.TOP_OR_RIGHT);
8582
+ }
8583
+ else if (+wy <= y) {
8584
+ return !!(strokeSide & EShapeStrokeSide.BOTTOM_OR_RIGHT);
8585
+ }
8586
+ else {
8587
+ return !!(strokeSide & EShapeStrokeSide.RIGHT);
8588
+ }
8589
+ }
8590
+ else {
8591
+ if (y <= -wy) {
8592
+ return !!(strokeSide & EShapeStrokeSide.TOP);
8593
+ }
8594
+ else if (+wy <= y) {
8595
+ return !!(strokeSide & EShapeStrokeSide.BOTTOM);
8596
+ }
8597
+ else {
8598
+ return false;
8533
8599
  }
8534
8600
  }
8535
8601
  }
@@ -8537,6 +8603,41 @@
8537
8603
  }
8538
8604
  return false;
8539
8605
  };
8606
+ var hitTestRectangle = function (shape, x, y, ax, ay, sw, ss) {
8607
+ if (!hitTestBBox(x, y, ax, ay)) {
8608
+ return false;
8609
+ }
8610
+ var fill = shape.fill;
8611
+ if (fill.enable) {
8612
+ var percent = Math.max(0, Math.min(1, fill.percent));
8613
+ if (1 <= percent) {
8614
+ return true;
8615
+ }
8616
+ switch (fill.direction) {
8617
+ case EShapeFillDirection.TOP:
8618
+ if (y + ay <= percent * (2 * ay)) {
8619
+ return true;
8620
+ }
8621
+ break;
8622
+ case EShapeFillDirection.RIGHT:
8623
+ if ((1 - percent) * (2 * ax) <= x + ax) {
8624
+ return true;
8625
+ }
8626
+ break;
8627
+ case EShapeFillDirection.BOTTOM:
8628
+ if ((1 - percent) * (2 * ay) <= y + ay) {
8629
+ return true;
8630
+ }
8631
+ break;
8632
+ case EShapeFillDirection.LEFT:
8633
+ if (x + ax <= percent * (2 * ax)) {
8634
+ return true;
8635
+ }
8636
+ break;
8637
+ }
8638
+ }
8639
+ return hitTestRectangleStroke(shape, x, y, ax, ay, sw, ss);
8640
+ };
8540
8641
 
8541
8642
  /*
8542
8643
  * Copyright (C) 2019 Toshiba Corporation
@@ -8549,7 +8650,7 @@
8549
8650
  // y = ay2;
8550
8651
  return +a * x + ay1 - y <= 0 && -a * x + ay1 - y <= 0 && y <= ay2;
8551
8652
  };
8552
- var hitTestTriangle = function (shape, x, y, ax, ay, sw, ss) {
8653
+ var hitTestTriangleLegacy = function (shape, x, y, ax, ay, sw, ss) {
8553
8654
  var a = (2 * ay) / ax;
8554
8655
  var fill = shape.fill;
8555
8656
  if (fill.enable) {
@@ -8558,22 +8659,62 @@
8558
8659
  }
8559
8660
  }
8560
8661
  else {
8561
- if (0 < sw) {
8562
- var s = sw * ss;
8563
- if (hitTestTriangleFilled(x, y, a, -ay, +ay)) {
8564
- var az = Math.sqrt(ax * ax + 4 * ay * ay);
8565
- var aw = (2 * ax * ay) / (ax + az);
8566
- var cy = ay - aw;
8567
- var ay1 = cy + ((-ay - cy) * Math.max(0.0, aw - s)) / aw;
8568
- var ay2 = ay - s;
8569
- if (!hitTestTriangleFilled(x, y, a, ay1, ay2)) {
8570
- return true;
8571
- }
8662
+ return hitTestTriangleStroke(x, y, a, ax, ay, sw, ss);
8663
+ }
8664
+ return false;
8665
+ };
8666
+ var hitTestTriangleStroke = function (x, y, a, ax, ay, sw, ss) {
8667
+ if (0 < sw) {
8668
+ var s = sw * ss;
8669
+ if (hitTestTriangleFilled(x, y, a, -ay, +ay)) {
8670
+ var az = Math.sqrt(ax * ax + 4 * ay * ay);
8671
+ var aw = (2 * ax * ay) / (ax + az);
8672
+ var cy = ay - aw;
8673
+ var ay1 = cy + ((-ay - cy) * Math.max(0.0, aw - s)) / aw;
8674
+ var ay2 = ay - s;
8675
+ if (!hitTestTriangleFilled(x, y, a, ay1, ay2)) {
8676
+ return true;
8572
8677
  }
8573
8678
  }
8574
8679
  }
8575
8680
  return false;
8576
8681
  };
8682
+ var hitTestTriangle = function (shape, x, y, ax, ay, sw, ss) {
8683
+ var a = (2 * ay) / ax;
8684
+ if (!hitTestTriangleFilled(x, y, a, -ay, +ay)) {
8685
+ return false;
8686
+ }
8687
+ var fill = shape.fill;
8688
+ if (fill.enable) {
8689
+ var percent = Math.max(0, Math.min(1, fill.percent));
8690
+ if (1 <= percent) {
8691
+ return true;
8692
+ }
8693
+ switch (fill.direction) {
8694
+ case EShapeFillDirection.TOP:
8695
+ if (y + ay <= percent * (2 * ay)) {
8696
+ return true;
8697
+ }
8698
+ break;
8699
+ case EShapeFillDirection.RIGHT:
8700
+ if ((1 - percent) * (2 * ax) <= x + ax) {
8701
+ return true;
8702
+ }
8703
+ break;
8704
+ case EShapeFillDirection.BOTTOM:
8705
+ if ((1 - percent) * (2 * ay) <= y + ay) {
8706
+ return true;
8707
+ }
8708
+ break;
8709
+ case EShapeFillDirection.LEFT:
8710
+ if (x + ax <= percent * (2 * ax)) {
8711
+ return true;
8712
+ }
8713
+ break;
8714
+ }
8715
+ }
8716
+ return hitTestTriangleStroke(x, y, a, ax, ay, sw, ss);
8717
+ };
8577
8718
 
8578
8719
  /*
8579
8720
  * Copyright (C) 2019 Toshiba Corporation
@@ -8650,11 +8791,11 @@
8650
8791
  sy += s;
8651
8792
  switch (type) {
8652
8793
  case EShapePointsMarkerType.CIRCLE:
8653
- return hitTestCircle(this, lx, ly, sx, sy, sw, ss);
8794
+ return hitTestCircleLegacy(this, lx, ly, sx, sy, sw, ss);
8654
8795
  case EShapePointsMarkerType.TRIANGLE:
8655
- return hitTestTriangle(this, lx, ly, sx, sy, sw, ss);
8796
+ return hitTestTriangleLegacy(this, lx, ly, sx, sy, sw, ss);
8656
8797
  case EShapePointsMarkerType.RECTANGLE:
8657
- return hitTestRectangle(this, lx, ly, sx, sy, sw, ss);
8798
+ return hitTestRectangleLegacy(this, lx, ly, sx, sy, sw, ss);
8658
8799
  }
8659
8800
  }
8660
8801
  return false;
@@ -11527,7 +11668,7 @@
11527
11668
  };
11528
11669
  EShapeCircleLegacy.prototype.containsAbs = function (x, y, ax, ay, sw, ss, sa) {
11529
11670
  if (_super.prototype.containsAbsBBox.call(this, x, y, ax, ay)) {
11530
- return hitTestCircle(this, x, y, ax, ay, sw, ss);
11671
+ return hitTestCircleLegacy(this, x, y, ax, ay, sw, ss);
11531
11672
  }
11532
11673
  return false;
11533
11674
  };
@@ -16710,7 +16851,7 @@
16710
16851
  * SPDX-License-Identifier: Apache-2.0
16711
16852
  */
16712
16853
  var VERTEX_SHADER$1 = "\nattribute highp vec2 aPosition;\nattribute highp vec2 aStepA;\nattribute highp vec4 aStepB;\nattribute highp vec3 aColor;\nattribute highp vec2 aUv;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform mediump float shapeScale;\nuniform mediump float antialiasWeight;\n\nvarying mediump float vType;\nvarying mediump vec2 vStepA;\nvarying mediump vec4 vStepB;\nvarying mediump vec4 vLength;\nvarying mediump vec4 vColorFill;\nvarying mediump vec4 vColorStroke;\nvarying mediump vec2 vUv;\n\nvec2 toInverse(in vec2 v) {\n\treturn vec2(-v.y, v.x);\n}\n\nvec4 toGeneral(in float v) {\n\tvec4 c = vec4(1.0, 1.0/64.0, 1.0/64.0/64.0, 1.0/64.0/64.0/64.0) * v;\n\tc -= fract(c);\n\tc -= c.yzwx * vec4(64.0, 64.0, 64.0, 0.0);\n\treturn c;\n}\n\nfloat toStrokeWidthScale(in float scale) {\n\treturn (\n\t\tscale == 3.0 || scale == 7.0 ?\n\t\tshapeScale : (\n\t\t\tscale == 1.0 || scale == 5.0 ?\n\t\t\tmin(1.0, shapeScale) : (\n\t\t\t\tscale == 2.0 || scale == 6.0 ?\n\t\t\t\tmax(1.0, shapeScale) : 1.0\n\t\t\t)\n\t\t)\n\t);\n}\n\nvec2 toUnpackedClippings(in float v) {\n\tvec2 c = vec2(1.0, 1.0/1024.0) * v;\n\tc -= fract(c);\n\tc -= c.yx * vec2(1024.0, 0.0);\n\tc /= vec2(930.0, 930.0);\n\treturn c;\n}\n\nvec2 toUnpackedAlphas(in float v) {\n\tvec2 c = vec2(1.0, 1.0/1024.0) * v;\n\tc -= fract(c);\n\tc -= c.yx * vec2(1024.0, 0.0);\n\tc /= vec2(1023.0, 1023.0);\n\treturn c;\n}\n\nvec3 toUnpackedF3x256(in float v) {\n\tvec3 c = vec3(1.0, 1.0/256.0, 1.0/256.0/256.0) * v;\n\tc -= fract(c);\n\tc -= c.yzx * vec3(256.0, 256.0, 0.0);\n\tc /= 255.0;\n\treturn c;\n}\n\nvec2 toPosition012(in vec2 v) {\n\treturn (projectionMatrix * translationMatrix * vec3(v, 1.0)).xy;\n}\n\nvec4 toStepB01(in vec4 sb) {\n\treturn vec4(sb.xy, toUnpackedClippings(sb.z));\n}\n\nvec4 toStepB2(in vec4 sb, in float strokeWidth) {\n\tfloat x = min(0.4, 0.4 / 12.0 * sb.x * antialiasWeight);\n\tfloat w = clamp(strokeWidth, 0.0, 1.0) * 0.4;\n\tfloat p = w * sb.y + sb.z;\n\tfloat y = 0.5 - p;\n\tfloat z = 0.5 - p - w;\n\treturn vec4(y, z, y - max(0.01, y - x), z - max(0.01, z - x));\n}\n\nvec2 toPosition3(in float type, in vec2 p, in float npacked, in float length, in float strokeWidth, out float shift) {\n\tvec3 t = vec3(1.0, 1.0/1024.0, 1.0/1024.0/1024.0) * npacked;\n\tt -= fract(t);\n\tt -= t.yzx * vec3(1024.0, 1024.0, 0.0);\n\tt *= vec3(1.0/511.5, 1.0/511.5, 1.0);\n\tt -= vec3(1.0, 1.0, 0.0);\n\tvec2 n0 = vec2(t.x, ((0.5 < t.z && t.z < 1.5) || 2.5 < t.z ? +1.0 : -1.0) * sqrt(max(0.0, 1.0 - t.x * t.x)));\n\tvec2 n1 = vec2(t.y, (1.5 < t.z ? +1.0 : -1.0) * sqrt(max(0.0, 1.0 - t.y * t.y)));\n\n\tvec2 n0i = toInverse(n0);\n\tvec2 n1i = toInverse(n1);\n\tfloat direction = sign(4.5 - type);\n\n\t// Offset\n\tfloat cross = dot(n0i, n1);\n\tbool bcross = 0.00001 < abs(cross);\n\tfloat crossi = (bcross ? 1.0 / cross : 0.0);\n\tfloat b = dot(n1 - n0, n0) * crossi;\n\tfloat offsetSize = direction * strokeWidth * 0.5;\n\tvec2 offset = n1 + n1i * b;\n\n\t// Miter\n\tvec2 pmiter = p + offsetSize * offset;\n\tfloat miterAngle0 = dot( n0i, offsetSize * offset - length * n0i );\n\tfloat miterAngle1 = dot( n1i, offsetSize * offset + length * n1i );\n\tfloat miterLength = dot( offset, offset );\n\tfloat miterSide = direction * cross;\n\n\t// Bevel\n\tvec2 n = (type == 4.0 || type == 6.0 ? n1 : n0);\n\tvec2 pbevel = p + offsetSize * n;\n\n\t//\n\tvec2 presult = (\n\t\t0.0 <= miterSide ?\n\t\t(miterAngle0 < 0.0 && 0.0 <= miterAngle1 && bcross ? pmiter : pbevel) :\n\t\t(miterLength < 6.0 && bcross ? pmiter : pbevel)\n\t);\n\tvec2 ni = (type == 4.0 || type == 6.0 ? n1i : n0i);\n\tshift = dot(ni, p - presult);\n\treturn toPosition012(presult);\n}\n\nvec2 toStepA3(in float type, in float strokeWidth) {\n\treturn vec2(type < 4.5 ? 1.0 : 0.0, strokeWidth);\n}\n\nfloat toDotWidth(in float strokeScaling, in float strokeWidthScale) {\n\treturn aStepA.x * (\n\t\tstrokeScaling == 4.0 || strokeScaling == 5.0 ||\n\t\tstrokeScaling == 6.0 || strokeScaling == 7.0 ?\n\t\tstrokeWidthScale : 1.0\n\t);\n}\n\nvec2 toDotPattern(in float dash) {\n\treturn (dash < 0.5 ?\n\t\tvec2(1.0, 0.0) :\n\t\t(dash < 3.5 ?\n\t\t\t(dash < 1.5 ?\n\t\t\t\tvec2(1.0, 1.0) :\n\t\t\t\t(2.5 < dash ?\n\t\t\t\t\tvec2(1.0, 2.0) :\n\t\t\t\t\tvec2(1.0, 0.5)\n\t\t\t\t)\n\t\t\t) :\n\t\t\t(dash < 4.5 ?\n\t\t\t\tvec2(2.0, 1.0) :\n\t\t\t\t(5.5 < dash ?\n\t\t\t\t\tvec2(2.0, 2.0) :\n\t\t\t\t\tvec2(2.0, 0.5)\n\t\t\t\t)\n\t\t\t)\n\t\t)\n\t);\n}\n\nvec4 toLength3(in float shift, in float dash, in float strokeScaling, in float strokeWidthScale) {\n\tfloat width = toDotWidth(strokeScaling, strokeWidthScale);\n\tvec2 pattern = toDotPattern(dash);\n\treturn vec4(aStepB.y + shift, pattern.x * width, pattern.y * width, aStepB.z);\n}\n\nvec4 toLength7(in float type, in float strokeScaling, in float strokeWidthScale) {\n\tfloat width = toDotWidth(strokeScaling, strokeWidthScale);\n\tvec2 pattern = toDotPattern(type - 7.0);\n\treturn vec4(aStepB.w, pattern.x * width, pattern.y * width, -1.0);\n}\n\nvoid toColors(in vec3 source, out vec4 fillColor, out vec4 strokeColor) {\n\tvec2 a = toUnpackedAlphas(source.z);\n\tfillColor.xyz = toUnpackedF3x256(source.x).zyx * a.x;\n\tfillColor.w = a.x;\n\tstrokeColor.xyz = toUnpackedF3x256(source.y).zyx * a.y;\n\tstrokeColor.w = a.y;\n}\n\nvoid main(void) {\n\tvec4 general = toGeneral(aStepA.y);\n\tfloat type = general.x;\n\tfloat strokeScaling = general.y;\n\tfloat strokeWidthScale = toStrokeWidthScale(strokeScaling);\n\tfloat strokeWidth = strokeWidthScale * aStepA.x;\n\n\tvType = type;\n\tif (type < 2.5 || 6.5 < type) {\n\t\tgl_Position = vec4(toPosition012(aPosition), 0.0, 1.0);\n\t\tvStepA = strokeWidth * general.zw;\n\t\tif (type < 1.5) {\n\t\t\tvStepB = toStepB01(aStepB);\n\t\t\tvLength = vec4(-1.0, 0.0, 0.0, -1.0);\n\t\t} else if (type < 2.5) {\n\t\t\tvStepB = toStepB2(aStepB, strokeWidth);\n\t\t\tvLength = vec4(-1.0, 0.0, 0.0, -1.0);\n\t\t} else {\n\t\t\tvStepB = toStepB01(aStepB);\n\t\t\tvLength = toLength7(type, strokeScaling, strokeWidthScale);\n\t\t}\n\t} else {\n\t\tfloat shift3 = 0.0;\n\t\tgl_Position = vec4(toPosition3(type, aPosition, aStepB.x, aStepB.w, strokeWidth, shift3), 0.0, 1.0);\n\t\tvStepA = toStepA3(type, strokeWidth);\n\t\tvStepB = vec4(0.0);\n\t\tvLength = toLength3(shift3, general.z, strokeScaling, strokeWidthScale);\n\t}\n\ttoColors(aColor, vColorFill, vColorStroke);\n\tvUv = aUv;\n}";
16713
- var FRAGMENT_SHADER$1 = "\nvarying mediump float vType;\nvarying mediump vec2 vStepA;\nvarying mediump vec4 vStepB;\nvarying mediump vec4 vLength;\nvarying mediump vec4 vColorFill;\nvarying mediump vec4 vColorStroke;\nvarying mediump vec2 vUv;\n\nuniform sampler2D sampler;\nuniform mediump float antialiasWeight;\n\nvec4 toColor0(in vec4 texture) {\n\tvec2 f = vec2(1.0) / vStepB.xy;\n\tvec2 c = vStepB.zw;\n\tvec2 awd = 0.5 * antialiasWeight * f;\n\tvec2 swd = vStepA * f;\n\tvec2 one = vec2(1.0);\n\tvec2 s0 = smoothstep(one - awd, one + awd, c);\n\tvec2 s1 = smoothstep(one - swd - awd, one - swd + awd, c);\n\tfloat s2 = max(s0.x, s0.y);\n\tfloat s3 = max(s1.x, s1.y);\n\n\treturn texture * (\n\t\tvColorStroke * (s3 - s2) +\n\t\tvColorFill * (1.0 - s3)\n\t);\n}\n\nvec4 toColor1(in vec4 texture) {\n\tvec2 d = vStepB.xy;\n\tvec2 c = vStepB.zw;\n\tvec2 awd = 0.5 * antialiasWeight / d;\n\tvec2 swd = vStepA / d;\n\tvec2 one = vec2(1.0);\n\tfloat s0 = smoothstep(length(c/(one + awd)), length(c/(one - awd)), 1.0);\n\tfloat s1 = smoothstep(length(c/(one - swd + awd)), length(c/(one - swd - awd)), 1.0);\n\treturn texture * (\n\t\tvColorStroke * (s0 - s1) +\n\t\tvColorFill * s1\n\t);\n}\n\nvec4 toColor2(in vec4 texture) {\n\tvec2 p0 = vStepB.xy;\n\tvec2 p1 = vStepB.zw;\n\tvec2 d = vec2(dot(texture, vec4(1.0, 1.0/255.0, 1.0/255.0/255.0, 0.0)));\n\tvec2 s = smoothstep(p0 - p1, p0 + p1, d);\n\treturn vColorStroke * (s.y - s.x) + vColorFill * s.x;\n}\n\nfloat toLineStep(in vec4 parameters) {\n\tfloat l = parameters.x;\n\tfloat lp0 = parameters.y;\n\tfloat lp1 = parameters.z;\n\tfloat lt = parameters.w;\n\tfloat ld = 0.5 * antialiasWeight;\n\tfloat lm = mod(l, lp0 + lp1);\n\tfloat s0 = (0.0 < lp1 ? smoothstep(-ld, ld, lm) - smoothstep(lp0 - ld, lp0 + ld, lm) : 1.0);\n\tfloat s1 = (0.0 <= lt ? smoothstep(-ld, ld, l) - smoothstep(lt - ld, lt + ld, l) : 1.0);\n\treturn s0 * s1;\n}\n\nvec4 toColor3(in vec4 texture) {\n\tfloat c = vStepA.x;\n\tfloat awd = 0.5 * antialiasWeight / vStepA.y;\n\tfloat s0 = smoothstep(-awd, awd, c);\n\tfloat s1 = smoothstep(1.0 - awd, 1.0 + awd, c);\n\treturn texture * vColorStroke * (s0 - s1) * toLineStep(vLength);\n}\n\nvec4 toColor7(in vec4 texture) {\n\tfloat aw = 0.5 * antialiasWeight;\n\tfloat awd = aw * vStepB.x;\n\tfloat swd = vStepA.x * vStepB.x;\n\tfloat s0 = smoothstep(1.0 - awd, 1.0 + awd, vStepB.z);\n\tfloat s1 = smoothstep(1.0 - swd - awd, 1.0 - swd + awd, vStepB.z) * toLineStep(vLength);\n\tfloat s2 = smoothstep(-aw, +aw, vStepB.y);\n\treturn texture * (\n\t\tvColorStroke * (s1 - s0) +\n\t\tvColorFill * (1.0 - s1) * s2\n\t);\n}\n\nvoid main(void) {\n\tvec4 texture = texture2D(sampler, vUv);\n\tif (vType < 0.5) {\n\t\tgl_FragColor = toColor0(texture);\n\t} else if (vType < 1.5) {\n\t\tgl_FragColor = toColor1(texture);\n\t} else if (vType < 2.5) {\n\t\tgl_FragColor = toColor2(texture);\n\t} else if (vType < 6.5) {\n\t\tgl_FragColor = toColor3(texture);\n\t} else {\n\t\tgl_FragColor = toColor7(texture);\n\t}\n}";
16854
+ var FRAGMENT_SHADER$1 = "\nvarying mediump float vType;\nvarying mediump vec2 vStepA;\nvarying mediump vec4 vStepB;\nvarying mediump vec4 vLength;\nvarying mediump vec4 vColorFill;\nvarying mediump vec4 vColorStroke;\nvarying mediump vec2 vUv;\n\nuniform sampler2D sampler;\nuniform mediump float antialiasWeight;\n\nvec4 toColor0(in vec4 texture) {\n\tvec2 f = vec2(1.0) / vStepB.xy;\n\tvec2 c = vStepB.zw;\n\tvec2 awd = 0.5 * antialiasWeight * f;\n\tvec2 swd = vStepA * f;\n\tvec2 one = vec2(1.0);\n\tvec2 s0 = smoothstep(one - awd, one + awd, c);\n\tvec2 s1 = smoothstep(one - swd - awd, one - swd + awd, c);\n\tfloat s2 = max(s0.x, s0.y);\n\tfloat s3 = max(s1.x, s1.y);\n\n\treturn texture * (\n\t\tvColorStroke * (s3 - s2) +\n\t\tvColorFill * (1.0 - s3)\n\t);\n}\n\nvec4 toColor1(in vec4 texture) {\n\tvec2 d = vStepB.xy;\n\tvec2 c = vStepB.zw;\n\tvec2 awd = 0.5 * antialiasWeight / d;\n\tvec2 swd = vStepA / d;\n\tvec2 one = vec2(1.0);\n\tvec2 zero = vec2(0.0);\n\tfloat s0 = smoothstep(length(c/clamp(one + awd, zero, one)), length(c/clamp(one - awd, zero, one)), 1.0);\n\tfloat s1 = smoothstep(length(c/clamp(one - swd + awd, zero, one)), length(c/clamp(one - swd - awd, zero, one)), 1.0);\n\treturn texture * (\n\t\tvColorStroke * (s0 - s1) +\n\t\tvColorFill * s1\n\t);\n}\n\nvec4 toColor2(in vec4 texture) {\n\tvec2 p0 = vStepB.xy;\n\tvec2 p1 = vStepB.zw;\n\tvec2 d = vec2(dot(texture, vec4(1.0, 1.0/255.0, 1.0/255.0/255.0, 0.0)));\n\tvec2 s = smoothstep(p0 - p1, p0 + p1, d);\n\treturn vColorStroke * (s.y - s.x) + vColorFill * s.x;\n}\n\nfloat toLineStep(in vec4 parameters) {\n\tfloat l = parameters.x;\n\tfloat lp0 = parameters.y;\n\tfloat lp1 = parameters.z;\n\tfloat lt = parameters.w;\n\tfloat ld = 0.5 * antialiasWeight;\n\tfloat lm = mod(l, lp0 + lp1);\n\tfloat s0 = (0.0 < lp1 ? smoothstep(-ld, ld, lm) - smoothstep(lp0 - ld, lp0 + ld, lm) : 1.0);\n\tfloat s1 = (0.0 <= lt ? smoothstep(-ld, ld, l) - smoothstep(lt - ld, lt + ld, l) : 1.0);\n\treturn s0 * s1;\n}\n\nvec4 toColor3(in vec4 texture) {\n\tfloat c = vStepA.x;\n\tfloat awd = 0.5 * antialiasWeight / vStepA.y;\n\tfloat s0 = smoothstep(-awd, awd, c);\n\tfloat s1 = smoothstep(1.0 - awd, 1.0 + awd, c);\n\treturn texture * vColorStroke * (s0 - s1) * toLineStep(vLength);\n}\n\nvec4 toColor7(in vec4 texture) {\n\tfloat aw = 0.5 * antialiasWeight;\n\tfloat awd = aw * vStepB.x;\n\tfloat swd = vStepA.x * vStepB.x;\n\tfloat s0 = smoothstep(1.0 - awd, 1.0 + awd, vStepB.z);\n\tfloat s1 = smoothstep(1.0 - swd - awd, 1.0 - swd + awd, vStepB.z) * toLineStep(vLength);\n\tfloat s2 = smoothstep(-aw, +aw, vStepB.y);\n\treturn texture * (\n\t\tvColorStroke * (s1 - s0) +\n\t\tvColorFill * (1.0 - s1) * s2\n\t);\n}\n\nvoid main(void) {\n\tvec4 texture = texture2D(sampler, vUv);\n\tif (vType < 0.5) {\n\t\tgl_FragColor = toColor0(texture);\n\t} else if (vType < 1.5) {\n\t\tgl_FragColor = toColor1(texture);\n\t} else if (vType < 2.5) {\n\t\tgl_FragColor = toColor2(texture);\n\t} else if (vType < 6.5) {\n\t\tgl_FragColor = toColor3(texture);\n\t} else {\n\t\tgl_FragColor = toColor7(texture);\n\t}\n}";
16714
16855
  var EShapeRenderer = /** @class */ (function (_super) {
16715
16856
  __extends(EShapeRenderer, _super);
16716
16857
  function EShapeRenderer(renderer) {
@@ -25485,7 +25626,7 @@
25485
25626
  };
25486
25627
  EShapeRectangleLegacy.prototype.containsAbs = function (x, y, ax, ay, sw, ss, sa) {
25487
25628
  if (_super.prototype.containsAbsBBox.call(this, x, y, ax, ay)) {
25488
- return hitTestRectangle(this, x, y, ax, ay, sw, ss);
25629
+ return hitTestRectangleLegacy(this, x, y, ax, ay, sw, ss);
25489
25630
  }
25490
25631
  return false;
25491
25632
  };
@@ -39197,9 +39338,7 @@
39197
39338
  var writtenPositionY = !!(runtime.written & EShapeRuntimeReset.POSITION_Y);
39198
39339
  var oldPositionX = writtenPositionX ? position.x : runtime.x;
39199
39340
  var oldPositionY = writtenPositionY ? position.y : runtime.y;
39200
- shape.updateTransform();
39201
- var localTransform = transform.localTransform;
39202
- position.set(oldPositionX - localTransform.c * amount, oldPositionY - localTransform.d * amount);
39341
+ position.set(oldPositionX - transform.cy * amount, oldPositionY - transform.sy * amount);
39203
39342
  runtime.written |= this.reset;
39204
39343
  }
39205
39344
  };
@@ -39224,9 +39363,7 @@
39224
39363
  var writtenPositionY = !!(runtime.written & EShapeRuntimeReset.POSITION_Y);
39225
39364
  var oldPositionX = writtenPositionX ? position.x : runtime.x;
39226
39365
  var oldPositionY = writtenPositionY ? position.y : runtime.y;
39227
- shape.updateTransform();
39228
- var localTransform = transform.localTransform;
39229
- position.set(oldPositionX + localTransform.a * amount, oldPositionY + localTransform.b * amount);
39366
+ position.set(oldPositionX + transform.cx * amount, oldPositionY + transform.sx * amount);
39230
39367
  runtime.written |= this.reset;
39231
39368
  }
39232
39369
  };
@@ -39412,16 +39549,14 @@
39412
39549
  EShapeActionRuntimeTransformResize.prototype.adjustPosition = function (shape, runtime, dsx, dsy, originX, originY) {
39413
39550
  var dx = (-0.5 + originX) * dsx;
39414
39551
  var dy = (-0.5 + originY) * dsy;
39415
- shape.updateTransform();
39416
39552
  var transform = shape.transform;
39417
39553
  var position = transform.position;
39418
- var localTransform = transform.localTransform;
39419
39554
  var writtenPositionX = !!(runtime.written & EShapeRuntimeReset.POSITION_X);
39420
39555
  var writtenPositionY = !!(runtime.written & EShapeRuntimeReset.POSITION_Y);
39421
39556
  var oldPositionX = writtenPositionX ? position.x : runtime.x;
39422
39557
  var oldPositionY = writtenPositionY ? position.y : runtime.y;
39423
39558
  runtime.written |= EShapeRuntimeReset.POSITION;
39424
- position.set(oldPositionX + dx * localTransform.a + dy * localTransform.c, oldPositionY + dx * localTransform.b + dy * localTransform.d);
39559
+ position.set(oldPositionX + dx * transform.cx + dy * transform.cy, oldPositionY + dx * transform.sx + dy * transform.sy);
39425
39560
  };
39426
39561
  return EShapeActionRuntimeTransformResize;
39427
39562
  }(EShapeActionRuntimeConditional));
@@ -44452,6 +44587,163 @@
44452
44587
  uvs[++iuv] = 0.5 * (y1 + y2);
44453
44588
  };
44454
44589
 
44590
+ var TRIANGLE_LEGACY_VERTEX_COUNT = 7;
44591
+ var TRIANGLE_LEGACY_INDEX_COUNT = 3;
44592
+ var TRIANGLE_LEGACY_WORLD_SIZE = [0, 0, 0];
44593
+ var buildTriangleLegacyIndex = function (indices, voffset, ioffset) {
44594
+ // Indices
44595
+ var ii = ioffset * 3 - 1;
44596
+ indices[++ii] = voffset + 0;
44597
+ indices[++ii] = voffset + 1;
44598
+ indices[++ii] = voffset + 2;
44599
+ indices[++ii] = voffset + 0;
44600
+ indices[++ii] = voffset + 3;
44601
+ indices[++ii] = voffset + 4;
44602
+ indices[++ii] = voffset + 0;
44603
+ indices[++ii] = voffset + 5;
44604
+ indices[++ii] = voffset + 6;
44605
+ };
44606
+ var buildTriangleLegacyVertex = function (vertices, voffset, originX, originY, sizeX, sizeY, strokeAlign, strokeWidth, internalTransform, worldSize) {
44607
+ var s = strokeAlign * strokeWidth;
44608
+ var sx = sizeX * 0.5 + (0 <= sizeX ? +s : -s);
44609
+ var sy = sizeY * 0.5 + (0 <= sizeY ? +s : -s);
44610
+ var ax = Math.abs(sx);
44611
+ var ay = Math.abs(sy);
44612
+ var az = Math.sqrt(ax * ax + 4 * ay * ay);
44613
+ var aw = (2 * ax * ay) / (ax + az);
44614
+ var sz = sy - (0 <= sy ? +aw : -aw);
44615
+ var a = internalTransform.a;
44616
+ var b = internalTransform.b;
44617
+ var c = internalTransform.c;
44618
+ var d = internalTransform.d;
44619
+ var tx = internalTransform.tx;
44620
+ var ty = internalTransform.ty;
44621
+ var x0 = a * originX + c * (originY - sy) + tx;
44622
+ var y0 = b * originX + d * (originY - sy) + ty;
44623
+ var ox = a * originX + c * originY + tx;
44624
+ var oy = b * originX + d * originY + ty;
44625
+ var rx = a * (originX + sx) + c * originY + tx;
44626
+ var ry = b * (originX + sx) + d * originY + ty;
44627
+ var dx = ox - x0;
44628
+ var dy = oy - y0;
44629
+ var x1 = rx + dx;
44630
+ var y1 = ry + dy;
44631
+ var x2 = ox + (ox - rx) + dx;
44632
+ var y2 = oy + (oy - ry) + dy;
44633
+ var x3 = a * originX + c * (originY + sz) + tx;
44634
+ var y3 = b * originX + d * (originY + sz) + ty;
44635
+ // World size
44636
+ var xb = ox + dx;
44637
+ var yb = oy + dy;
44638
+ worldSize[0] = toLength(xb, yb, x3, y3);
44639
+ worldSize[1] = toLength(x1, y1, xb, yb);
44640
+ worldSize[2] = toLength(x0, y0, ox, oy);
44641
+ // Vertices
44642
+ var iv = (voffset << 1) - 1;
44643
+ vertices[++iv] = x3;
44644
+ vertices[++iv] = y3;
44645
+ vertices[++iv] = x0;
44646
+ vertices[++iv] = y0;
44647
+ vertices[++iv] = x1;
44648
+ vertices[++iv] = y1;
44649
+ vertices[++iv] = x1;
44650
+ vertices[++iv] = y1;
44651
+ vertices[++iv] = x2;
44652
+ vertices[++iv] = y2;
44653
+ vertices[++iv] = x2;
44654
+ vertices[++iv] = y2;
44655
+ vertices[++iv] = x0;
44656
+ vertices[++iv] = y0;
44657
+ };
44658
+ var buildTriangleLegacyStep = function (steps, voffset, strokeWidth, strokeStyle, worldSize) {
44659
+ var scaleInvariant = toScaleInvariant(strokeStyle);
44660
+ var s = worldSize[0];
44661
+ var e = toPackedI4x64(0, scaleInvariant, 1, 1);
44662
+ var c00 = toPackedClippings(0, 0);
44663
+ var c10 = toPackedClippings(1, 0);
44664
+ var c01 = toPackedClippings(0, 1);
44665
+ // 000
44666
+ var is = voffset * 6 - 1;
44667
+ steps[++is] = strokeWidth;
44668
+ steps[++is] = e;
44669
+ steps[++is] = s;
44670
+ steps[++is] = s;
44671
+ steps[++is] = c00;
44672
+ steps[++is] = 0;
44673
+ // 100
44674
+ steps[++is] = strokeWidth;
44675
+ steps[++is] = e;
44676
+ steps[++is] = s;
44677
+ steps[++is] = s;
44678
+ steps[++is] = c10;
44679
+ steps[++is] = 0;
44680
+ // 100
44681
+ steps[++is] = strokeWidth;
44682
+ steps[++is] = e;
44683
+ steps[++is] = s;
44684
+ steps[++is] = s;
44685
+ steps[++is] = c10;
44686
+ steps[++is] = 0;
44687
+ // 010
44688
+ steps[++is] = strokeWidth;
44689
+ steps[++is] = e;
44690
+ steps[++is] = s;
44691
+ steps[++is] = s;
44692
+ steps[++is] = c01;
44693
+ steps[++is] = 0;
44694
+ // 010
44695
+ steps[++is] = strokeWidth;
44696
+ steps[++is] = e;
44697
+ steps[++is] = s;
44698
+ steps[++is] = s;
44699
+ steps[++is] = c01;
44700
+ steps[++is] = 0;
44701
+ // 100
44702
+ steps[++is] = strokeWidth;
44703
+ steps[++is] = e;
44704
+ steps[++is] = s;
44705
+ steps[++is] = s;
44706
+ steps[++is] = c10;
44707
+ steps[++is] = 0;
44708
+ // 100
44709
+ steps[++is] = strokeWidth;
44710
+ steps[++is] = e;
44711
+ steps[++is] = s;
44712
+ steps[++is] = s;
44713
+ steps[++is] = c10;
44714
+ steps[++is] = 0;
44715
+ };
44716
+ var buildTriangleLegacyUv = function (uvs, textureUvs, voffset, worldSize) {
44717
+ var x0 = textureUvs.x0;
44718
+ var x1 = textureUvs.x1;
44719
+ var x2 = textureUvs.x2;
44720
+ var x3 = textureUvs.x3;
44721
+ var y0 = textureUvs.y0;
44722
+ var y1 = textureUvs.y1;
44723
+ var y2 = textureUvs.y2;
44724
+ var y3 = textureUvs.y3;
44725
+ var x4 = 0.5 * (x0 + x1);
44726
+ var y4 = 0.5 * (y0 + y1);
44727
+ var c = 1 - (0.5 * worldSize[0]) / worldSize[2];
44728
+ var x5 = x4 + c * (x3 - x0);
44729
+ var y5 = y4 + c * (y3 - y0);
44730
+ var iuv = (voffset << 1) - 1;
44731
+ uvs[++iuv] = x5;
44732
+ uvs[++iuv] = y5;
44733
+ uvs[++iuv] = x4;
44734
+ uvs[++iuv] = y4;
44735
+ uvs[++iuv] = x2;
44736
+ uvs[++iuv] = y2;
44737
+ uvs[++iuv] = x2;
44738
+ uvs[++iuv] = y2;
44739
+ uvs[++iuv] = x3;
44740
+ uvs[++iuv] = y3;
44741
+ uvs[++iuv] = x3;
44742
+ uvs[++iuv] = y3;
44743
+ uvs[++iuv] = x4;
44744
+ uvs[++iuv] = y4;
44745
+ };
44746
+
44455
44747
  var TRIANGLE_ROUNDED_VERTEX_COUNT = 22;
44456
44748
  var TRIANGLE_ROUNDED_INDEX_COUNT = 15;
44457
44749
  var TRIANGLE_ROUNDED_WORLD_SIZE = [
@@ -44984,162 +45276,6 @@
44984
45276
  uvs[++iuv] = y6;
44985
45277
  };
44986
45278
 
44987
- var TRIANGLE_VERTEX_COUNT = 7;
44988
- var TRIANGLE_INDEX_COUNT = 3;
44989
- var TRIANGLE_WORLD_SIZE = [0, 0, 0];
44990
- var TRIANGLE_WORK_POINT = new pixi_js.Point();
44991
- var buildTriangleIndex = function (indices, voffset, ioffset) {
44992
- // Indices
44993
- var ii = ioffset * 3 - 1;
44994
- indices[++ii] = voffset + 0;
44995
- indices[++ii] = voffset + 1;
44996
- indices[++ii] = voffset + 2;
44997
- indices[++ii] = voffset + 0;
44998
- indices[++ii] = voffset + 3;
44999
- indices[++ii] = voffset + 4;
45000
- indices[++ii] = voffset + 0;
45001
- indices[++ii] = voffset + 5;
45002
- indices[++ii] = voffset + 6;
45003
- };
45004
- var buildTriangleVertex = function (vertices, voffset, originX, originY, sizeX, sizeY, strokeAlign, strokeWidth, internalTransform, worldSize) {
45005
- var s = strokeAlign * strokeWidth;
45006
- var sx = sizeX * 0.5 + (0 <= sizeX ? +s : -s);
45007
- var sy = sizeY * 0.5 + (0 <= sizeY ? +s : -s);
45008
- var sz = Math.sqrt(sx * sx + 4 * sy * sy);
45009
- var sw = (2 * sx * sy) / (sx + sz);
45010
- var work = TRIANGLE_WORK_POINT;
45011
- work.set(originX, originY - sy);
45012
- internalTransform.apply(work, work);
45013
- var x0 = work.x;
45014
- var y0 = work.y;
45015
- work.set(originX, originY);
45016
- internalTransform.apply(work, work);
45017
- var tx = work.x;
45018
- var ty = work.y;
45019
- work.set(originX + sx, originY);
45020
- internalTransform.apply(work, work);
45021
- var dx = tx - x0;
45022
- var dy = ty - y0;
45023
- var x1 = work.x + dx;
45024
- var y1 = work.y + dy;
45025
- var x2 = tx + (tx - work.x) + dx;
45026
- var y2 = ty + (ty - work.y) + dy;
45027
- work.set(originX, originY + sy - sw); // Incenter of a triangle
45028
- internalTransform.apply(work, work);
45029
- var x3 = work.x;
45030
- var y3 = work.y;
45031
- // World size
45032
- var xb = tx + dx;
45033
- var yb = ty + dy;
45034
- worldSize[0] = toLength(xb, yb, x3, y3);
45035
- worldSize[1] = toLength(x1, y1, xb, yb);
45036
- worldSize[2] = toLength(x0, y0, tx, ty);
45037
- // Vertices
45038
- var iv = (voffset << 1) - 1;
45039
- vertices[++iv] = x3;
45040
- vertices[++iv] = y3;
45041
- vertices[++iv] = x0;
45042
- vertices[++iv] = y0;
45043
- vertices[++iv] = x1;
45044
- vertices[++iv] = y1;
45045
- vertices[++iv] = x1;
45046
- vertices[++iv] = y1;
45047
- vertices[++iv] = x2;
45048
- vertices[++iv] = y2;
45049
- vertices[++iv] = x2;
45050
- vertices[++iv] = y2;
45051
- vertices[++iv] = x0;
45052
- vertices[++iv] = y0;
45053
- };
45054
- var buildTriangleStep = function (steps, voffset, strokeWidth, strokeStyle, worldSize) {
45055
- var scaleInvariant = toScaleInvariant(strokeStyle);
45056
- var s = worldSize[0];
45057
- var e = toPackedI4x64(0, scaleInvariant, 1, 1);
45058
- var c00 = toPackedClippings(0, 0);
45059
- var c10 = toPackedClippings(1, 0);
45060
- var c01 = toPackedClippings(0, 1);
45061
- // 000
45062
- var is = voffset * 6 - 1;
45063
- steps[++is] = strokeWidth;
45064
- steps[++is] = e;
45065
- steps[++is] = s;
45066
- steps[++is] = s;
45067
- steps[++is] = c00;
45068
- steps[++is] = 0;
45069
- // 100
45070
- steps[++is] = strokeWidth;
45071
- steps[++is] = e;
45072
- steps[++is] = s;
45073
- steps[++is] = s;
45074
- steps[++is] = c10;
45075
- steps[++is] = 0;
45076
- // 100
45077
- steps[++is] = strokeWidth;
45078
- steps[++is] = e;
45079
- steps[++is] = s;
45080
- steps[++is] = s;
45081
- steps[++is] = c10;
45082
- steps[++is] = 0;
45083
- // 010
45084
- steps[++is] = strokeWidth;
45085
- steps[++is] = e;
45086
- steps[++is] = s;
45087
- steps[++is] = s;
45088
- steps[++is] = c01;
45089
- steps[++is] = 0;
45090
- // 010
45091
- steps[++is] = strokeWidth;
45092
- steps[++is] = e;
45093
- steps[++is] = s;
45094
- steps[++is] = s;
45095
- steps[++is] = c01;
45096
- steps[++is] = 0;
45097
- // 100
45098
- steps[++is] = strokeWidth;
45099
- steps[++is] = e;
45100
- steps[++is] = s;
45101
- steps[++is] = s;
45102
- steps[++is] = c10;
45103
- steps[++is] = 0;
45104
- // 100
45105
- steps[++is] = strokeWidth;
45106
- steps[++is] = e;
45107
- steps[++is] = s;
45108
- steps[++is] = s;
45109
- steps[++is] = c10;
45110
- steps[++is] = 0;
45111
- };
45112
- var buildTriangleUv = function (uvs, textureUvs, voffset, worldSize) {
45113
- var x0 = textureUvs.x0;
45114
- var x1 = textureUvs.x1;
45115
- var x2 = textureUvs.x2;
45116
- var x3 = textureUvs.x3;
45117
- var y0 = textureUvs.y0;
45118
- var y1 = textureUvs.y1;
45119
- var y2 = textureUvs.y2;
45120
- var y3 = textureUvs.y3;
45121
- var x4 = 0.5 * (x0 + x1);
45122
- var y4 = 0.5 * (y0 + y1);
45123
- var c = 1 - (0.5 * worldSize[0]) / worldSize[2];
45124
- var x5 = x4 + c * (x3 - x0);
45125
- var y5 = y4 + c * (y3 - y0);
45126
- var iuv = (voffset << 1) - 1;
45127
- uvs[++iuv] = x5;
45128
- uvs[++iuv] = y5;
45129
- uvs[++iuv] = x4;
45130
- uvs[++iuv] = y4;
45131
- uvs[++iuv] = x2;
45132
- uvs[++iuv] = y2;
45133
- uvs[++iuv] = x2;
45134
- uvs[++iuv] = y2;
45135
- uvs[++iuv] = x3;
45136
- uvs[++iuv] = y3;
45137
- uvs[++iuv] = x3;
45138
- uvs[++iuv] = y3;
45139
- uvs[++iuv] = x4;
45140
- uvs[++iuv] = y4;
45141
- };
45142
-
45143
45279
  /*
45144
45280
  * Copyright (C) 2019 Toshiba Corporation
45145
45281
  * SPDX-License-Identifier: Apache-2.0
@@ -46677,8 +46813,8 @@
46677
46813
  var ioffset = this.indexOffset;
46678
46814
  var pointCountReserved = this.pointCountReserved;
46679
46815
  if (0 < pointCountReserved) {
46680
- buildTriangleIndex(indices, voffset, ioffset);
46681
- copyIndex(indices, TRIANGLE_VERTEX_COUNT, ioffset, TRIANGLE_INDEX_COUNT, pointCountReserved);
46816
+ buildTriangleLegacyIndex(indices, voffset, ioffset);
46817
+ copyIndex(indices, TRIANGLE_LEGACY_VERTEX_COUNT, ioffset, TRIANGLE_LEGACY_INDEX_COUNT, pointCountReserved);
46682
46818
  }
46683
46819
  this.inited |= BuilderFlag.INDEX;
46684
46820
  };
@@ -46687,7 +46823,7 @@
46687
46823
  if (points instanceof EShapeLineOfAnyPointsImpl) {
46688
46824
  var buffer = this.buffer;
46689
46825
  this.updateVertexStepAndUvs(buffer, shape, points);
46690
- this.updateLineOfAnyColor(buffer, shape, points, TRIANGLE_VERTEX_COUNT);
46826
+ this.updateLineOfAnyColor(buffer, shape, points, TRIANGLE_LEGACY_VERTEX_COUNT);
46691
46827
  }
46692
46828
  };
46693
46829
  BuilderLineOfTriangles.prototype.updateVertexStepAndUvs = function (buffer, shape, points) {
@@ -46750,15 +46886,15 @@
46750
46886
  if (0 < pointCount && pointSize.isStaticX() && pointSize.isStaticY()) {
46751
46887
  var pointSizeX = pointSize.getX(0);
46752
46888
  var pointSizeY = pointSize.getY(0);
46753
- buildTriangleVertex(vertices, voffset, 0, 0, pointSizeX, pointSizeY, strokeAlign, strokeWidth, internalTransform, TRIANGLE_WORLD_SIZE);
46754
- copyVertex(vertices, internalTransform, voffset, TRIANGLE_VERTEX_COUNT, pointCount, pointsValues, pointOffset);
46889
+ buildTriangleLegacyVertex(vertices, voffset, 0, 0, pointSizeX, pointSizeY, strokeAlign, strokeWidth, internalTransform, TRIANGLE_LEGACY_WORLD_SIZE);
46890
+ copyVertex(vertices, internalTransform, voffset, TRIANGLE_LEGACY_VERTEX_COUNT, pointCount, pointsValues, pointOffset);
46755
46891
  if (isNotInited || isVertexChanged || isTransformChanged) {
46756
- buildTriangleStep(steps, voffset, strokeWidth, strokeStyle, TRIANGLE_WORLD_SIZE);
46757
- copyStep(steps, voffset, TRIANGLE_VERTEX_COUNT, pointCount);
46892
+ buildTriangleLegacyStep(steps, voffset, strokeWidth, strokeStyle, TRIANGLE_LEGACY_WORLD_SIZE);
46893
+ copyStep(steps, voffset, TRIANGLE_LEGACY_VERTEX_COUNT, pointCount);
46758
46894
  }
46759
46895
  if (isNotInited || isVertexChanged || isTextureChanged) {
46760
- buildTriangleUv(uvs, textureUvs, voffset, TRIANGLE_WORLD_SIZE);
46761
- copyUvs(uvs, voffset, TRIANGLE_VERTEX_COUNT, pointCount);
46896
+ buildTriangleLegacyUv(uvs, textureUvs, voffset, TRIANGLE_LEGACY_WORLD_SIZE);
46897
+ copyUvs(uvs, voffset, TRIANGLE_LEGACY_VERTEX_COUNT, pointCount);
46762
46898
  }
46763
46899
  }
46764
46900
  else {
@@ -46768,20 +46904,20 @@
46768
46904
  var py = pointsValues[ip + 1] + pointOffset.getY(i);
46769
46905
  var pointSizeX = pointSize.getX(i);
46770
46906
  var pointSizeY = pointSize.getY(i);
46771
- var iv = voffset + i * TRIANGLE_VERTEX_COUNT;
46772
- buildTriangleVertex(vertices, iv, px, py, pointSizeX, pointSizeY, strokeAlign, strokeWidth, internalTransform, TRIANGLE_WORLD_SIZE);
46907
+ var iv = voffset + i * TRIANGLE_LEGACY_VERTEX_COUNT;
46908
+ buildTriangleLegacyVertex(vertices, iv, px, py, pointSizeX, pointSizeY, strokeAlign, strokeWidth, internalTransform, TRIANGLE_LEGACY_WORLD_SIZE);
46773
46909
  if (isNotInited || isVertexChanged || isTransformChanged) {
46774
- buildTriangleStep(steps, iv, strokeWidth, strokeStyle, TRIANGLE_WORLD_SIZE);
46910
+ buildTriangleLegacyStep(steps, iv, strokeWidth, strokeStyle, TRIANGLE_LEGACY_WORLD_SIZE);
46775
46911
  }
46776
46912
  if (isNotInited || isVertexChanged || isTextureChanged) {
46777
- buildTriangleUv(uvs, textureUvs, iv, TRIANGLE_WORLD_SIZE);
46913
+ buildTriangleLegacyUv(uvs, textureUvs, iv, TRIANGLE_LEGACY_WORLD_SIZE);
46778
46914
  }
46779
46915
  }
46780
46916
  }
46781
46917
  // Fill the rest
46782
46918
  var pointCountReserved = this.pointCountReserved;
46783
- var voffsetReserved = voffset + pointCount * TRIANGLE_VERTEX_COUNT;
46784
- var vcountReserved = TRIANGLE_VERTEX_COUNT * (pointCountReserved - pointCount);
46919
+ var voffsetReserved = voffset + pointCount * TRIANGLE_LEGACY_VERTEX_COUNT;
46920
+ var vcountReserved = TRIANGLE_LEGACY_VERTEX_COUNT * (pointCountReserved - pointCount);
46785
46921
  buildNullVertex(vertices, voffsetReserved, vcountReserved);
46786
46922
  buildNullStep(steps, voffsetReserved, vcountReserved);
46787
46923
  buildNullUv(uvs, voffsetReserved, vcountReserved);
@@ -47187,14 +47323,14 @@
47187
47323
  var BuilderMarkerTriangle = /** @class */ (function (_super) {
47188
47324
  __extends(BuilderMarkerTriangle, _super);
47189
47325
  function BuilderMarkerTriangle(buffer, vertexOffset, indexOffset) {
47190
- var _this = _super.call(this, buffer, vertexOffset, indexOffset, TRIANGLE_VERTEX_COUNT, TRIANGLE_INDEX_COUNT) || this;
47326
+ var _this = _super.call(this, buffer, vertexOffset, indexOffset, TRIANGLE_LEGACY_VERTEX_COUNT, TRIANGLE_LEGACY_INDEX_COUNT) || this;
47191
47327
  _this.pointId = -1;
47192
47328
  return _this;
47193
47329
  }
47194
47330
  BuilderMarkerTriangle.prototype.init = function () {
47195
47331
  var buffer = this.buffer;
47196
47332
  buffer.updateIndices();
47197
- buildTriangleIndex(buffer.indices, this.vertexOffset, this.indexOffset);
47333
+ buildTriangleLegacyIndex(buffer.indices, this.vertexOffset, this.indexOffset);
47198
47334
  this.inited |= BuilderFlag.INDEX;
47199
47335
  };
47200
47336
  BuilderMarkerTriangle.prototype.update = function (shape) {
@@ -47252,14 +47388,14 @@
47252
47388
  var internalTransform = ((_a = BuilderMarkerTriangle.WORK) !== null && _a !== void 0 ? _a : (BuilderMarkerTriangle.WORK = new pixi_js.Matrix()));
47253
47389
  internalTransform.copyFrom(marker.transform).prepend(shape.transform.internalTransform);
47254
47390
  buffer.updateVertices();
47255
- buildTriangleVertex(buffer.vertices, voffset, 0, 0, sizeX, sizeY, strokeAlign, strokeWidth, internalTransform, TRIANGLE_WORLD_SIZE);
47391
+ buildTriangleLegacyVertex(buffer.vertices, voffset, 0, 0, sizeX, sizeY, strokeAlign, strokeWidth, internalTransform, TRIANGLE_LEGACY_WORLD_SIZE);
47256
47392
  if (isNotInited || isVertexChanged || isTransformChanged) {
47257
47393
  buffer.updateSteps();
47258
- buildTriangleStep(buffer.steps, voffset, strokeWidth, strokeStyle, TRIANGLE_WORLD_SIZE);
47394
+ buildTriangleLegacyStep(buffer.steps, voffset, strokeWidth, strokeStyle, TRIANGLE_LEGACY_WORLD_SIZE);
47259
47395
  }
47260
47396
  if (isNotInited || isVertexChanged || isTextureChanged) {
47261
47397
  buffer.updateUvs();
47262
- buildTriangleUv(buffer.uvs, toTextureUvs(texture), voffset, TRIANGLE_WORLD_SIZE);
47398
+ buildTriangleLegacyUv(buffer.uvs, toTextureUvs(texture), voffset, TRIANGLE_LEGACY_WORLD_SIZE);
47263
47399
  }
47264
47400
  }
47265
47401
  };
@@ -47552,32 +47688,27 @@
47552
47688
  * Copyright (C) 2019 Toshiba Corporation
47553
47689
  * SPDX-License-Identifier: Apache-2.0
47554
47690
  */
47555
- var BuilderTriangleRounded = /** @class */ (function (_super) {
47556
- __extends(BuilderTriangleRounded, _super);
47557
- function BuilderTriangleRounded(buffer, vertexOffset, indexOffset) {
47558
- var _this = _super.call(this, buffer, vertexOffset, indexOffset, TRIANGLE_ROUNDED_VERTEX_COUNT, TRIANGLE_ROUNDED_INDEX_COUNT) || this;
47559
- _this.radius = 0;
47560
- _this.corner = 0;
47561
- return _this;
47691
+ var BuilderTriangleLegacy = /** @class */ (function (_super) {
47692
+ __extends(BuilderTriangleLegacy, _super);
47693
+ function BuilderTriangleLegacy(buffer, vertexOffset, indexOffset) {
47694
+ return _super.call(this, buffer, vertexOffset, indexOffset, TRIANGLE_LEGACY_VERTEX_COUNT, TRIANGLE_LEGACY_INDEX_COUNT) || this;
47562
47695
  }
47563
- BuilderTriangleRounded.prototype.init = function () {
47696
+ BuilderTriangleLegacy.prototype.init = function () {
47564
47697
  var buffer = this.buffer;
47565
47698
  buffer.updateIndices();
47566
- buildTriangleRoundedIndex(buffer.indices, this.vertexOffset, this.indexOffset);
47699
+ buildTriangleLegacyIndex(buffer.indices, this.vertexOffset, this.indexOffset);
47567
47700
  this.inited |= BuilderFlag.INDEX;
47568
47701
  };
47569
- BuilderTriangleRounded.prototype.update = function (shape) {
47702
+ BuilderTriangleLegacy.prototype.update = function (shape) {
47570
47703
  var buffer = this.buffer;
47571
47704
  this.updateVertexStepAndUv(buffer, shape);
47572
47705
  this.updateColor(buffer, shape);
47573
47706
  };
47574
- BuilderTriangleRounded.prototype.updateVertexStepAndUv = function (buffer, shape) {
47707
+ BuilderTriangleLegacy.prototype.updateVertexStepAndUv = function (buffer, shape) {
47575
47708
  var size = shape.size;
47576
47709
  var sizeX = size.x;
47577
47710
  var sizeY = size.y;
47578
47711
  var isSizeChanged = sizeX !== this.sizeX || sizeY !== this.sizeY;
47579
- var radius = shape.radius;
47580
- var isRadiusChanged = radius !== this.radius;
47581
47712
  var transformLocalId = toTransformLocalId(shape);
47582
47713
  var isTransformChanged = this.transformLocalId !== transformLocalId;
47583
47714
  var stroke = shape.stroke;
@@ -47587,70 +47718,67 @@
47587
47718
  var isStrokeChanged = this.strokeAlign !== strokeAlign ||
47588
47719
  this.strokeWidth !== strokeWidth ||
47589
47720
  this.strokeStyle !== strokeStyle;
47590
- var corner = shape.corner;
47591
- var isCornerChanged = corner !== this.corner;
47592
47721
  var texture = toTexture(shape);
47593
47722
  var textureTransformId = toTextureTransformId(texture);
47594
47723
  var isTextureChanged = texture !== this.texture || textureTransformId !== this.textureTransformId;
47595
- var isVertexChanged = isSizeChanged || isRadiusChanged || isStrokeChanged;
47724
+ var isVertexChanged = isSizeChanged || isStrokeChanged;
47596
47725
  var isNotInited = !(this.inited & BuilderFlag.VERTEX_STEP_AND_UV);
47597
- if (isNotInited ||
47598
- isVertexChanged ||
47599
- isTransformChanged ||
47600
- isCornerChanged ||
47601
- isTextureChanged) {
47726
+ if (isNotInited || isVertexChanged || isTransformChanged || isTextureChanged) {
47602
47727
  this.inited |= BuilderFlag.VERTEX_STEP_AND_UV;
47603
47728
  this.sizeX = sizeX;
47604
47729
  this.sizeY = sizeY;
47605
- this.radius = radius;
47606
47730
  this.transformLocalId = transformLocalId;
47607
47731
  this.strokeAlign = strokeAlign;
47608
47732
  this.strokeWidth = strokeWidth;
47609
47733
  this.strokeStyle = strokeStyle;
47610
- this.corner = corner;
47611
47734
  this.texture = texture;
47612
47735
  this.textureTransformId = textureTransformId;
47613
47736
  var voffset = this.vertexOffset;
47614
47737
  buffer.updateVertices();
47615
- buildTriangleRoundedVertex(buffer.vertices, voffset, 0, 0, sizeX, sizeY, strokeAlign, strokeWidth, radius, shape.transform.internalTransform, TRIANGLE_ROUNDED_WORLD_SIZE);
47616
- if (isNotInited || isVertexChanged || isTransformChanged || isCornerChanged) {
47738
+ buildTriangleLegacyVertex(buffer.vertices, voffset, 0, 0, sizeX, sizeY, strokeAlign, strokeWidth, shape.transform.internalTransform, TRIANGLE_LEGACY_WORLD_SIZE);
47739
+ if (isNotInited || isVertexChanged || isTransformChanged) {
47617
47740
  buffer.updateSteps();
47618
- buildTriangleRoundedStep(buffer.steps, voffset, strokeWidth, strokeStyle, corner, radius, TRIANGLE_ROUNDED_WORLD_SIZE);
47741
+ buildTriangleLegacyStep(buffer.steps, voffset, strokeWidth, strokeStyle, TRIANGLE_LEGACY_WORLD_SIZE);
47619
47742
  }
47620
47743
  if (isNotInited || isVertexChanged || isTextureChanged) {
47621
47744
  buffer.updateUvs();
47622
- buildTriangleRoundedUv(buffer.uvs, voffset, toTextureUvs(texture), radius, TRIANGLE_ROUNDED_WORLD_SIZE);
47745
+ buildTriangleLegacyUv(buffer.uvs, toTextureUvs(texture), voffset, TRIANGLE_LEGACY_WORLD_SIZE);
47623
47746
  }
47624
47747
  }
47625
47748
  };
47626
- return BuilderTriangleRounded;
47749
+ return BuilderTriangleLegacy;
47627
47750
  }(BuilderBase));
47628
47751
 
47629
47752
  /*
47630
47753
  * Copyright (C) 2019 Toshiba Corporation
47631
47754
  * SPDX-License-Identifier: Apache-2.0
47632
47755
  */
47633
- var BuilderTriangle = /** @class */ (function (_super) {
47634
- __extends(BuilderTriangle, _super);
47635
- function BuilderTriangle(buffer, vertexOffset, indexOffset) {
47636
- return _super.call(this, buffer, vertexOffset, indexOffset, TRIANGLE_VERTEX_COUNT, TRIANGLE_INDEX_COUNT) || this;
47756
+ var BuilderTriangleRounded = /** @class */ (function (_super) {
47757
+ __extends(BuilderTriangleRounded, _super);
47758
+ function BuilderTriangleRounded(buffer, vertexOffset, indexOffset) {
47759
+ var _this = _super.call(this, buffer, vertexOffset, indexOffset, TRIANGLE_ROUNDED_VERTEX_COUNT, TRIANGLE_ROUNDED_INDEX_COUNT) || this;
47760
+ _this.radius = 0;
47761
+ _this.corner = 0;
47762
+ return _this;
47637
47763
  }
47638
- BuilderTriangle.prototype.init = function () {
47764
+ BuilderTriangleRounded.prototype.init = function () {
47639
47765
  var buffer = this.buffer;
47640
47766
  buffer.updateIndices();
47641
- buildTriangleIndex(buffer.indices, this.vertexOffset, this.indexOffset);
47767
+ buildTriangleRoundedIndex(buffer.indices, this.vertexOffset, this.indexOffset);
47642
47768
  this.inited |= BuilderFlag.INDEX;
47643
47769
  };
47644
- BuilderTriangle.prototype.update = function (shape) {
47770
+ BuilderTriangleRounded.prototype.update = function (shape) {
47645
47771
  var buffer = this.buffer;
47646
47772
  this.updateVertexStepAndUv(buffer, shape);
47647
47773
  this.updateColor(buffer, shape);
47648
47774
  };
47649
- BuilderTriangle.prototype.updateVertexStepAndUv = function (buffer, shape) {
47775
+ BuilderTriangleRounded.prototype.updateVertexStepAndUv = function (buffer, shape) {
47650
47776
  var size = shape.size;
47651
47777
  var sizeX = size.x;
47652
47778
  var sizeY = size.y;
47653
47779
  var isSizeChanged = sizeX !== this.sizeX || sizeY !== this.sizeY;
47780
+ var radius = shape.radius;
47781
+ var isRadiusChanged = radius !== this.radius;
47654
47782
  var transformLocalId = toTransformLocalId(shape);
47655
47783
  var isTransformChanged = this.transformLocalId !== transformLocalId;
47656
47784
  var stroke = shape.stroke;
@@ -47660,35 +47788,43 @@
47660
47788
  var isStrokeChanged = this.strokeAlign !== strokeAlign ||
47661
47789
  this.strokeWidth !== strokeWidth ||
47662
47790
  this.strokeStyle !== strokeStyle;
47791
+ var corner = shape.corner;
47792
+ var isCornerChanged = corner !== this.corner;
47663
47793
  var texture = toTexture(shape);
47664
47794
  var textureTransformId = toTextureTransformId(texture);
47665
47795
  var isTextureChanged = texture !== this.texture || textureTransformId !== this.textureTransformId;
47666
- var isVertexChanged = isSizeChanged || isStrokeChanged;
47796
+ var isVertexChanged = isSizeChanged || isRadiusChanged || isStrokeChanged;
47667
47797
  var isNotInited = !(this.inited & BuilderFlag.VERTEX_STEP_AND_UV);
47668
- if (isNotInited || isVertexChanged || isTransformChanged || isTextureChanged) {
47798
+ if (isNotInited ||
47799
+ isVertexChanged ||
47800
+ isTransformChanged ||
47801
+ isCornerChanged ||
47802
+ isTextureChanged) {
47669
47803
  this.inited |= BuilderFlag.VERTEX_STEP_AND_UV;
47670
47804
  this.sizeX = sizeX;
47671
47805
  this.sizeY = sizeY;
47806
+ this.radius = radius;
47672
47807
  this.transformLocalId = transformLocalId;
47673
47808
  this.strokeAlign = strokeAlign;
47674
47809
  this.strokeWidth = strokeWidth;
47675
47810
  this.strokeStyle = strokeStyle;
47811
+ this.corner = corner;
47676
47812
  this.texture = texture;
47677
47813
  this.textureTransformId = textureTransformId;
47678
47814
  var voffset = this.vertexOffset;
47679
47815
  buffer.updateVertices();
47680
- buildTriangleVertex(buffer.vertices, voffset, 0, 0, sizeX, sizeY, strokeAlign, strokeWidth, shape.transform.internalTransform, TRIANGLE_WORLD_SIZE);
47681
- if (isNotInited || isVertexChanged || isTransformChanged) {
47816
+ buildTriangleRoundedVertex(buffer.vertices, voffset, 0, 0, sizeX, sizeY, strokeAlign, strokeWidth, radius, shape.transform.internalTransform, TRIANGLE_ROUNDED_WORLD_SIZE);
47817
+ if (isNotInited || isVertexChanged || isTransformChanged || isCornerChanged) {
47682
47818
  buffer.updateSteps();
47683
- buildTriangleStep(buffer.steps, voffset, strokeWidth, strokeStyle, TRIANGLE_WORLD_SIZE);
47819
+ buildTriangleRoundedStep(buffer.steps, voffset, strokeWidth, strokeStyle, corner, radius, TRIANGLE_ROUNDED_WORLD_SIZE);
47684
47820
  }
47685
47821
  if (isNotInited || isVertexChanged || isTextureChanged) {
47686
47822
  buffer.updateUvs();
47687
- buildTriangleUv(buffer.uvs, toTextureUvs(texture), voffset, TRIANGLE_WORLD_SIZE);
47823
+ buildTriangleRoundedUv(buffer.uvs, voffset, toTextureUvs(texture), radius, TRIANGLE_ROUNDED_WORLD_SIZE);
47688
47824
  }
47689
47825
  }
47690
47826
  };
47691
- return BuilderTriangle;
47827
+ return BuilderTriangleRounded;
47692
47828
  }(BuilderBase));
47693
47829
 
47694
47830
  /*
@@ -48724,7 +48860,7 @@
48724
48860
  * SPDX-License-Identifier: Apache-2.0
48725
48861
  */
48726
48862
  var createLineOfTrianglesUploaded = function (buffer, shape, voffset, ioffset, antialiasWeight) {
48727
- return createLineOfAnyUploaded(buffer, shape, voffset, TRIANGLE_VERTEX_COUNT, ioffset, TRIANGLE_INDEX_COUNT, antialiasWeight, BuilderLineOfTriangles);
48863
+ return createLineOfAnyUploaded(buffer, shape, voffset, TRIANGLE_LEGACY_VERTEX_COUNT, ioffset, TRIANGLE_LEGACY_INDEX_COUNT, antialiasWeight, BuilderLineOfTriangles);
48728
48864
  };
48729
48865
 
48730
48866
  /*
@@ -48738,7 +48874,7 @@
48738
48874
  case EShapePointsMarkerType.CIRCLE:
48739
48875
  return CIRCLE_LEGACY_VERTEX_COUNT;
48740
48876
  case EShapePointsMarkerType.TRIANGLE:
48741
- return TRIANGLE_VERTEX_COUNT;
48877
+ return TRIANGLE_LEGACY_VERTEX_COUNT;
48742
48878
  case EShapePointsMarkerType.RECTANGLE:
48743
48879
  return RECTANGLE_LEGACY_VERTEX_COUNT;
48744
48880
  }
@@ -48751,7 +48887,7 @@
48751
48887
  case EShapePointsMarkerType.CIRCLE:
48752
48888
  return CIRCLE_LEGACY_INDEX_COUNT;
48753
48889
  case EShapePointsMarkerType.TRIANGLE:
48754
- return TRIANGLE_INDEX_COUNT;
48890
+ return TRIANGLE_LEGACY_INDEX_COUNT;
48755
48891
  case EShapePointsMarkerType.RECTANGLE:
48756
48892
  return RECTANGLE_LEGACY_INDEX_COUNT;
48757
48893
  }
@@ -50885,16 +51021,16 @@
50885
51021
  * Copyright (C) 2019 Toshiba Corporation
50886
51022
  * SPDX-License-Identifier: Apache-2.0
50887
51023
  */
50888
- var createTriangleRoundedUploaded = function (buffer, shape, voffset, ioffset, antialiasWeight) {
51024
+ var createTriangleLegacyUploaded = function (buffer, shape, voffset, ioffset, antialiasWeight) {
50889
51025
  var tcount = toTextBufferCount(shape);
50890
51026
  var tvcount = tcount << TEXT_VERTEX_COUNT_SHIFT;
50891
51027
  var ticount = tcount << TEXT_INDEX_COUNT_SHIFT;
50892
- var vcount = TRIANGLE_ROUNDED_VERTEX_COUNT + tvcount;
50893
- var icount = TRIANGLE_ROUNDED_INDEX_COUNT + ticount;
51028
+ var vcount = TRIANGLE_LEGACY_VERTEX_COUNT + tvcount;
51029
+ var icount = TRIANGLE_LEGACY_INDEX_COUNT + ticount;
50894
51030
  if (buffer.check(voffset, ioffset, vcount, icount)) {
50895
51031
  return new EShapeUploadedImpl(buffer, voffset, ioffset, vcount, icount, [
50896
- new BuilderTriangleRounded(buffer, voffset, ioffset),
50897
- new BuilderText(buffer, voffset + TRIANGLE_ROUNDED_VERTEX_COUNT, ioffset + TRIANGLE_ROUNDED_INDEX_COUNT, tvcount, ticount)
51032
+ new BuilderTriangleLegacy(buffer, voffset, ioffset),
51033
+ new BuilderText(buffer, voffset + TRIANGLE_LEGACY_VERTEX_COUNT, ioffset + TRIANGLE_LEGACY_INDEX_COUNT, tvcount, ticount)
50898
51034
  ]).init(shape);
50899
51035
  }
50900
51036
  return null;
@@ -50904,16 +51040,16 @@
50904
51040
  * Copyright (C) 2019 Toshiba Corporation
50905
51041
  * SPDX-License-Identifier: Apache-2.0
50906
51042
  */
50907
- var createTriangleUploaded = function (buffer, shape, voffset, ioffset, antialiasWeight) {
51043
+ var createTriangleRoundedUploaded = function (buffer, shape, voffset, ioffset, antialiasWeight) {
50908
51044
  var tcount = toTextBufferCount(shape);
50909
51045
  var tvcount = tcount << TEXT_VERTEX_COUNT_SHIFT;
50910
51046
  var ticount = tcount << TEXT_INDEX_COUNT_SHIFT;
50911
- var vcount = TRIANGLE_VERTEX_COUNT + tvcount;
50912
- var icount = TRIANGLE_INDEX_COUNT + ticount;
51047
+ var vcount = TRIANGLE_ROUNDED_VERTEX_COUNT + tvcount;
51048
+ var icount = TRIANGLE_ROUNDED_INDEX_COUNT + ticount;
50913
51049
  if (buffer.check(voffset, ioffset, vcount, icount)) {
50914
51050
  return new EShapeUploadedImpl(buffer, voffset, ioffset, vcount, icount, [
50915
- new BuilderTriangle(buffer, voffset, ioffset),
50916
- new BuilderText(buffer, voffset + TRIANGLE_VERTEX_COUNT, ioffset + TRIANGLE_INDEX_COUNT, tvcount, ticount)
51051
+ new BuilderTriangleRounded(buffer, voffset, ioffset),
51052
+ new BuilderText(buffer, voffset + TRIANGLE_ROUNDED_VERTEX_COUNT, ioffset + TRIANGLE_ROUNDED_INDEX_COUNT, tvcount, ticount)
50917
51053
  ]).init(shape);
50918
51054
  }
50919
51055
  return null;
@@ -52464,7 +52600,7 @@
52464
52600
  var ex = x - px - ox;
52465
52601
  var ey = y - py - oy;
52466
52602
  if (this.containsAbsBBox(ex, ey, ax, ay)) {
52467
- return hitTestCircle(this, ex, ey, ax, ay, sw, ss);
52603
+ return hitTestCircleLegacy(this, ex, ey, ax, ay, sw, ss);
52468
52604
  }
52469
52605
  return false;
52470
52606
  };
@@ -52791,6 +52927,269 @@
52791
52927
  return deserializeBase(item, manager, shape || new EShapeLineOfTriangleRoundeds());
52792
52928
  };
52793
52929
 
52930
+ /*
52931
+ * Copyright (C) 2019-2026 Toshiba Corporation
52932
+ * SPDX-License-Identifier: Apache-2.0
52933
+ */
52934
+ var EShapeTriangleTriangulatedImpl = /** @class */ (function () {
52935
+ function EShapeTriangleTriangulatedImpl(parent) {
52936
+ this._id = 0;
52937
+ this._parent = parent;
52938
+ this._width = 0;
52939
+ this._height = 0;
52940
+ this._strokeAlign = 0;
52941
+ this._strokeWidth = 0;
52942
+ this._sizeX = 0;
52943
+ this._sizeY = 0;
52944
+ this._vertices = [];
52945
+ this._nvertices = 0;
52946
+ this._distances = [];
52947
+ this._lengths = [];
52948
+ this._clippings = [];
52949
+ this._uvs = [];
52950
+ this._indices = [];
52951
+ this._nindices = 0;
52952
+ this._boundary = [0, 0, 0, 0];
52953
+ }
52954
+ Object.defineProperty(EShapeTriangleTriangulatedImpl.prototype, "id", {
52955
+ get: function () {
52956
+ this.triangulate();
52957
+ return this._id;
52958
+ },
52959
+ enumerable: false,
52960
+ configurable: true
52961
+ });
52962
+ Object.defineProperty(EShapeTriangleTriangulatedImpl.prototype, "vertices", {
52963
+ get: function () {
52964
+ this.triangulate();
52965
+ return this._vertices;
52966
+ },
52967
+ enumerable: false,
52968
+ configurable: true
52969
+ });
52970
+ Object.defineProperty(EShapeTriangleTriangulatedImpl.prototype, "nvertices", {
52971
+ get: function () {
52972
+ this.triangulate();
52973
+ return this._nvertices;
52974
+ },
52975
+ enumerable: false,
52976
+ configurable: true
52977
+ });
52978
+ Object.defineProperty(EShapeTriangleTriangulatedImpl.prototype, "distances", {
52979
+ get: function () {
52980
+ this.triangulate();
52981
+ return this._distances;
52982
+ },
52983
+ enumerable: false,
52984
+ configurable: true
52985
+ });
52986
+ Object.defineProperty(EShapeTriangleTriangulatedImpl.prototype, "lengths", {
52987
+ get: function () {
52988
+ this.triangulate();
52989
+ return this._lengths;
52990
+ },
52991
+ enumerable: false,
52992
+ configurable: true
52993
+ });
52994
+ Object.defineProperty(EShapeTriangleTriangulatedImpl.prototype, "clippings", {
52995
+ get: function () {
52996
+ this.triangulate();
52997
+ return this._clippings;
52998
+ },
52999
+ enumerable: false,
53000
+ configurable: true
53001
+ });
53002
+ Object.defineProperty(EShapeTriangleTriangulatedImpl.prototype, "uvs", {
53003
+ get: function () {
53004
+ this.triangulate();
53005
+ return this._uvs;
53006
+ },
53007
+ enumerable: false,
53008
+ configurable: true
53009
+ });
53010
+ Object.defineProperty(EShapeTriangleTriangulatedImpl.prototype, "indices", {
53011
+ get: function () {
53012
+ this.triangulate();
53013
+ return this._indices;
53014
+ },
53015
+ enumerable: false,
53016
+ configurable: true
53017
+ });
53018
+ Object.defineProperty(EShapeTriangleTriangulatedImpl.prototype, "nindices", {
53019
+ get: function () {
53020
+ this.triangulate();
53021
+ return this._nindices;
53022
+ },
53023
+ enumerable: false,
53024
+ configurable: true
53025
+ });
53026
+ Object.defineProperty(EShapeTriangleTriangulatedImpl.prototype, "boundary", {
53027
+ get: function () {
53028
+ this.triangulate();
53029
+ return this._boundary;
53030
+ },
53031
+ enumerable: false,
53032
+ configurable: true
53033
+ });
53034
+ EShapeTriangleTriangulatedImpl.prototype.triangulate = function () {
53035
+ var isNotInitialized = this._id === 0;
53036
+ var parent = this._parent;
53037
+ var size = parent.size;
53038
+ var width = size.x;
53039
+ var height = size.y;
53040
+ var isRectChanged = this._width !== width || this._height !== height;
53041
+ var stroke = parent.stroke;
53042
+ var strokeAlign = stroke.align;
53043
+ var strokeWidth = stroke.enable ? stroke.width : 0;
53044
+ var isStrokeChanged = this._strokeAlign !== strokeAlign || this._strokeWidth !== strokeWidth;
53045
+ var isSizeChanged = false;
53046
+ var sizeX = this._sizeX;
53047
+ var sizeY = this._sizeY;
53048
+ if (isRectChanged || isStrokeChanged) {
53049
+ this._width = width;
53050
+ this._height = height;
53051
+ this._strokeAlign = strokeAlign;
53052
+ this._strokeWidth = strokeWidth;
53053
+ var s = strokeAlign * strokeWidth;
53054
+ sizeX = width * 0.5 + (0 <= width ? +s : -s);
53055
+ sizeY = height * 0.5 + (0 <= height ? +s : -s);
53056
+ isSizeChanged = this._sizeX !== sizeX || this._sizeY !== sizeY;
53057
+ }
53058
+ if (isNotInitialized || isSizeChanged || isStrokeChanged) {
53059
+ this._sizeX = sizeX;
53060
+ this._sizeY = sizeY;
53061
+ this.update(sizeX, sizeY, 1.1);
53062
+ }
53063
+ };
53064
+ EShapeTriangleTriangulatedImpl.prototype.update = function (sizeX, sizeY, scale) {
53065
+ // Boundary
53066
+ var ax = Math.abs(sizeX);
53067
+ var ay = Math.abs(sizeY);
53068
+ var boundary = this._boundary;
53069
+ boundary[0] = -ax;
53070
+ boundary[1] = -ay;
53071
+ boundary[2] = +ax;
53072
+ boundary[3] = +ay;
53073
+ // # of vertices and # of indices
53074
+ var nv = 7;
53075
+ var ni = 3;
53076
+ this._nvertices = nv;
53077
+ this._nindices = ni;
53078
+ // ID
53079
+ this._id += 1;
53080
+ //
53081
+ if (sizeX === 0 || sizeY === 0) {
53082
+ this.pad(0, 0, nv, ni, 0);
53083
+ }
53084
+ else {
53085
+ this.updateAll(sizeX, sizeY, scale);
53086
+ }
53087
+ };
53088
+ /**
53089
+ * Fills the unused tail with degenerated triangles and trims the arrays
53090
+ * so that the buffers always hold exactly `nv` vertices and `ni` triangles.
53091
+ */
53092
+ EShapeTriangleTriangulatedImpl.prototype.pad = function (iv, ii, nv, ni, fd) {
53093
+ var vertices = this._vertices;
53094
+ var distances = this._distances;
53095
+ var lengths = this._lengths;
53096
+ var clippings = this._clippings;
53097
+ var uvs = this._uvs;
53098
+ var indices = this._indices;
53099
+ for (var i = iv; i < nv; ++i) {
53100
+ var i2 = i << 1;
53101
+ vertices[i2] = 0;
53102
+ vertices[i2 + 1] = 0;
53103
+ distances[i] = fd;
53104
+ lengths[i] = 0;
53105
+ clippings[i] = 0;
53106
+ uvs[i2] = 0.5;
53107
+ uvs[i2 + 1] = 0.5;
53108
+ }
53109
+ for (var i = ii, imax = ni * 3; i < imax; ++i) {
53110
+ indices[i] = 0;
53111
+ }
53112
+ var nv2 = nv << 1;
53113
+ vertices.length = nv2;
53114
+ distances.length = nv;
53115
+ lengths.length = nv;
53116
+ clippings.length = nv;
53117
+ uvs.length = nv2;
53118
+ indices.length = ni * 3;
53119
+ };
53120
+ EShapeTriangleTriangulatedImpl.prototype.updateAll = function (sx, sy, scale) {
53121
+ var fx = 1 / sx;
53122
+ var fy = 1 / sy;
53123
+ var ax = Math.abs(sx);
53124
+ var ay = Math.abs(sy);
53125
+ // The triangle is defined by the apex (0, -sy) and the two base
53126
+ // vertices (-sx, sy) and (sx, sy). The signs of sx and
53127
+ // sy intentionally preserve horizontal and vertical reflections.
53128
+ // The sloped edge spans ax horizontally and 2 * ay vertically.
53129
+ var side = Math.sqrt(ax * ax + 4 * ay * ay);
53130
+ // The base is horizontal, so its length is twice the half-width.
53131
+ var base = 2 * ax;
53132
+ // Length values are measured along the triangle perimeter.
53133
+ var perimeter = 2 * side + base;
53134
+ // The incenter lies on the vertical center line. This is its y-coordinate.
53135
+ // Along the median, the distances from the top vertex to the incenter and
53136
+ // from the incenter to the base are in the ratio 2 * side : base.
53137
+ // Thus, (ay + cy) : (ay - cy) = 2 * side : base.
53138
+ // 2 side (ay - cy) = base * (ay + cy)
53139
+ // 2 side ay - 2 side cy = base ay + base cy
53140
+ // (base + 2 side) cy = ay (2 side - base)
53141
+ // cy = ay (2 side - base) / (2 side + base)
53142
+ // cy = ay (2 side - 2 ax) / (2 side + 2 ax)
53143
+ // cy = ay (side - ax) / (side + ax)
53144
+ var cx = 0;
53145
+ var cy = (sy * (side - ax)) / (side + ax);
53146
+ // The distance from the incenter to every edge is the inradius.
53147
+ // Since 0 <= (side - ax) / (side + ax) <= 1, the incenter remains
53148
+ // between the apex and the base even when sy is negative.
53149
+ var distance = Math.abs(sy - cy);
53150
+ var fdistance = 1 / distance;
53151
+ // Expand the triangle around its incenter for anti-aliasing and strokes.
53152
+ // The outer vertices are shared where their interpolated attributes match.
53153
+ var x0 = 0;
53154
+ var y0 = cy + scale * (-sy - cy);
53155
+ var x1 = scale * sx;
53156
+ var y1 = cy + scale * (sy - cy);
53157
+ var x2 = -x1;
53158
+ var y2 = y1;
53159
+ // Top-to-right edge cell. The inner vertex carries the fill attributes.
53160
+ this.updateVertex(0, x0, y0, fdistance, 0, scale, fx, fy);
53161
+ this.updateVertex(1, x1, y1, fdistance, side, scale, fx, fy);
53162
+ this.updateVertex(2, cx, cy, fdistance, side - ax, 0, fx, fy);
53163
+ var indices = this._indices;
53164
+ indices[0] = 0;
53165
+ indices[1] = 1;
53166
+ indices[2] = 2;
53167
+ // Right-to-left base edge cell. The right and left outer vertices are reused.
53168
+ this.updateVertex(3, x2, y2, fdistance, side + base, scale, fx, fy);
53169
+ this.updateVertex(4, cx, cy, fdistance, side + ax, 0, fx, fy);
53170
+ indices[3] = 1;
53171
+ indices[4] = 3;
53172
+ indices[5] = 4;
53173
+ // Left-to-top edge cell. The top vertex is duplicated for the perimeter seam.
53174
+ this.updateVertex(5, x0, y0, fdistance, perimeter, scale, fx, fy);
53175
+ this.updateVertex(6, cx, cy, fdistance, perimeter - (side - ax), 0, fx, fy);
53176
+ indices[6] = 3;
53177
+ indices[7] = 5;
53178
+ indices[8] = 6;
53179
+ };
53180
+ EShapeTriangleTriangulatedImpl.prototype.updateVertex = function (vertex, x, y, distance, length, clipping, fx, fy) {
53181
+ var vertex2 = vertex << 1;
53182
+ this._vertices[vertex2] = x;
53183
+ this._vertices[vertex2 + 1] = y;
53184
+ this._distances[vertex] = distance;
53185
+ this._lengths[vertex] = length;
53186
+ this._clippings[vertex] = clipping;
53187
+ this._uvs[vertex2] = 0.5 * (x * fx + 1);
53188
+ this._uvs[vertex2 + 1] = 0.5 * (y * fy + 1);
53189
+ };
53190
+ return EShapeTriangleTriangulatedImpl;
53191
+ }());
53192
+
52794
53193
  /*
52795
53194
  * Copyright (C) 2019 Toshiba Corporation
52796
53195
  * SPDX-License-Identifier: Apache-2.0
@@ -52799,8 +53198,20 @@
52799
53198
  __extends(EShapeTriangle, _super);
52800
53199
  function EShapeTriangle(type) {
52801
53200
  if (type === void 0) { type = EShapeType.TRIANGLE; }
52802
- return _super.call(this, type) || this;
53201
+ var _this = _super.call(this, type) || this;
53202
+ _this._triangulated = _this.newTriangulated();
53203
+ return _this;
52803
53204
  }
53205
+ EShapeTriangle.prototype.newTriangulated = function () {
53206
+ return new EShapeTriangleTriangulatedImpl(this);
53207
+ };
53208
+ Object.defineProperty(EShapeTriangle.prototype, "triangulated", {
53209
+ get: function () {
53210
+ return this._triangulated;
53211
+ },
53212
+ enumerable: false,
53213
+ configurable: true
53214
+ });
52804
53215
  EShapeTriangle.prototype.clone = function () {
52805
53216
  return new EShapeTriangle(this.type).copy(this);
52806
53217
  };
@@ -52960,7 +53371,7 @@
52960
53371
  */
52961
53372
  var hitTestSemicircle = function (shape, x, y, ax, ay, sw, ss) {
52962
53373
  if (y <= 0) {
52963
- return hitTestCircle(shape, x, y, ax, ay, sw, ss);
53374
+ return hitTestCircleLegacy(shape, x, y, ax, ay, sw, ss);
52964
53375
  }
52965
53376
  return false;
52966
53377
  };
@@ -53002,6 +53413,36 @@
53002
53413
  return deserializeBase(item, manager, shape || new EShapeSemicircle());
53003
53414
  };
53004
53415
 
53416
+ /*
53417
+ * Copyright (C) 2019 Toshiba Corporation
53418
+ * SPDX-License-Identifier: Apache-2.0
53419
+ */
53420
+ var EShapeTriangleLegacy = /** @class */ (function (_super) {
53421
+ __extends(EShapeTriangleLegacy, _super);
53422
+ function EShapeTriangleLegacy(type) {
53423
+ if (type === void 0) { type = EShapeType.TRIANGLE_LEGACY; }
53424
+ return _super.call(this, type) || this;
53425
+ }
53426
+ EShapeTriangleLegacy.prototype.clone = function () {
53427
+ return new EShapeTriangleLegacy(this.type).copy(this);
53428
+ };
53429
+ EShapeTriangleLegacy.prototype.containsAbs = function (x, y, ax, ay, sw, ss, sa) {
53430
+ if (_super.prototype.containsAbsBBox.call(this, x, y, ax, ay)) {
53431
+ return hitTestTriangleLegacy(this, x, y, ax, ay, sw, ss);
53432
+ }
53433
+ return false;
53434
+ };
53435
+ return EShapeTriangleLegacy;
53436
+ }(EShapePrimitive));
53437
+
53438
+ /*
53439
+ * Copyright (C) 2019 Toshiba Corporation
53440
+ * SPDX-License-Identifier: Apache-2.0
53441
+ */
53442
+ var deserializeTriangleLegacy = function (item, manager, shape) {
53443
+ return deserializeBase(item, manager, shape || new EShapeTriangleLegacy());
53444
+ };
53445
+
53005
53446
  /*
53006
53447
  * Copyright (C) 2019 Toshiba Corporation
53007
53448
  * SPDX-License-Identifier: Apache-2.0
@@ -53435,10 +53876,19 @@
53435
53876
  * SPDX-License-Identifier: Apache-2.0
53436
53877
  */
53437
53878
  var loadShapeTriangle = function () {
53438
- EShapeUploadeds[EShapeType.TRIANGLE] = createTriangleUploaded;
53879
+ EShapeUploadeds[EShapeType.TRIANGLE] = createPolygonUploaded;
53439
53880
  EShapeDeserializers[EShapeType.TRIANGLE] = deserializeTriangle;
53440
53881
  };
53441
53882
 
53883
+ /*
53884
+ * Copyright (C) 2019 Toshiba Corporation
53885
+ * SPDX-License-Identifier: Apache-2.0
53886
+ */
53887
+ var loadShapeTriangleLegacy = function () {
53888
+ EShapeUploadeds[EShapeType.TRIANGLE_LEGACY] = createTriangleLegacyUploaded;
53889
+ EShapeDeserializers[EShapeType.TRIANGLE_LEGACY] = deserializeTriangleLegacy;
53890
+ };
53891
+
53442
53892
  /*
53443
53893
  * Copyright (C) 2019 Toshiba Corporation
53444
53894
  * SPDX-License-Identifier: Apache-2.0
@@ -53446,7 +53896,7 @@
53446
53896
  var loadShapeTriangleRounded = function () {
53447
53897
  EShapeUploadeds[EShapeType.TRIANGLE_ROUNDED] = createTriangleRoundedUploaded;
53448
53898
  EShapeDeserializers[EShapeType.TRIANGLE_ROUNDED] = deserializeTriangleRounded;
53449
- EShapeCapabilities.set(EShapeType.TRIANGLE_ROUNDED, EShapeCapability.PRIMITIVE | EShapeCapability.STROKE_SIDE | EShapeCapability.BORDER_RADIUS);
53899
+ EShapeCapabilities.set(EShapeType.TRIANGLE_ROUNDED, EShapeCapability.PRIMITIVE | EShapeCapability.BORDER_RADIUS);
53450
53900
  };
53451
53901
 
53452
53902
  /*
@@ -53474,6 +53924,7 @@
53474
53924
  loadShapeRectangleRounded();
53475
53925
  loadShapeRectangle();
53476
53926
  loadShapeSemicircle();
53927
+ loadShapeTriangleLegacy();
53477
53928
  loadShapeTriangleRounded();
53478
53929
  loadShapeTriangle();
53479
53930
  loadShapeLineOfCircles();
@@ -85266,6 +85717,7 @@
85266
85717
  loadShapeRectangleRounded: loadShapeRectangleRounded,
85267
85718
  loadShapeRectangle: loadShapeRectangle,
85268
85719
  loadShapeSemicircle: loadShapeSemicircle,
85720
+ loadShapeTriangleLegacy: loadShapeTriangleLegacy,
85269
85721
  loadShapeTriangleRounded: loadShapeTriangleRounded,
85270
85722
  loadShapeTriangle: loadShapeTriangle,
85271
85723
  BAR_VERTEX_COUNT: BAR_VERTEX_COUNT,
@@ -85351,6 +85803,13 @@
85351
85803
  buildTextIndex: buildTextIndex,
85352
85804
  buildTextStep: buildTextStep,
85353
85805
  buildTextVertex: buildTextVertex,
85806
+ TRIANGLE_LEGACY_VERTEX_COUNT: TRIANGLE_LEGACY_VERTEX_COUNT,
85807
+ TRIANGLE_LEGACY_INDEX_COUNT: TRIANGLE_LEGACY_INDEX_COUNT,
85808
+ TRIANGLE_LEGACY_WORLD_SIZE: TRIANGLE_LEGACY_WORLD_SIZE,
85809
+ buildTriangleLegacyIndex: buildTriangleLegacyIndex,
85810
+ buildTriangleLegacyVertex: buildTriangleLegacyVertex,
85811
+ buildTriangleLegacyStep: buildTriangleLegacyStep,
85812
+ buildTriangleLegacyUv: buildTriangleLegacyUv,
85354
85813
  TRIANGLE_ROUNDED_VERTEX_COUNT: TRIANGLE_ROUNDED_VERTEX_COUNT,
85355
85814
  TRIANGLE_ROUNDED_INDEX_COUNT: TRIANGLE_ROUNDED_INDEX_COUNT,
85356
85815
  TRIANGLE_ROUNDED_WORLD_SIZE: TRIANGLE_ROUNDED_WORLD_SIZE,
@@ -85358,13 +85817,13 @@
85358
85817
  buildTriangleRoundedVertex: buildTriangleRoundedVertex,
85359
85818
  buildTriangleRoundedStep: buildTriangleRoundedStep,
85360
85819
  buildTriangleRoundedUv: buildTriangleRoundedUv,
85361
- TRIANGLE_VERTEX_COUNT: TRIANGLE_VERTEX_COUNT,
85362
- TRIANGLE_INDEX_COUNT: TRIANGLE_INDEX_COUNT,
85363
- TRIANGLE_WORLD_SIZE: TRIANGLE_WORLD_SIZE,
85364
- buildTriangleIndex: buildTriangleIndex,
85365
- buildTriangleVertex: buildTriangleVertex,
85366
- buildTriangleStep: buildTriangleStep,
85367
- buildTriangleUv: buildTriangleUv,
85820
+ buildTriangleIndex: buildTriangleLegacyIndex,
85821
+ buildTriangleStep: buildTriangleLegacyStep,
85822
+ buildTriangleUv: buildTriangleLegacyUv,
85823
+ buildTriangleVertex: buildTriangleLegacyVertex,
85824
+ TRIANGLE_INDEX_COUNT: TRIANGLE_LEGACY_INDEX_COUNT,
85825
+ TRIANGLE_VERTEX_COUNT: TRIANGLE_LEGACY_VERTEX_COUNT,
85826
+ TRIANGLE_WORLD_SIZE: TRIANGLE_LEGACY_WORLD_SIZE,
85368
85827
  BuilderBar: BuilderBar,
85369
85828
  BuilderBase: BuilderBase,
85370
85829
  BuilderCircleLegacy: BuilderCircleLegacy,
@@ -85395,8 +85854,9 @@
85395
85854
  BuilderRectangle: BuilderRectangleLegacy,
85396
85855
  BuilderSemicircle: BuilderSemicircle,
85397
85856
  BuilderText: BuilderText,
85857
+ BuilderTriangleLegacy: BuilderTriangleLegacy,
85398
85858
  BuilderTriangleRounded: BuilderTriangleRounded,
85399
- BuilderTriangle: BuilderTriangle,
85859
+ BuilderTriangle: BuilderTriangleLegacy,
85400
85860
  BuilderFlag: BuilderFlag,
85401
85861
  toTransformLocalId: toTransformLocalId,
85402
85862
  toTexture: toTexture,
@@ -85431,8 +85891,9 @@
85431
85891
  createRectangleRoundedUploaded: createRectangleRoundedUploaded,
85432
85892
  createRectangleUploaded: createRectangleLegacyUploaded,
85433
85893
  createSemicircleUploaded: createSemicircleUploaded,
85894
+ createTriangleLegacyUploaded: createTriangleLegacyUploaded,
85434
85895
  createTriangleRoundedUploaded: createTriangleRoundedUploaded,
85435
- createTriangleUploaded: createTriangleUploaded,
85896
+ createTriangleUploaded: createTriangleLegacyUploaded,
85436
85897
  deserializeAll: deserializeAll,
85437
85898
  deserializeBar: deserializeBar,
85438
85899
  deserializeBase: deserializeBase,
@@ -85464,6 +85925,7 @@
85464
85925
  deserializeRectangleRounded: deserializeRectangleRounded,
85465
85926
  deserializeRectangle: deserializeRectangle,
85466
85927
  deserializeSemicircle: deserializeSemicircle,
85928
+ deserializeTriangleLegacy: deserializeTriangleLegacy,
85467
85929
  deserializeTriangleRounded: deserializeTriangleRounded,
85468
85930
  deserializeTriangle: deserializeTriangle,
85469
85931
  deserialize: deserialize,
@@ -85536,15 +85998,20 @@
85536
85998
  EShapeTextImpl: EShapeTextImpl,
85537
85999
  EShapeTextOffsetImpl: EShapeTextOffsetImpl,
85538
86000
  EShapeTextOutlineImpl: EShapeTextOutlineImpl,
86001
+ EShapeTriangleLegacy: EShapeTriangleLegacy,
85539
86002
  EShapeTriangleRounded: EShapeTriangleRounded,
86003
+ EShapeTriangleTriangulatedImpl: EShapeTriangleTriangulatedImpl,
85540
86004
  EShapeTriangle: EShapeTriangle,
85541
86005
  hitTestBBox: hitTestBBox,
86006
+ hitTestCircleLegacy: hitTestCircleLegacy,
85542
86007
  hitTestCircle: hitTestCircle,
85543
86008
  hitTestSemicircle: hitTestSemicircle,
85544
86009
  hitTestRectangleRounded: hitTestRectangleRounded,
86010
+ hitTestRectangleLegacy: hitTestRectangleLegacy,
85545
86011
  hitTestRectangle: hitTestRectangle,
85546
86012
  hitTestTriangleRounded: hitTestTriangleRounded,
85547
86013
  hitTestTriangleFilled: hitTestTriangleFilled,
86014
+ hitTestTriangleLegacy: hitTestTriangleLegacy,
85548
86015
  hitTestTriangle: hitTestTriangle,
85549
86016
  isShapePolygonLike: isShapePolygonLike,
85550
86017
  isStatic: isStatic,