@wcardinal/wcardinal-ui 0.465.0 → 0.466.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 (93) hide show
  1. package/dist/types/wcardinal/ui/shape/e-shape-stroke-side.d.ts +6 -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 +2 -0
  4. package/dist/types/wcardinal/ui/shape/load/load-shape-rectangle-legacy.d.ts +1 -0
  5. package/dist/types/wcardinal/ui/shape/variant/build-rectangle-legacy.d.ts +10 -0
  6. package/dist/types/wcardinal/ui/shape/variant/build-rectangle.d.ts +1 -10
  7. package/dist/types/wcardinal/ui/shape/variant/builder-rectangle-legacy.d.ts +9 -0
  8. package/dist/types/wcardinal/ui/shape/variant/builder-rectangle.d.ts +1 -9
  9. package/dist/types/wcardinal/ui/shape/variant/create-rectangle-legacy-uploaded.d.ts +4 -0
  10. package/dist/types/wcardinal/ui/shape/variant/create-rectangle-uploaded.d.ts +1 -4
  11. package/dist/types/wcardinal/ui/shape/variant/deserialize-rectangle-legacy.d.ts +4 -0
  12. package/dist/types/wcardinal/ui/shape/variant/e-shape-line-of-rectangles.d.ts +2 -2
  13. package/dist/types/wcardinal/ui/shape/variant/e-shape-rectangle-legacy.d.ts +7 -0
  14. package/dist/types/wcardinal/ui/shape/variant/e-shape-rectangle-pivoted.d.ts +2 -2
  15. package/dist/types/wcardinal/ui/shape/variant/e-shape-rectangle-triangulated-impl.d.ts +85 -0
  16. package/dist/types/wcardinal/ui/shape/variant/e-shape-rectangle-triangulated.d.ts +3 -0
  17. package/dist/types/wcardinal/ui/shape/variant/e-shape-rectangle.d.ts +4 -0
  18. package/dist/types/wcardinal/ui/shape/variant/index.d.ts +7 -0
  19. package/dist/wcardinal/ui/shape/e-shape-stroke-side.js +6 -0
  20. package/dist/wcardinal/ui/shape/e-shape-stroke-side.js.map +1 -1
  21. package/dist/wcardinal/ui/shape/e-shape-type.js +1 -0
  22. package/dist/wcardinal/ui/shape/e-shape-type.js.map +1 -1
  23. package/dist/wcardinal/ui/shape/load/index.js +2 -0
  24. package/dist/wcardinal/ui/shape/load/index.js.map +1 -1
  25. package/dist/wcardinal/ui/shape/load/load-shape-all.js +2 -0
  26. package/dist/wcardinal/ui/shape/load/load-shape-all.js.map +1 -1
  27. package/dist/wcardinal/ui/shape/load/load-shape-image.js +2 -2
  28. package/dist/wcardinal/ui/shape/load/load-shape-image.js.map +1 -1
  29. package/dist/wcardinal/ui/shape/load/load-shape-rectangle-legacy.js +17 -0
  30. package/dist/wcardinal/ui/shape/load/load-shape-rectangle-legacy.js.map +1 -0
  31. package/dist/wcardinal/ui/shape/load/load-shape-rectangle.js +2 -2
  32. package/dist/wcardinal/ui/shape/load/load-shape-rectangle.js.map +1 -1
  33. package/dist/wcardinal/ui/shape/variant/build-polygon.js +1 -1
  34. package/dist/wcardinal/ui/shape/variant/build-polygon.js.map +1 -1
  35. package/dist/wcardinal/ui/shape/variant/build-rectangle-legacy.js +336 -0
  36. package/dist/wcardinal/ui/shape/variant/build-rectangle-legacy.js.map +1 -0
  37. package/dist/wcardinal/ui/shape/variant/build-rectangle.js +5 -338
  38. package/dist/wcardinal/ui/shape/variant/build-rectangle.js.map +1 -1
  39. package/dist/wcardinal/ui/shape/variant/builder-line-of-rectangles.js +16 -16
  40. package/dist/wcardinal/ui/shape/variant/builder-line-of-rectangles.js.map +1 -1
  41. package/dist/wcardinal/ui/shape/variant/builder-marker-rectangle.js +6 -6
  42. package/dist/wcardinal/ui/shape/variant/builder-marker-rectangle.js.map +1 -1
  43. package/dist/wcardinal/ui/shape/variant/builder-rectangle-legacy.js +77 -0
  44. package/dist/wcardinal/ui/shape/variant/builder-rectangle-legacy.js.map +1 -0
  45. package/dist/wcardinal/ui/shape/variant/builder-rectangle-pivoted.js +6 -6
  46. package/dist/wcardinal/ui/shape/variant/builder-rectangle-pivoted.js.map +1 -1
  47. package/dist/wcardinal/ui/shape/variant/builder-rectangle.js +1 -72
  48. package/dist/wcardinal/ui/shape/variant/builder-rectangle.js.map +1 -1
  49. package/dist/wcardinal/ui/shape/variant/create-line-of-rectangles-uploaded.js +2 -2
  50. package/dist/wcardinal/ui/shape/variant/create-line-of-rectangles-uploaded.js.map +1 -1
  51. package/dist/wcardinal/ui/shape/variant/create-line-uploaded.js +3 -3
  52. package/dist/wcardinal/ui/shape/variant/create-line-uploaded.js.map +1 -1
  53. package/dist/wcardinal/ui/shape/variant/create-rectangle-legacy-uploaded.js +24 -0
  54. package/dist/wcardinal/ui/shape/variant/create-rectangle-legacy-uploaded.js.map +1 -0
  55. package/dist/wcardinal/ui/shape/variant/create-rectangle-pivoted-uploaded.js +4 -4
  56. package/dist/wcardinal/ui/shape/variant/create-rectangle-pivoted-uploaded.js.map +1 -1
  57. package/dist/wcardinal/ui/shape/variant/create-rectangle-uploaded.js +1 -19
  58. package/dist/wcardinal/ui/shape/variant/create-rectangle-uploaded.js.map +1 -1
  59. package/dist/wcardinal/ui/shape/variant/deserialize-rectangle-legacy.js +10 -0
  60. package/dist/wcardinal/ui/shape/variant/deserialize-rectangle-legacy.js.map +1 -0
  61. package/dist/wcardinal/ui/shape/variant/e-shape-circle-triangulated-impl.js +68 -30
  62. package/dist/wcardinal/ui/shape/variant/e-shape-circle-triangulated-impl.js.map +1 -1
  63. package/dist/wcardinal/ui/shape/variant/e-shape-line-of-rectangles.js +2 -2
  64. package/dist/wcardinal/ui/shape/variant/e-shape-line-of-rectangles.js.map +1 -1
  65. package/dist/wcardinal/ui/shape/variant/e-shape-rectangle-legacy.js +27 -0
  66. package/dist/wcardinal/ui/shape/variant/e-shape-rectangle-legacy.js.map +1 -0
  67. package/dist/wcardinal/ui/shape/variant/e-shape-rectangle-pivoted.js +2 -2
  68. package/dist/wcardinal/ui/shape/variant/e-shape-rectangle-pivoted.js.map +1 -1
  69. package/dist/wcardinal/ui/shape/variant/e-shape-rectangle-triangulated-impl.js +796 -0
  70. package/dist/wcardinal/ui/shape/variant/e-shape-rectangle-triangulated-impl.js.map +1 -0
  71. package/dist/wcardinal/ui/shape/variant/e-shape-rectangle-triangulated.js +6 -0
  72. package/dist/wcardinal/ui/shape/variant/e-shape-rectangle-triangulated.js.map +1 -0
  73. package/dist/wcardinal/ui/shape/variant/e-shape-rectangle.js +14 -1
  74. package/dist/wcardinal/ui/shape/variant/e-shape-rectangle.js.map +1 -1
  75. package/dist/wcardinal/ui/shape/variant/index.js +7 -0
  76. package/dist/wcardinal/ui/shape/variant/index.js.map +1 -1
  77. package/dist/wcardinal-ui-theme-dark-en-us.js +1 -1
  78. package/dist/wcardinal-ui-theme-dark-en-us.min.js +1 -1
  79. package/dist/wcardinal-ui-theme-dark-ja-jp.js +1 -1
  80. package/dist/wcardinal-ui-theme-dark-ja-jp.min.js +1 -1
  81. package/dist/wcardinal-ui-theme-dark.js +1 -1
  82. package/dist/wcardinal-ui-theme-dark.min.js +1 -1
  83. package/dist/wcardinal-ui-theme-white-en-us.js +1 -1
  84. package/dist/wcardinal-ui-theme-white-en-us.min.js +1 -1
  85. package/dist/wcardinal-ui-theme-white-ja-jp.js +1 -1
  86. package/dist/wcardinal-ui-theme-white-ja-jp.min.js +1 -1
  87. package/dist/wcardinal-ui-theme-white.js +1 -1
  88. package/dist/wcardinal-ui-theme-white.min.js +1 -1
  89. package/dist/wcardinal-ui.cjs.js +1035 -131
  90. package/dist/wcardinal-ui.js +1035 -131
  91. package/dist/wcardinal-ui.min.js +2 -2
  92. package/dist/wcardinal-ui.min.js.map +1 -1
  93. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  /*!
2
- Winter Cardinal UI v0.465.0
2
+ Winter Cardinal UI v0.466.0
3
3
  Copyright (C) 2019-2026 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -58,6 +58,7 @@ var EShapeType = {
58
58
  EMBEDDED_ACCEPTOR_EDGE: 25,
59
59
  POLYGON: 26,
60
60
  CIRCLE_LEGACY: 27,
61
+ RECTANGLE_LEGACY: 28,
61
62
  EXTENSION: 1000
62
63
  };
63
64
 
@@ -1469,8 +1470,14 @@ var EShapeStrokeSide = {
1469
1470
  LEFT: LEFT$1,
1470
1471
  TOP_OR_LEFT: TOP$1 | LEFT$1,
1471
1472
  TOP_OR_RIGHT: TOP$1 | RIGHT$1,
1473
+ TOP_OR_BOTTOM: TOP$1 | BOTTOM$1,
1472
1474
  BOTTOM_OR_LEFT: BOTTOM$1 | LEFT$1,
1473
1475
  BOTTOM_OR_RIGHT: BOTTOM$1 | RIGHT$1,
1476
+ LEFT_OR_RIGHT: LEFT$1 | RIGHT$1,
1477
+ NOT_TOP: RIGHT$1 | BOTTOM$1 | LEFT$1,
1478
+ NOT_RIGHT: TOP$1 | BOTTOM$1 | LEFT$1,
1479
+ NOT_BOTTOM: TOP$1 | RIGHT$1 | LEFT$1,
1480
+ NOT_LEFT: TOP$1 | RIGHT$1 | BOTTOM$1,
1474
1481
  ALL: TOP$1 | RIGHT$1 | BOTTOM$1 | LEFT$1
1475
1482
  };
1476
1483
 
@@ -25470,22 +25477,22 @@ var EShapeRuntimeImpl = /** @class */ (function () {
25470
25477
  * Copyright (C) 2019 Toshiba Corporation
25471
25478
  * SPDX-License-Identifier: Apache-2.0
25472
25479
  */
25473
- var EShapeRectangle = /** @class */ (function (_super) {
25474
- __extends(EShapeRectangle, _super);
25475
- function EShapeRectangle(type) {
25476
- if (type === void 0) { type = EShapeType.RECTANGLE; }
25480
+ var EShapeRectangleLegacy = /** @class */ (function (_super) {
25481
+ __extends(EShapeRectangleLegacy, _super);
25482
+ function EShapeRectangleLegacy(type) {
25483
+ if (type === void 0) { type = EShapeType.RECTANGLE_LEGACY; }
25477
25484
  return _super.call(this, type) || this;
25478
25485
  }
25479
- EShapeRectangle.prototype.clone = function () {
25480
- return new EShapeRectangle(this.type).copy(this);
25486
+ EShapeRectangleLegacy.prototype.clone = function () {
25487
+ return new EShapeRectangleLegacy(this.type).copy(this);
25481
25488
  };
25482
- EShapeRectangle.prototype.containsAbs = function (x, y, ax, ay, sw, ss, sa) {
25489
+ EShapeRectangleLegacy.prototype.containsAbs = function (x, y, ax, ay, sw, ss, sa) {
25483
25490
  if (_super.prototype.containsAbsBBox.call(this, x, y, ax, ay)) {
25484
25491
  return hitTestRectangle(this, x, y, ax, ay, sw, ss);
25485
25492
  }
25486
25493
  return false;
25487
25494
  };
25488
- return EShapeRectangle;
25495
+ return EShapeRectangleLegacy;
25489
25496
  }(EShapePrimitive));
25490
25497
 
25491
25498
  /*
@@ -25505,7 +25512,7 @@ var EShapeRectanglePivoted = /** @class */ (function (_super) {
25505
25512
  return result;
25506
25513
  };
25507
25514
  return EShapeRectanglePivoted;
25508
- }(EShapeRectangle));
25515
+ }(EShapeRectangleLegacy));
25509
25516
 
25510
25517
  /*
25511
25518
  * Copyright (C) 2019 Toshiba Corporation
@@ -32742,11 +32749,12 @@ var EShapeCircleTriangulatedImpl = /** @class */ (function () {
32742
32749
  var nny = nx * fy * s + ny * c;
32743
32750
  var sx = this.toSkeletonX(ppx, ppy, px, py, nx, ny);
32744
32751
  vertices[0] = 0;
32745
- vertices[1] = scale * sizeY;
32752
+ vertices[1] = sizeY;
32746
32753
  clippings[0] = -1;
32754
+ distances[0] = sx;
32747
32755
  lengths[0] = 0;
32748
32756
  uvs[0] = 0.5;
32749
- uvs[1] = 0.5 * (scale + 1);
32757
+ uvs[1] = 1;
32750
32758
  var iv = 1;
32751
32759
  var ii = 0;
32752
32760
  var length = 0;
@@ -32769,35 +32777,41 @@ var EShapeCircleTriangulatedImpl = /** @class */ (function () {
32769
32777
  var nlength = length + dl;
32770
32778
  var iv1 = iv++;
32771
32779
  var iv2 = iv1 << 1;
32772
- var snx = scale * nx;
32773
- var sny = scale * ny;
32774
- vertices[iv2 + 0] = snx;
32775
- vertices[iv2 + 1] = sny;
32776
- clippings[iv1] = -1;
32777
- lengths[iv1] = nlength;
32778
- uvs[iv2 + 0] = 0.5 * (snx / sizeX + 1);
32779
- uvs[iv2 + 1] = 0.5 * (sny / sizeY + 1);
32780
32780
  var niv1 = iv++;
32781
32781
  var niv2 = niv1 << 1;
32782
32782
  var ndistance = Math.abs(-dx * py - dy * (nsx - px)) * fl;
32783
+ maxDistance = Math.max(maxDistance, ndistance);
32784
+ vertices[iv2 + 0] = nx;
32785
+ vertices[iv2 + 1] = ny;
32786
+ clippings[iv1] = -1 - ndistance;
32787
+ distances[iv1] = nsx;
32788
+ lengths[iv1] = nlength;
32789
+ uvs[iv2 + 0] = 0.5 * (nx / sizeX + 1);
32790
+ uvs[iv2 + 1] = 0.5 * (ny / sizeY + 1);
32783
32791
  vertices[niv2 + 0] = nsx;
32784
32792
  vertices[niv2 + 1] = 0;
32785
32793
  clippings[niv1] = ndistance;
32786
- maxDistance = Math.max(maxDistance, ndistance);
32794
+ distances[niv1] = 0;
32787
32795
  lengths[niv1] = length + ((nsx - px) * dx - py * dy) * fl;
32788
32796
  uvs[niv2] = 0.5 * (nsx / sizeX + 1);
32789
32797
  uvs[niv2 + 1] = 0.5;
32790
32798
  indices[ii++] = current;
32791
32799
  indices[ii++] = iv1;
32792
32800
  indices[ii++] = niv1;
32793
- if (sx !== nsx) {
32801
+ distances[current] = sx;
32802
+ if (sx === nsx) {
32803
+ clippings[current] = -1 - ndistance;
32804
+ }
32805
+ else {
32806
+ var mdistance = Math.abs(-dx * py - dy * (sx - px)) * fl;
32807
+ maxDistance = Math.max(maxDistance, mdistance);
32808
+ clippings[current] = -1 - mdistance;
32794
32809
  var miv1 = iv++;
32795
32810
  var miv2 = miv1 << 1;
32796
- var mdistance = Math.abs(-dx * py - dy * (sx - px)) * fl;
32797
32811
  vertices[miv2] = sx;
32798
32812
  vertices[miv2 + 1] = 0;
32799
32813
  clippings[miv1] = mdistance;
32800
- maxDistance = Math.max(maxDistance, mdistance);
32814
+ distances[miv1] = 0;
32801
32815
  lengths[miv1] = length + ((sx - px) * dx - py * dy) * fl;
32802
32816
  uvs[miv2] = 0.5 * (sx / sizeX + 1);
32803
32817
  uvs[miv2 + 1] = 0.5;
@@ -32819,15 +32833,27 @@ var EShapeCircleTriangulatedImpl = /** @class */ (function () {
32819
32833
  if (0 < maxDistance) {
32820
32834
  fdistance = 1 / maxDistance;
32821
32835
  }
32836
+ var shift = (scale - 1) * maxDistance;
32822
32837
  for (var i = 0; i < iv; ++i) {
32823
- distances[i] = fdistance;
32824
32838
  var clipping = clippings[i];
32825
32839
  if (0 <= clipping) {
32826
32840
  clippings[i] = 1 - clipping * fdistance;
32827
32841
  }
32828
32842
  else {
32843
+ var distance = -1 - clipping;
32844
+ if (0 < distance) {
32845
+ var i2 = i << 1;
32846
+ var factor = shift / distance;
32847
+ var x = vertices[i2] + (vertices[i2] - distances[i]) * factor;
32848
+ var y = vertices[i2 + 1] * (1 + factor);
32849
+ vertices[i2] = x;
32850
+ vertices[i2 + 1] = y;
32851
+ uvs[i2] = 0.5 * (x / sizeX + 1);
32852
+ uvs[i2 + 1] = 0.5 * (y / sizeY + 1);
32853
+ }
32829
32854
  clippings[i] = scale;
32830
32855
  }
32856
+ distances[i] = fdistance;
32831
32857
  }
32832
32858
  // The skeleton points of adjacent vertices may coincide on a nearly circular ellipse.
32833
32859
  this.pad(iv, ii, nv, ni, fdistance);
@@ -32872,11 +32898,12 @@ var EShapeCircleTriangulatedImpl = /** @class */ (function () {
32872
32898
  var nny = s * nx * fy + c * ny;
32873
32899
  var sy = this.toSkeletonY(pppx, pppy, ppx, ppy, px, py);
32874
32900
  vertices[0] = 0;
32875
- vertices[1] = scale * sizeY;
32901
+ vertices[1] = sizeY;
32876
32902
  clippings[0] = -1;
32903
+ distances[0] = sy;
32877
32904
  lengths[0] = 0;
32878
32905
  uvs[0] = 0.5;
32879
- uvs[1] = 0.5 * (scale + 1);
32906
+ uvs[1] = 1;
32880
32907
  var iv = 1;
32881
32908
  var ii = 0;
32882
32909
  var length = 0;
@@ -32899,35 +32926,41 @@ var EShapeCircleTriangulatedImpl = /** @class */ (function () {
32899
32926
  var nlength = length + dl;
32900
32927
  var iv1 = iv++;
32901
32928
  var iv2 = iv1 << 1;
32902
- var snx = scale * nx;
32903
- var sny = scale * ny;
32904
- vertices[iv2 + 0] = snx;
32905
- vertices[iv2 + 1] = sny;
32906
- clippings[iv1] = -1;
32907
- lengths[iv1] = nlength;
32908
- uvs[iv2 + 0] = 0.5 * (snx / sizeX + 1);
32909
- uvs[iv2 + 1] = 0.5 * (sny / sizeY + 1);
32910
32929
  var niv1 = iv++;
32911
32930
  var niv2 = niv1 << 1;
32912
32931
  var ndistance = Math.abs(dx * (nsy - py) + dy * px) * fl;
32932
+ maxDistance = Math.max(maxDistance, ndistance);
32933
+ vertices[iv2 + 0] = nx;
32934
+ vertices[iv2 + 1] = ny;
32935
+ clippings[iv1] = -1 - ndistance;
32936
+ distances[iv1] = nsy;
32937
+ lengths[iv1] = nlength;
32938
+ uvs[iv2 + 0] = 0.5 * (nx / sizeX + 1);
32939
+ uvs[iv2 + 1] = 0.5 * (ny / sizeY + 1);
32913
32940
  vertices[niv2] = 0;
32914
32941
  vertices[niv2 + 1] = nsy;
32915
32942
  clippings[niv1] = ndistance;
32916
- maxDistance = Math.max(maxDistance, ndistance);
32943
+ distances[niv1] = 0;
32917
32944
  lengths[niv1] = length + (-px * dx + (nsy - py) * dy) * fl;
32918
32945
  uvs[niv2] = 0.5;
32919
32946
  uvs[niv2 + 1] = 0.5 * (nsy / sizeY + 1);
32920
32947
  indices[ii++] = current;
32921
32948
  indices[ii++] = iv1;
32922
32949
  indices[ii++] = niv1;
32923
- if (sy !== nsy) {
32950
+ distances[current] = sy;
32951
+ if (sy === nsy) {
32952
+ clippings[current] = -1 - ndistance;
32953
+ }
32954
+ else {
32955
+ var mdistance = Math.abs(dx * (sy - py) + dy * px) * fl;
32956
+ maxDistance = Math.max(maxDistance, mdistance);
32957
+ clippings[current] = -1 - mdistance;
32924
32958
  var miv1 = iv++;
32925
32959
  var miv2 = miv1 << 1;
32926
- var mdistance = Math.abs(dx * (sy - py) + dy * px) * fl;
32927
32960
  vertices[miv2] = 0;
32928
32961
  vertices[miv2 + 1] = sy;
32929
32962
  clippings[miv1] = mdistance;
32930
- maxDistance = Math.max(maxDistance, mdistance);
32963
+ distances[miv1] = 0;
32931
32964
  lengths[miv1] = length + (-px * dx + (sy - py) * dy) * fl;
32932
32965
  uvs[miv2] = 0.5;
32933
32966
  uvs[miv2 + 1] = 0.5 * (sy / sizeY + 1);
@@ -32949,15 +32982,27 @@ var EShapeCircleTriangulatedImpl = /** @class */ (function () {
32949
32982
  if (0 < maxDistance) {
32950
32983
  fdistance = 1 / maxDistance;
32951
32984
  }
32985
+ var shift = (scale - 1) * maxDistance;
32952
32986
  for (var i = 0; i < iv; ++i) {
32953
- distances[i] = fdistance;
32954
32987
  var clipping = clippings[i];
32955
32988
  if (0 <= clipping) {
32956
32989
  clippings[i] = 1 - clipping * fdistance;
32957
32990
  }
32958
32991
  else {
32992
+ var distance = -1 - clipping;
32993
+ if (0 < distance) {
32994
+ var i2 = i << 1;
32995
+ var factor = shift / distance;
32996
+ var x = vertices[i2] * (1 + factor);
32997
+ var y = vertices[i2 + 1] + (vertices[i2 + 1] - distances[i]) * factor;
32998
+ vertices[i2] = x;
32999
+ vertices[i2 + 1] = y;
33000
+ uvs[i2] = 0.5 * (x / sizeX + 1);
33001
+ uvs[i2 + 1] = 0.5 * (y / sizeY + 1);
33002
+ }
32959
33003
  clippings[i] = scale;
32960
33004
  }
33005
+ distances[i] = fdistance;
32961
33006
  }
32962
33007
  // The skeleton points of adjacent vertices may coincide on a nearly circular ellipse.
32963
33008
  this.pad(iv, ii, nv, ni, fdistance);
@@ -64669,7 +64714,7 @@ var buildPolygonVertex = function (vertices, polygonVertices, voffset, internalT
64669
64714
  var buildPolygonStep = function (steps, polygonDistances, polygonLengths, polygonClippings, polygonUvs, polygonBoundary, voffset, vertexCount, fillDirection, fillPercent, strokeWidth, strokeSide, strokeStyle) {
64670
64715
  var scaleInvariant = toScaleInvariant(strokeStyle);
64671
64716
  var dash = toDash(strokeStyle);
64672
- var w = (strokeSide & EShapeStrokeSide.ALL) === EShapeStrokeSide.ALL ? 1 : 0;
64717
+ var w = strokeSide !== EShapeStrokeSide.NONE ? 1 : 0;
64673
64718
  var e = toPackedI4x64(7 + dash, scaleInvariant, w, 0);
64674
64719
  var fp = Math.max(0, Math.min(1, fillPercent));
64675
64720
  switch (fillDirection) {
@@ -66042,11 +66087,10 @@ var buildNullUv = function (uvs, voffset, vcount) {
66042
66087
  }
66043
66088
  };
66044
66089
 
66045
- var RECTANGLE_VERTEX_COUNT = 16;
66046
- var RECTANGLE_INDEX_COUNT = 8;
66047
- var RECTANGLE_WORLD_SIZE = [0, 0];
66048
- var RECTANGLE_WORK_POINT = new pixi_js.Point();
66049
- var buildRectangleIndex = function (indices, voffset, ioffset) {
66090
+ var RECTANGLE_LEGACY_VERTEX_COUNT = 16;
66091
+ var RECTANGLE_LEGACY_INDEX_COUNT = 8;
66092
+ var RECTANGLE_LEGACY_WORLD_SIZE = [0, 0];
66093
+ var buildRectangleLegacyIndex = function (indices, voffset, ioffset) {
66050
66094
  // c0 c1 c4 c5
66051
66095
  // |-----| |-----|
66052
66096
  // | | | |
@@ -66084,7 +66128,7 @@ var buildRectangleIndex = function (indices, voffset, ioffset) {
66084
66128
  indices[++ii] = voffset + 13;
66085
66129
  indices[++ii] = voffset + 15;
66086
66130
  };
66087
- var buildRectangleVertex = function (vertices, voffset, originX, originY, sizeX, sizeY, strokeAlign, strokeWidth, internalTransform, worldSize) {
66131
+ var buildRectangleLegacyVertex = function (vertices, voffset, originX, originY, sizeX, sizeY, strokeAlign, strokeWidth, internalTransform, worldSize) {
66088
66132
  // b0 b1 b2
66089
66133
  // |-------|-------|
66090
66134
  // | | |
@@ -66092,22 +66136,21 @@ var buildRectangleVertex = function (vertices, voffset, originX, originY, sizeX,
66092
66136
  // | | |
66093
66137
  // |-------|-------|
66094
66138
  // b6 b7 b8
66139
+ var a = internalTransform.a;
66140
+ var b = internalTransform.b;
66141
+ var c = internalTransform.c;
66142
+ var d = internalTransform.d;
66143
+ var tx = internalTransform.tx;
66144
+ var ty = internalTransform.ty;
66095
66145
  var s = strokeAlign * strokeWidth;
66096
66146
  var sx = sizeX * 0.5 + (0 <= sizeX ? +s : -s);
66097
66147
  var sy = sizeY * 0.5 + (0 <= sizeY ? +s : -s);
66098
- var work = RECTANGLE_WORK_POINT;
66099
- work.set(originX - sx, originY - sy);
66100
- internalTransform.apply(work, work);
66101
- var b0x = work.x;
66102
- var b0y = work.y;
66103
- work.set(originX, originY - sy);
66104
- internalTransform.apply(work, work);
66105
- var b1x = work.x;
66106
- var b1y = work.y;
66107
- work.set(originX - sx, originY);
66108
- internalTransform.apply(work, work);
66109
- var b3x = work.x;
66110
- var b3y = work.y;
66148
+ var b0x = a * (originX - sx) + c * (originY - sy) + tx;
66149
+ var b0y = b * (originX - sx) + d * (originY - sy) + ty;
66150
+ var b1x = a * originX + c * (originY - sy) + tx;
66151
+ var b1y = b * originX + d * (originY - sy) + ty;
66152
+ var b3x = a * (originX - sx) + c * originY + tx;
66153
+ var b3y = b * (originX - sx) + d * originY + ty;
66111
66154
  var d01x = b1x - b0x;
66112
66155
  var d01y = b1y - b0y;
66113
66156
  var d03x = b3x - b0x;
@@ -66172,7 +66215,7 @@ var buildRectangleVertex = function (vertices, voffset, originX, originY, sizeX,
66172
66215
  worldSize[0] = toLength(b0x, b0y, b1x, b1y);
66173
66216
  worldSize[1] = toLength(b0x, b0y, b3x, b3y);
66174
66217
  };
66175
- var buildRectangleStep = function (voffset, steps, strokeWidth, strokeSide, strokeStyle, worldSize) {
66218
+ var buildRectangleLegacyStep = function (voffset, steps, strokeWidth, strokeSide, strokeStyle, worldSize) {
66176
66219
  var scaleInvariant = toScaleInvariant(strokeStyle);
66177
66220
  var ax = worldSize[0];
66178
66221
  var ay = worldSize[1];
@@ -66300,7 +66343,7 @@ var buildRectangleStep = function (voffset, steps, strokeWidth, strokeSide, stro
66300
66343
  steps[++is] = c11;
66301
66344
  steps[++is] = 0;
66302
66345
  };
66303
- var buildRectangleUv = function (uvs, voffset, textureUvs) {
66346
+ var buildRectangleLegacyUv = function (uvs, voffset, textureUvs) {
66304
66347
  // b0 b1 b2
66305
66348
  // |-------|-------|
66306
66349
  // | | |
@@ -68448,8 +68491,8 @@ var BuilderLineOfRectangles = /** @class */ (function (_super) {
68448
68491
  var ioffset = this.indexOffset;
68449
68492
  var pointCountReserved = this.pointCountReserved;
68450
68493
  if (0 < pointCountReserved) {
68451
- buildRectangleIndex(indices, voffset, ioffset);
68452
- copyIndex(indices, RECTANGLE_VERTEX_COUNT, ioffset, RECTANGLE_INDEX_COUNT, pointCountReserved);
68494
+ buildRectangleLegacyIndex(indices, voffset, ioffset);
68495
+ copyIndex(indices, RECTANGLE_LEGACY_VERTEX_COUNT, ioffset, RECTANGLE_LEGACY_INDEX_COUNT, pointCountReserved);
68453
68496
  }
68454
68497
  this.inited |= BuilderFlag.INDEX;
68455
68498
  };
@@ -68458,7 +68501,7 @@ var BuilderLineOfRectangles = /** @class */ (function (_super) {
68458
68501
  if (points instanceof EShapeLineOfAnyPointsImpl) {
68459
68502
  var buffer = this.buffer;
68460
68503
  this.updateVertexStepAndUv(buffer, shape, points);
68461
- this.updateLineOfAnyColor(buffer, shape, points, RECTANGLE_VERTEX_COUNT);
68504
+ this.updateLineOfAnyColor(buffer, shape, points, RECTANGLE_LEGACY_VERTEX_COUNT);
68462
68505
  }
68463
68506
  };
68464
68507
  BuilderLineOfRectangles.prototype.updateVertexStepAndUv = function (buffer, shape, points) {
@@ -68523,17 +68566,17 @@ var BuilderLineOfRectangles = /** @class */ (function (_super) {
68523
68566
  var pointSizeX = pointSize.getX(0);
68524
68567
  var pointSizeY = pointSize.getY(0);
68525
68568
  // Vertices
68526
- buildRectangleVertex(vertices, voffset, 0, 0, pointSizeX, pointSizeY, strokeAlign, strokeWidth, internalTransform, RECTANGLE_WORLD_SIZE);
68527
- copyVertex(vertices, internalTransform, voffset, RECTANGLE_VERTEX_COUNT, pointCount, pointsValues, pointOffset);
68569
+ buildRectangleLegacyVertex(vertices, voffset, 0, 0, pointSizeX, pointSizeY, strokeAlign, strokeWidth, internalTransform, RECTANGLE_LEGACY_WORLD_SIZE);
68570
+ copyVertex(vertices, internalTransform, voffset, RECTANGLE_LEGACY_VERTEX_COUNT, pointCount, pointsValues, pointOffset);
68528
68571
  // Steps
68529
68572
  if (isNotInited || isVertexChanged || isTransformChanged) {
68530
- buildRectangleStep(voffset, steps, strokeWidth, strokeSide, strokeStyle, RECTANGLE_WORLD_SIZE);
68531
- copyStep(steps, voffset, RECTANGLE_VERTEX_COUNT, pointCount);
68573
+ buildRectangleLegacyStep(voffset, steps, strokeWidth, strokeSide, strokeStyle, RECTANGLE_LEGACY_WORLD_SIZE);
68574
+ copyStep(steps, voffset, RECTANGLE_LEGACY_VERTEX_COUNT, pointCount);
68532
68575
  }
68533
68576
  // UVs
68534
68577
  if (isNotInited || isVertexChanged || isTextureChanged) {
68535
- buildRectangleUv(uvs, voffset, textureUvs);
68536
- copyUvs(uvs, voffset, RECTANGLE_VERTEX_COUNT, pointCount);
68578
+ buildRectangleLegacyUv(uvs, voffset, textureUvs);
68579
+ copyUvs(uvs, voffset, RECTANGLE_LEGACY_VERTEX_COUNT, pointCount);
68537
68580
  }
68538
68581
  }
68539
68582
  else {
@@ -68543,23 +68586,23 @@ var BuilderLineOfRectangles = /** @class */ (function (_super) {
68543
68586
  var py = pointsValues[ip + 1] + pointOffset.getY(i);
68544
68587
  var pointSizeX = pointSize.getX(i);
68545
68588
  var pointSizeY = pointSize.getY(i);
68546
- var iv = voffset + i * RECTANGLE_VERTEX_COUNT;
68589
+ var iv = voffset + i * RECTANGLE_LEGACY_VERTEX_COUNT;
68547
68590
  // Vertices
68548
- buildRectangleVertex(vertices, iv, px, py, pointSizeX, pointSizeY, strokeAlign, strokeWidth, internalTransform, RECTANGLE_WORLD_SIZE);
68591
+ buildRectangleLegacyVertex(vertices, iv, px, py, pointSizeX, pointSizeY, strokeAlign, strokeWidth, internalTransform, RECTANGLE_LEGACY_WORLD_SIZE);
68549
68592
  // Steps
68550
68593
  if (isNotInited || isVertexChanged || isTransformChanged) {
68551
- buildRectangleStep(iv, steps, strokeWidth, strokeSide, strokeStyle, RECTANGLE_WORLD_SIZE);
68594
+ buildRectangleLegacyStep(iv, steps, strokeWidth, strokeSide, strokeStyle, RECTANGLE_LEGACY_WORLD_SIZE);
68552
68595
  }
68553
68596
  // UVs
68554
68597
  if (isNotInited || isVertexChanged || isTextureChanged) {
68555
- buildRectangleUv(uvs, iv, textureUvs);
68598
+ buildRectangleLegacyUv(uvs, iv, textureUvs);
68556
68599
  }
68557
68600
  }
68558
68601
  }
68559
68602
  // Fill the rest
68560
68603
  var pointCountReserved = this.pointCountReserved;
68561
- var voffsetReserved = voffset + pointCount * RECTANGLE_VERTEX_COUNT;
68562
- var vcountReserved = RECTANGLE_VERTEX_COUNT * (pointCountReserved - pointCount);
68604
+ var voffsetReserved = voffset + pointCount * RECTANGLE_LEGACY_VERTEX_COUNT;
68605
+ var vcountReserved = RECTANGLE_LEGACY_VERTEX_COUNT * (pointCountReserved - pointCount);
68563
68606
  buildNullVertex(vertices, voffsetReserved, vcountReserved);
68564
68607
  buildNullStep(steps, voffsetReserved, vcountReserved);
68565
68608
  buildNullUv(uvs, voffsetReserved, vcountReserved);
@@ -69126,14 +69169,14 @@ var BuilderMarkerCircleTail = /** @class */ (function (_super) {
69126
69169
  var BuilderMarkerRectangle = /** @class */ (function (_super) {
69127
69170
  __extends(BuilderMarkerRectangle, _super);
69128
69171
  function BuilderMarkerRectangle(buffer, vertexOffset, indexOffset) {
69129
- var _this = _super.call(this, buffer, vertexOffset, indexOffset, RECTANGLE_VERTEX_COUNT, RECTANGLE_INDEX_COUNT) || this;
69172
+ var _this = _super.call(this, buffer, vertexOffset, indexOffset, RECTANGLE_LEGACY_VERTEX_COUNT, RECTANGLE_LEGACY_INDEX_COUNT) || this;
69130
69173
  _this.pointId = -1;
69131
69174
  return _this;
69132
69175
  }
69133
69176
  BuilderMarkerRectangle.prototype.init = function () {
69134
69177
  var buffer = this.buffer;
69135
69178
  buffer.updateIndices();
69136
- buildRectangleIndex(buffer.indices, this.vertexOffset, this.indexOffset);
69179
+ buildRectangleLegacyIndex(buffer.indices, this.vertexOffset, this.indexOffset);
69137
69180
  this.inited |= BuilderFlag.INDEX;
69138
69181
  };
69139
69182
  BuilderMarkerRectangle.prototype.update = function (shape) {
@@ -69194,16 +69237,16 @@ var BuilderMarkerRectangle = /** @class */ (function (_super) {
69194
69237
  var internalTransform = ((_a = BuilderMarkerRectangle.WORK) !== null && _a !== void 0 ? _a : (BuilderMarkerRectangle.WORK = new pixi_js.Matrix()));
69195
69238
  internalTransform.copyFrom(marker.transform).prepend(shape.transform.internalTransform);
69196
69239
  buffer.updateVertices();
69197
- buildRectangleVertex(buffer.vertices, voffset, 0, 0, sizeX, sizeY, strokeAlign, strokeWidth, internalTransform, RECTANGLE_WORLD_SIZE);
69240
+ buildRectangleLegacyVertex(buffer.vertices, voffset, 0, 0, sizeX, sizeY, strokeAlign, strokeWidth, internalTransform, RECTANGLE_LEGACY_WORLD_SIZE);
69198
69241
  // Steps
69199
69242
  if (isNotInited || isVertexChanged || isTransformChanged) {
69200
69243
  buffer.updateSteps();
69201
- buildRectangleStep(voffset, buffer.steps, strokeWidth, strokeSide, strokeStyle, RECTANGLE_WORLD_SIZE);
69244
+ buildRectangleLegacyStep(voffset, buffer.steps, strokeWidth, strokeSide, strokeStyle, RECTANGLE_LEGACY_WORLD_SIZE);
69202
69245
  }
69203
69246
  // UVs
69204
69247
  if (isNotInited || isVertexChanged || isTextureChanged) {
69205
69248
  buffer.updateUvs();
69206
- buildRectangleUv(buffer.uvs, voffset, toTextureUvs(texture));
69249
+ buildRectangleLegacyUv(buffer.uvs, voffset, toTextureUvs(texture));
69207
69250
  }
69208
69251
  }
69209
69252
  };
@@ -69400,23 +69443,23 @@ var BuilderNull = /** @class */ (function () {
69400
69443
  * Copyright (C) 2019 Toshiba Corporation
69401
69444
  * SPDX-License-Identifier: Apache-2.0
69402
69445
  */
69403
- var BuilderRectanglePivoted = /** @class */ (function (_super) {
69404
- __extends(BuilderRectanglePivoted, _super);
69405
- function BuilderRectanglePivoted(buffer, vertexOffset, indexOffset) {
69406
- return _super.call(this, buffer, vertexOffset, indexOffset, RECTANGLE_VERTEX_COUNT, RECTANGLE_INDEX_COUNT) || this;
69446
+ var BuilderRectangleLegacy = /** @class */ (function (_super) {
69447
+ __extends(BuilderRectangleLegacy, _super);
69448
+ function BuilderRectangleLegacy(buffer, vertexOffset, indexOffset) {
69449
+ return _super.call(this, buffer, vertexOffset, indexOffset, RECTANGLE_LEGACY_VERTEX_COUNT, RECTANGLE_LEGACY_INDEX_COUNT) || this;
69407
69450
  }
69408
- BuilderRectanglePivoted.prototype.init = function () {
69451
+ BuilderRectangleLegacy.prototype.init = function () {
69409
69452
  var buffer = this.buffer;
69410
69453
  buffer.updateIndices();
69411
- buildRectangleIndex(buffer.indices, this.vertexOffset, this.indexOffset);
69454
+ buildRectangleLegacyIndex(buffer.indices, this.vertexOffset, this.indexOffset);
69412
69455
  this.inited |= BuilderFlag.INDEX;
69413
69456
  };
69414
- BuilderRectanglePivoted.prototype.update = function (shape) {
69457
+ BuilderRectangleLegacy.prototype.update = function (shape) {
69415
69458
  var buffer = this.buffer;
69416
69459
  this.updateVertexStepAndUv(buffer, shape);
69417
69460
  this.updateColor(buffer, shape);
69418
69461
  };
69419
- BuilderRectanglePivoted.prototype.updateVertexStepAndUv = function (buffer, shape) {
69462
+ BuilderRectangleLegacy.prototype.updateVertexStepAndUv = function (buffer, shape) {
69420
69463
  var size = shape.size;
69421
69464
  var sizeX = size.x;
69422
69465
  var sizeY = size.y;
@@ -69451,43 +69494,43 @@ var BuilderRectanglePivoted = /** @class */ (function (_super) {
69451
69494
  // Vertices
69452
69495
  var voffset = this.vertexOffset;
69453
69496
  buffer.updateVertices();
69454
- buildRectangleVertex(buffer.vertices, voffset, 0.5 * sizeX, 0.5 * sizeY, sizeX, sizeY, strokeAlign, strokeWidth, shape.transform.internalTransform, RECTANGLE_WORLD_SIZE);
69497
+ buildRectangleLegacyVertex(buffer.vertices, voffset, 0, 0, sizeX, sizeY, strokeAlign, strokeWidth, shape.transform.internalTransform, RECTANGLE_LEGACY_WORLD_SIZE);
69455
69498
  // Steps
69456
69499
  if (isNotInited || isVertexChanged || isTransformChanged) {
69457
69500
  buffer.updateSteps();
69458
- buildRectangleStep(voffset, buffer.steps, strokeWidth, strokeSide, strokeStyle, RECTANGLE_WORLD_SIZE);
69501
+ buildRectangleLegacyStep(voffset, buffer.steps, strokeWidth, strokeSide, strokeStyle, RECTANGLE_LEGACY_WORLD_SIZE);
69459
69502
  }
69460
69503
  // UVs
69461
69504
  if (isNotInited || isVertexChanged || isTextureChanged) {
69462
69505
  buffer.updateUvs();
69463
- buildRectangleUv(buffer.uvs, voffset, toTextureUvs(texture));
69506
+ buildRectangleLegacyUv(buffer.uvs, voffset, toTextureUvs(texture));
69464
69507
  }
69465
69508
  }
69466
69509
  };
69467
- return BuilderRectanglePivoted;
69510
+ return BuilderRectangleLegacy;
69468
69511
  }(BuilderBase));
69469
69512
 
69470
69513
  /*
69471
69514
  * Copyright (C) 2019 Toshiba Corporation
69472
69515
  * SPDX-License-Identifier: Apache-2.0
69473
69516
  */
69474
- var BuilderRectangle = /** @class */ (function (_super) {
69475
- __extends(BuilderRectangle, _super);
69476
- function BuilderRectangle(buffer, vertexOffset, indexOffset) {
69477
- return _super.call(this, buffer, vertexOffset, indexOffset, RECTANGLE_VERTEX_COUNT, RECTANGLE_INDEX_COUNT) || this;
69517
+ var BuilderRectanglePivoted = /** @class */ (function (_super) {
69518
+ __extends(BuilderRectanglePivoted, _super);
69519
+ function BuilderRectanglePivoted(buffer, vertexOffset, indexOffset) {
69520
+ return _super.call(this, buffer, vertexOffset, indexOffset, RECTANGLE_LEGACY_VERTEX_COUNT, RECTANGLE_LEGACY_INDEX_COUNT) || this;
69478
69521
  }
69479
- BuilderRectangle.prototype.init = function () {
69522
+ BuilderRectanglePivoted.prototype.init = function () {
69480
69523
  var buffer = this.buffer;
69481
69524
  buffer.updateIndices();
69482
- buildRectangleIndex(buffer.indices, this.vertexOffset, this.indexOffset);
69525
+ buildRectangleLegacyIndex(buffer.indices, this.vertexOffset, this.indexOffset);
69483
69526
  this.inited |= BuilderFlag.INDEX;
69484
69527
  };
69485
- BuilderRectangle.prototype.update = function (shape) {
69528
+ BuilderRectanglePivoted.prototype.update = function (shape) {
69486
69529
  var buffer = this.buffer;
69487
69530
  this.updateVertexStepAndUv(buffer, shape);
69488
69531
  this.updateColor(buffer, shape);
69489
69532
  };
69490
- BuilderRectangle.prototype.updateVertexStepAndUv = function (buffer, shape) {
69533
+ BuilderRectanglePivoted.prototype.updateVertexStepAndUv = function (buffer, shape) {
69491
69534
  var size = shape.size;
69492
69535
  var sizeX = size.x;
69493
69536
  var sizeY = size.y;
@@ -69522,20 +69565,20 @@ var BuilderRectangle = /** @class */ (function (_super) {
69522
69565
  // Vertices
69523
69566
  var voffset = this.vertexOffset;
69524
69567
  buffer.updateVertices();
69525
- buildRectangleVertex(buffer.vertices, voffset, 0, 0, sizeX, sizeY, strokeAlign, strokeWidth, shape.transform.internalTransform, RECTANGLE_WORLD_SIZE);
69568
+ buildRectangleLegacyVertex(buffer.vertices, voffset, 0.5 * sizeX, 0.5 * sizeY, sizeX, sizeY, strokeAlign, strokeWidth, shape.transform.internalTransform, RECTANGLE_LEGACY_WORLD_SIZE);
69526
69569
  // Steps
69527
69570
  if (isNotInited || isVertexChanged || isTransformChanged) {
69528
69571
  buffer.updateSteps();
69529
- buildRectangleStep(voffset, buffer.steps, strokeWidth, strokeSide, strokeStyle, RECTANGLE_WORLD_SIZE);
69572
+ buildRectangleLegacyStep(voffset, buffer.steps, strokeWidth, strokeSide, strokeStyle, RECTANGLE_LEGACY_WORLD_SIZE);
69530
69573
  }
69531
69574
  // UVs
69532
69575
  if (isNotInited || isVertexChanged || isTextureChanged) {
69533
69576
  buffer.updateUvs();
69534
- buildRectangleUv(buffer.uvs, voffset, toTextureUvs(texture));
69577
+ buildRectangleLegacyUv(buffer.uvs, voffset, toTextureUvs(texture));
69535
69578
  }
69536
69579
  }
69537
69580
  };
69538
- return BuilderRectangle;
69581
+ return BuilderRectanglePivoted;
69539
69582
  }(BuilderBase));
69540
69583
 
69541
69584
  /*
@@ -69807,6 +69850,834 @@ var createImageSdfUploaded = function (buffer, shape, voffset, ioffset, antialia
69807
69850
  return null;
69808
69851
  };
69809
69852
 
69853
+ /*
69854
+ * Copyright (C) 2019-2026 Toshiba Corporation
69855
+ * SPDX-License-Identifier: Apache-2.0
69856
+ */
69857
+ var EShapeRectangleTriangulatedImpl = /** @class */ (function () {
69858
+ function EShapeRectangleTriangulatedImpl(parent) {
69859
+ this._id = 0;
69860
+ this._parent = parent;
69861
+ this._width = 0;
69862
+ this._height = 0;
69863
+ this._strokeAlign = 0;
69864
+ this._strokeWidth = 0;
69865
+ this._strokeSide = EShapeStrokeSide.NONE;
69866
+ this._sizeX = 0;
69867
+ this._sizeY = 0;
69868
+ this._vertices = [];
69869
+ this._nvertices = 0;
69870
+ this._distances = [];
69871
+ this._lengths = [];
69872
+ this._clippings = [];
69873
+ this._uvs = [];
69874
+ this._indices = [];
69875
+ this._nindices = 0;
69876
+ this._boundary = [0, 0, 0, 0];
69877
+ }
69878
+ Object.defineProperty(EShapeRectangleTriangulatedImpl.prototype, "id", {
69879
+ get: function () {
69880
+ this.triangulate();
69881
+ return this._id;
69882
+ },
69883
+ enumerable: false,
69884
+ configurable: true
69885
+ });
69886
+ Object.defineProperty(EShapeRectangleTriangulatedImpl.prototype, "vertices", {
69887
+ get: function () {
69888
+ this.triangulate();
69889
+ return this._vertices;
69890
+ },
69891
+ enumerable: false,
69892
+ configurable: true
69893
+ });
69894
+ Object.defineProperty(EShapeRectangleTriangulatedImpl.prototype, "nvertices", {
69895
+ get: function () {
69896
+ this.triangulate();
69897
+ return this._nvertices;
69898
+ },
69899
+ enumerable: false,
69900
+ configurable: true
69901
+ });
69902
+ Object.defineProperty(EShapeRectangleTriangulatedImpl.prototype, "distances", {
69903
+ get: function () {
69904
+ this.triangulate();
69905
+ return this._distances;
69906
+ },
69907
+ enumerable: false,
69908
+ configurable: true
69909
+ });
69910
+ Object.defineProperty(EShapeRectangleTriangulatedImpl.prototype, "lengths", {
69911
+ get: function () {
69912
+ this.triangulate();
69913
+ return this._lengths;
69914
+ },
69915
+ enumerable: false,
69916
+ configurable: true
69917
+ });
69918
+ Object.defineProperty(EShapeRectangleTriangulatedImpl.prototype, "clippings", {
69919
+ get: function () {
69920
+ this.triangulate();
69921
+ return this._clippings;
69922
+ },
69923
+ enumerable: false,
69924
+ configurable: true
69925
+ });
69926
+ Object.defineProperty(EShapeRectangleTriangulatedImpl.prototype, "uvs", {
69927
+ get: function () {
69928
+ this.triangulate();
69929
+ return this._uvs;
69930
+ },
69931
+ enumerable: false,
69932
+ configurable: true
69933
+ });
69934
+ Object.defineProperty(EShapeRectangleTriangulatedImpl.prototype, "indices", {
69935
+ get: function () {
69936
+ this.triangulate();
69937
+ return this._indices;
69938
+ },
69939
+ enumerable: false,
69940
+ configurable: true
69941
+ });
69942
+ Object.defineProperty(EShapeRectangleTriangulatedImpl.prototype, "nindices", {
69943
+ get: function () {
69944
+ this.triangulate();
69945
+ return this._nindices;
69946
+ },
69947
+ enumerable: false,
69948
+ configurable: true
69949
+ });
69950
+ Object.defineProperty(EShapeRectangleTriangulatedImpl.prototype, "boundary", {
69951
+ get: function () {
69952
+ this.triangulate();
69953
+ return this._boundary;
69954
+ },
69955
+ enumerable: false,
69956
+ configurable: true
69957
+ });
69958
+ EShapeRectangleTriangulatedImpl.prototype.triangulate = function () {
69959
+ var isNotInitialized = this._id === 0;
69960
+ var parent = this._parent;
69961
+ var size = parent.size;
69962
+ var width = size.x;
69963
+ var height = size.y;
69964
+ var isRectChanged = this._width !== width || this._height !== height;
69965
+ var stroke = parent.stroke;
69966
+ var strokeAlign = stroke.align;
69967
+ var strokeWidth = stroke.enable ? stroke.width : 0;
69968
+ var strokeSide = stroke.side;
69969
+ var isStrokeChanged = this._strokeAlign !== strokeAlign ||
69970
+ this._strokeWidth !== strokeWidth ||
69971
+ this._strokeSide !== strokeSide;
69972
+ var isSizeChanged = false;
69973
+ var sizeX = this._sizeX;
69974
+ var sizeY = this._sizeY;
69975
+ if (isRectChanged || isStrokeChanged) {
69976
+ this._width = width;
69977
+ this._height = height;
69978
+ this._strokeAlign = strokeAlign;
69979
+ this._strokeWidth = strokeWidth;
69980
+ this._strokeSide = strokeSide;
69981
+ var s = strokeAlign * strokeWidth;
69982
+ sizeX = width * 0.5 + (0 <= width ? +s : -s);
69983
+ sizeY = height * 0.5 + (0 <= height ? +s : -s);
69984
+ isSizeChanged = this._sizeX !== sizeX || this._sizeY !== sizeY;
69985
+ }
69986
+ if (isNotInitialized || isSizeChanged || isStrokeChanged) {
69987
+ this._sizeX = sizeX;
69988
+ this._sizeY = sizeY;
69989
+ this.update(sizeX, sizeY, 1.1);
69990
+ }
69991
+ };
69992
+ EShapeRectangleTriangulatedImpl.prototype.update = function (sizeX, sizeY, scale) {
69993
+ // Boundary
69994
+ var ax = Math.abs(sizeX);
69995
+ var ay = Math.abs(sizeY);
69996
+ var boundary = this._boundary;
69997
+ boundary[0] = -ax;
69998
+ boundary[1] = -ay;
69999
+ boundary[2] = +ax;
70000
+ boundary[3] = +ay;
70001
+ // # of vertices and # of indices
70002
+ var nv = 14;
70003
+ var ni = 6;
70004
+ this._nvertices = nv;
70005
+ this._nindices = ni;
70006
+ // ID
70007
+ this._id += 1;
70008
+ //
70009
+ if (sizeX === 0 || sizeY === 0) {
70010
+ this.pad(0, 0, nv, ni, 0);
70011
+ }
70012
+ else {
70013
+ var fx = 1 / sizeX;
70014
+ var fy = 1 / sizeY;
70015
+ switch (this._parent.stroke.side) {
70016
+ case EShapeStrokeSide.NONE:
70017
+ this.updateNone(fx, fy, ax, ay, scale, nv, ni);
70018
+ break;
70019
+ case EShapeStrokeSide.ALL:
70020
+ if (ay <= ax) {
70021
+ this.updateAll0(fx, fy, ax, ay, scale, nv, ni);
70022
+ }
70023
+ else {
70024
+ this.updateAll1(fx, fy, ax, ay, scale, nv, ni);
70025
+ }
70026
+ break;
70027
+ case EShapeStrokeSide.TOP:
70028
+ this.updateTop(fx, fy, ax, ay, scale, nv, ni);
70029
+ break;
70030
+ case EShapeStrokeSide.RIGHT:
70031
+ this.updateRight(fx, fy, ax, ay, scale, nv, ni);
70032
+ break;
70033
+ case EShapeStrokeSide.BOTTOM:
70034
+ this.updateBottom(fx, fy, ax, ay, scale, nv, ni);
70035
+ break;
70036
+ case EShapeStrokeSide.LEFT:
70037
+ this.updateLeft(fx, fy, ax, ay, scale, nv, ni);
70038
+ break;
70039
+ case EShapeStrokeSide.TOP_OR_BOTTOM:
70040
+ this.updateTopBottom(fx, fy, ax, ay, scale, nv, ni);
70041
+ break;
70042
+ case EShapeStrokeSide.LEFT_OR_RIGHT:
70043
+ this.updateLeftRight(fx, fy, ax, ay, scale, nv, ni);
70044
+ break;
70045
+ case EShapeStrokeSide.TOP_OR_RIGHT:
70046
+ if (ay <= ax) {
70047
+ this.updateTopRight0(fx, fy, ax, ay, scale, nv, ni);
70048
+ }
70049
+ else {
70050
+ this.updateTopRight1(fx, fy, ax, ay, scale, nv, ni);
70051
+ }
70052
+ break;
70053
+ case EShapeStrokeSide.TOP_OR_LEFT:
70054
+ if (ay <= ax) {
70055
+ this.updateTopLeft0(fx, fy, ax, ay, scale, nv, ni);
70056
+ }
70057
+ else {
70058
+ this.updateTopLeft1(fx, fy, ax, ay, scale, nv, ni);
70059
+ }
70060
+ break;
70061
+ case EShapeStrokeSide.BOTTOM_OR_RIGHT:
70062
+ if (ay <= ax) {
70063
+ this.updateBottomRight0(fx, fy, ax, ay, scale, nv, ni);
70064
+ }
70065
+ else {
70066
+ this.updateBottomRight1(fx, fy, ax, ay, scale, nv, ni);
70067
+ }
70068
+ break;
70069
+ case EShapeStrokeSide.BOTTOM_OR_LEFT:
70070
+ if (ay <= ax) {
70071
+ this.updateBottomLeft0(fx, fy, ax, ay, scale, nv, ni);
70072
+ }
70073
+ else {
70074
+ this.updateBottomLeft1(fx, fy, ax, ay, scale, nv, ni);
70075
+ }
70076
+ break;
70077
+ case EShapeStrokeSide.NOT_TOP:
70078
+ if (2 * ay <= ax) {
70079
+ this.updateNotTop0(fx, fy, ax, ay, scale, nv, ni);
70080
+ }
70081
+ else {
70082
+ this.updateNotTop1(fx, fy, ax, ay, scale, nv, ni);
70083
+ }
70084
+ break;
70085
+ case EShapeStrokeSide.NOT_RIGHT:
70086
+ if (2 * ax <= ay) {
70087
+ this.updateNotRight0(fx, fy, ax, ay, scale, nv, ni);
70088
+ }
70089
+ else {
70090
+ this.updateNotRight1(fx, fy, ax, ay, scale, nv, ni);
70091
+ }
70092
+ break;
70093
+ case EShapeStrokeSide.NOT_BOTTOM:
70094
+ if (2 * ay <= ax) {
70095
+ this.updateNotBottom0(fx, fy, ax, ay, scale, nv, ni);
70096
+ }
70097
+ else {
70098
+ this.updateNotBottom1(fx, fy, ax, ay, scale, nv, ni);
70099
+ }
70100
+ break;
70101
+ case EShapeStrokeSide.NOT_LEFT:
70102
+ if (2 * ax <= ay) {
70103
+ this.updateNotLeft0(fx, fy, ax, ay, scale, nv, ni);
70104
+ }
70105
+ else {
70106
+ this.updateNotLeft1(fx, fy, ax, ay, scale, nv, ni);
70107
+ }
70108
+ break;
70109
+ }
70110
+ }
70111
+ };
70112
+ /**
70113
+ * Fills the unused tail with degenerated triangles and trims the arrays
70114
+ * so that the buffers always hold exactly `nv` vertices and `ni` triangles.
70115
+ */
70116
+ EShapeRectangleTriangulatedImpl.prototype.pad = function (iv, ii, nv, ni, fd) {
70117
+ var vertices = this._vertices;
70118
+ var distances = this._distances;
70119
+ var lengths = this._lengths;
70120
+ var clippings = this._clippings;
70121
+ var uvs = this._uvs;
70122
+ var indices = this._indices;
70123
+ for (var i = iv; i < nv; ++i) {
70124
+ var i2 = i << 1;
70125
+ vertices[i2] = 0;
70126
+ vertices[i2 + 1] = 0;
70127
+ distances[i] = fd;
70128
+ lengths[i] = 0;
70129
+ clippings[i] = 0;
70130
+ uvs[i2] = 0.5;
70131
+ uvs[i2 + 1] = 0.5;
70132
+ }
70133
+ for (var i = ii, imax = ni * 3; i < imax; ++i) {
70134
+ indices[i] = 0;
70135
+ }
70136
+ var nv2 = nv << 1;
70137
+ vertices.length = nv2;
70138
+ distances.length = nv;
70139
+ lengths.length = nv;
70140
+ clippings.length = nv;
70141
+ uvs.length = nv2;
70142
+ indices.length = ni * 3;
70143
+ };
70144
+ EShapeRectangleTriangulatedImpl.prototype.updateTop = function (fx, fy, ax, ay, scale, nv, ni) {
70145
+ var fdistance = 1 / (2 * ay);
70146
+ this.updateCellTop(-ax, -ay - (scale - 1) / fdistance, +ax, +ay, fdistance, scale, fx, fy, ax, ay, 0);
70147
+ this.pad(4, 6, nv, ni, fdistance);
70148
+ };
70149
+ EShapeRectangleTriangulatedImpl.prototype.updateRight = function (fx, fy, ax, ay, scale, nv, ni) {
70150
+ var fdistance = 1 / (2 * ax);
70151
+ this.updateCellRight(-ax, -ay, +ax + (scale - 1) / fdistance, +ay, fdistance, scale, fx, fy, ax, ay, 0);
70152
+ this.pad(4, 6, nv, ni, fdistance);
70153
+ };
70154
+ EShapeRectangleTriangulatedImpl.prototype.updateBottom = function (fx, fy, ax, ay, scale, nv, ni) {
70155
+ var fdistance = 1 / (2 * ay);
70156
+ this.updateCellBottom(-ax, -ay, +ax, +ay + (scale - 1) / fdistance, fdistance, scale, fx, fy, ax, ay, 0);
70157
+ this.pad(4, 6, nv, ni, fdistance);
70158
+ };
70159
+ EShapeRectangleTriangulatedImpl.prototype.updateLeft = function (fx, fy, ax, ay, scale, nv, ni) {
70160
+ var fdistance = 1 / (2 * ax);
70161
+ this.updateCellLeft(-ax - (scale - 1) / fdistance, -ay, +ax, +ay, fdistance, scale, fx, fy, ax, ay, 0);
70162
+ this.pad(4, 6, nv, ni, fdistance);
70163
+ };
70164
+ EShapeRectangleTriangulatedImpl.prototype.updateLeftRight = function (fx, fy, ax, ay, scale, nv, ni) {
70165
+ var fdistance = 1 / ax;
70166
+ var shift = (scale - 1) / fdistance;
70167
+ this.updateCellLeft(-ax - shift, -ay, 0, +ay, fdistance, scale, fx, fy, ax, ay, 0);
70168
+ this.updateCellRight(0, -ay, +ax + shift, +ay, fdistance, scale, fx, fy, ax, ay, 4);
70169
+ this.pad(8, 12, nv, ni, fdistance);
70170
+ };
70171
+ EShapeRectangleTriangulatedImpl.prototype.updateTopBottom = function (fx, fy, ax, ay, scale, nv, ni) {
70172
+ var fdistance = 1 / ay;
70173
+ var shift = (scale - 1) / fdistance;
70174
+ this.updateCellTop(-ax, -ay - shift, +ax, 0, fdistance, scale, fx, fy, ax, ay, 0);
70175
+ this.updateCellBottom(-ax, 0, +ax, +ay + shift, fdistance, scale, fx, fy, ax, ay, 4);
70176
+ this.pad(8, 12, nv, ni, fdistance);
70177
+ };
70178
+ EShapeRectangleTriangulatedImpl.prototype.updateTopRight0 = function (fx, fy, ax, ay, scale, nv, ni) {
70179
+ var distance = 2 * ay;
70180
+ var fdistance = 1 / distance;
70181
+ var shift = (scale - 1) * distance;
70182
+ var left = -ax;
70183
+ var right = +ax + shift;
70184
+ var top = -ay - shift;
70185
+ var bottom = +ay;
70186
+ var indices = this._indices;
70187
+ var splitX = ax - 2 * ay;
70188
+ this.updateVertexTop(0, left, top, fdistance, scale, fx, fy, ax, ay);
70189
+ this.updateVertexTop(1, right, top, fdistance, scale, fx, fy, ax, ay);
70190
+ this.updateVertexTop(2, splitX, bottom, fdistance, scale, fx, fy, ax, ay);
70191
+ this.updateVertexTop(3, left, bottom, fdistance, scale, fx, fy, ax, ay);
70192
+ this.updateVertexRight(4, right, top, fdistance, scale, fx, fy, ax, ay);
70193
+ this.updateVertexRight(5, right, bottom, fdistance, scale, fx, fy, ax, ay);
70194
+ this.updateVertexRight(6, splitX, bottom, fdistance, scale, fx, fy, ax, ay);
70195
+ indices[0] = 0;
70196
+ indices[1] = 1;
70197
+ indices[2] = 2;
70198
+ indices[3] = 0;
70199
+ indices[4] = 2;
70200
+ indices[5] = 3;
70201
+ indices[6] = 4;
70202
+ indices[7] = 5;
70203
+ indices[8] = 6;
70204
+ this.pad(7, 9, nv, ni, fdistance);
70205
+ };
70206
+ EShapeRectangleTriangulatedImpl.prototype.updateTopRight1 = function (fx, fy, ax, ay, scale, nv, ni) {
70207
+ var distance = 2 * ax;
70208
+ var fdistance = 1 / distance;
70209
+ var shift = (scale - 1) * distance;
70210
+ var left = -ax;
70211
+ var right = +ax + shift;
70212
+ var top = -ay - shift;
70213
+ var bottom = +ay;
70214
+ var indices = this._indices;
70215
+ var splitY = 2 * ax - ay;
70216
+ this.updateVertexTop(0, left, top, fdistance, scale, fx, fy, ax, ay);
70217
+ this.updateVertexTop(1, right, top, fdistance, scale, fx, fy, ax, ay);
70218
+ this.updateVertexTop(2, left, splitY, fdistance, scale, fx, fy, ax, ay);
70219
+ this.updateVertexRight(3, right, top, fdistance, scale, fx, fy, ax, ay);
70220
+ this.updateVertexRight(4, right, bottom, fdistance, scale, fx, fy, ax, ay);
70221
+ this.updateVertexRight(5, left, bottom, fdistance, scale, fx, fy, ax, ay);
70222
+ this.updateVertexRight(6, left, splitY, fdistance, scale, fx, fy, ax, ay);
70223
+ indices[0] = 0;
70224
+ indices[1] = 1;
70225
+ indices[2] = 2;
70226
+ indices[3] = 3;
70227
+ indices[4] = 4;
70228
+ indices[5] = 5;
70229
+ indices[6] = 3;
70230
+ indices[7] = 5;
70231
+ indices[8] = 6;
70232
+ this.pad(7, 9, nv, ni, fdistance);
70233
+ };
70234
+ EShapeRectangleTriangulatedImpl.prototype.updateBottomLeft0 = function (fx, fy, ax, ay, scale, nv, ni) {
70235
+ var distance = 2 * ay;
70236
+ var fdistance = 1 / distance;
70237
+ var shift = (scale - 1) * distance;
70238
+ var left = -ax - shift;
70239
+ var right = +ax;
70240
+ var top = -ay;
70241
+ var bottom = +ay + shift;
70242
+ var splitX = 2 * ay - ax;
70243
+ this.updateQuadBottom(0, 0, right, bottom, left, bottom, splitX, top, right, top, fdistance, scale, fx, fy, ax, ay);
70244
+ this.updateTriLeft(4, 6, left, bottom, left, top, splitX, top, fdistance, scale, fx, fy, ax, ay);
70245
+ this.pad(7, 9, nv, ni, fdistance);
70246
+ };
70247
+ EShapeRectangleTriangulatedImpl.prototype.updateBottomLeft1 = function (fx, fy, ax, ay, scale, nv, ni) {
70248
+ var distance = 2 * ax;
70249
+ var fdistance = 1 / distance;
70250
+ var shift = (scale - 1) * distance;
70251
+ var left = -ax - shift;
70252
+ var right = +ax;
70253
+ var top = -ay;
70254
+ var bottom = +ay + shift;
70255
+ var splitY = ay - 2 * ax;
70256
+ this.updateTriBottom(0, 0, right, bottom, left, bottom, right, splitY, fdistance, scale, fx, fy, ax, ay);
70257
+ this.updateQuadLeft(3, 3, left, bottom, left, top, right, top, right, splitY, fdistance, scale, fx, fy, ax, ay);
70258
+ this.pad(7, 9, nv, ni, fdistance);
70259
+ };
70260
+ EShapeRectangleTriangulatedImpl.prototype.updateTopLeft0 = function (fx, fy, ax, ay, scale, nv, ni) {
70261
+ var distance = 2 * ay;
70262
+ var fdistance = 1 / distance;
70263
+ var shift = (scale - 1) * distance;
70264
+ var left = -ax - shift;
70265
+ var right = +ax;
70266
+ var top = -ay - shift;
70267
+ var bottom = +ay;
70268
+ var splitX = 2 * ay - ax;
70269
+ this.updateQuadTop(0, 0, right, top, left, top, splitX, bottom, right, bottom, fdistance, scale, fx, fy, ax, ay);
70270
+ this.updateTriLeft(4, 6, left, top, left, bottom, splitX, bottom, fdistance, scale, fx, fy, ax, ay);
70271
+ this.pad(7, 9, nv, ni, fdistance);
70272
+ };
70273
+ EShapeRectangleTriangulatedImpl.prototype.updateTopLeft1 = function (fx, fy, ax, ay, scale, nv, ni) {
70274
+ var distance = 2 * ax;
70275
+ var fdistance = 1 / distance;
70276
+ var shift = (scale - 1) * distance;
70277
+ var left = -ax - shift;
70278
+ var right = +ax;
70279
+ var top = -ay - shift;
70280
+ var bottom = +ay;
70281
+ var splitY = 2 * ax - ay;
70282
+ this.updateTriTop(0, 0, right, top, left, top, right, splitY, fdistance, scale, fx, fy, ax, ay);
70283
+ this.updateQuadLeft(3, 3, left, top, left, bottom, right, bottom, right, splitY, fdistance, scale, fx, fy, ax, ay);
70284
+ this.pad(7, 9, nv, ni, fdistance);
70285
+ };
70286
+ EShapeRectangleTriangulatedImpl.prototype.updateBottomRight0 = function (fx, fy, ax, ay, scale, nv, ni) {
70287
+ var distance = 2 * ay;
70288
+ var fdistance = 1 / distance;
70289
+ var shift = (scale - 1) * distance;
70290
+ var left = -ax;
70291
+ var right = +ax + shift;
70292
+ var top = -ay;
70293
+ var bottom = +ay + shift;
70294
+ var splitX = ax - 2 * ay;
70295
+ this.updateQuadBottom(0, 0, left, bottom, right, bottom, splitX, top, left, top, fdistance, scale, fx, fy, ax, ay);
70296
+ this.updateTriRight(4, 6, right, bottom, right, top, splitX, top, fdistance, scale, fx, fy, ax, ay);
70297
+ this.pad(7, 9, nv, ni, fdistance);
70298
+ };
70299
+ EShapeRectangleTriangulatedImpl.prototype.updateBottomRight1 = function (fx, fy, ax, ay, scale, nv, ni) {
70300
+ var distance = 2 * ax;
70301
+ var fdistance = 1 / distance;
70302
+ var shift = (scale - 1) * distance;
70303
+ var left = -ax;
70304
+ var right = +ax + shift;
70305
+ var top = -ay;
70306
+ var bottom = +ay + shift;
70307
+ var splitY = ay - 2 * ax;
70308
+ this.updateTriBottom(0, 0, left, bottom, right, bottom, left, splitY, fdistance, scale, fx, fy, ax, ay);
70309
+ this.updateQuadRight(3, 3, right, bottom, right, top, left, top, left, splitY, fdistance, scale, fx, fy, ax, ay);
70310
+ this.pad(7, 9, nv, ni, fdistance);
70311
+ };
70312
+ EShapeRectangleTriangulatedImpl.prototype.updateNotTop0 = function (fx, fy, ax, ay, scale, nv, ni) {
70313
+ var distance = 2 * ay;
70314
+ var fdistance = 1 / distance;
70315
+ var shift = (scale - 1) * distance;
70316
+ var left = -ax - shift;
70317
+ var right = +ax + shift;
70318
+ var top = -ay;
70319
+ var bottom = +ay + shift;
70320
+ var splitLeft = 2 * ay - ax;
70321
+ var splitRight = ax - 2 * ay;
70322
+ this.updateTriLeft(0, 0, left, top, splitLeft, top, left, bottom, fdistance, scale, fx, fy, ax, ay);
70323
+ this.updateQuadBottom(3, 3, splitLeft, top, splitRight, top, right, bottom, left, bottom, fdistance, scale, fx, fy, ax, ay);
70324
+ this.updateTriRight(7, 9, splitRight, top, right, top, right, bottom, fdistance, scale, fx, fy, ax, ay);
70325
+ this.pad(10, 12, nv, ni, fdistance);
70326
+ };
70327
+ EShapeRectangleTriangulatedImpl.prototype.updateNotTop1 = function (fx, fy, ax, ay, scale, nv, ni) {
70328
+ var distance = ax;
70329
+ var fdistance = 1 / distance;
70330
+ var shift = (scale - 1) * distance;
70331
+ var left = -ax - shift;
70332
+ var right = +ax + shift;
70333
+ var top = -ay;
70334
+ var bottom = +ay + shift;
70335
+ var splitY = ay - ax;
70336
+ this.updateQuadLeft(0, 0, left, top, 0, top, 0, splitY, left, bottom, fdistance, scale, fx, fy, ax, ay);
70337
+ this.updateQuadRight(4, 6, 0, top, right, top, right, bottom, 0, splitY, fdistance, scale, fx, fy, ax, ay);
70338
+ this.updateTriBottom(8, 12, 0, splitY, right, bottom, left, bottom, fdistance, scale, fx, fy, ax, ay);
70339
+ this.pad(11, 15, nv, ni, fdistance);
70340
+ };
70341
+ EShapeRectangleTriangulatedImpl.prototype.updateNotBottom0 = function (fx, fy, ax, ay, scale, nv, ni) {
70342
+ var distance = 2 * ay;
70343
+ var fdistance = 1 / distance;
70344
+ var shift = (scale - 1) * distance;
70345
+ var left = -ax - shift;
70346
+ var right = +ax + shift;
70347
+ var top = -ay - shift;
70348
+ var bottom = +ay;
70349
+ var splitLeft = 2 * ay - ax;
70350
+ var splitRight = ax - 2 * ay;
70351
+ this.updateTriLeft(0, 0, left, bottom, splitLeft, bottom, left, top, fdistance, scale, fx, fy, ax, ay);
70352
+ this.updateQuadTop(3, 3, splitLeft, bottom, splitRight, bottom, right, top, left, top, fdistance, scale, fx, fy, ax, ay);
70353
+ this.updateTriRight(7, 9, splitRight, bottom, right, bottom, right, top, fdistance, scale, fx, fy, ax, ay);
70354
+ this.pad(10, 12, nv, ni, fdistance);
70355
+ };
70356
+ EShapeRectangleTriangulatedImpl.prototype.updateNotBottom1 = function (fx, fy, ax, ay, scale, nv, ni) {
70357
+ var distance = ax;
70358
+ var fdistance = 1 / distance;
70359
+ var shift = (scale - 1) * distance;
70360
+ var left = -ax - shift;
70361
+ var right = +ax + shift;
70362
+ var top = -ay - shift;
70363
+ var bottom = +ay;
70364
+ var splitY = ay - ax;
70365
+ this.updateQuadLeft(0, 0, left, bottom, 0, bottom, 0, -splitY, left, top, fdistance, scale, fx, fy, ax, ay);
70366
+ this.updateQuadRight(4, 6, 0, bottom, right, bottom, right, top, 0, -splitY, fdistance, scale, fx, fy, ax, ay);
70367
+ this.updateTriTop(8, 12, 0, -splitY, right, top, left, top, fdistance, scale, fx, fy, ax, ay);
70368
+ this.pad(11, 15, nv, ni, fdistance);
70369
+ };
70370
+ EShapeRectangleTriangulatedImpl.prototype.updateNotLeft0 = function (fx, fy, ax, ay, scale, nv, ni) {
70371
+ var distance = 2 * ax;
70372
+ var fdistance = 1 / distance;
70373
+ var shift = (scale - 1) * distance;
70374
+ var left = -ax;
70375
+ var right = +ax + shift;
70376
+ var top = -ay - shift;
70377
+ var bottom = +ay + shift;
70378
+ var splitTop = 2 * ax - ay;
70379
+ var splitBottom = ay - 2 * ax;
70380
+ this.updateTriBottom(0, 0, left, bottom, left, splitBottom, right, bottom, fdistance, scale, fx, fy, ax, ay);
70381
+ this.updateQuadRight(3, 3, left, splitBottom, left, splitTop, right, top, right, bottom, fdistance, scale, fx, fy, ax, ay);
70382
+ this.updateTriTop(7, 9, left, splitTop, left, top, right, top, fdistance, scale, fx, fy, ax, ay);
70383
+ this.pad(10, 12, nv, ni, fdistance);
70384
+ };
70385
+ EShapeRectangleTriangulatedImpl.prototype.updateNotLeft1 = function (fx, fy, ax, ay, scale, nv, ni) {
70386
+ var distance = ay;
70387
+ var fdistance = 1 / distance;
70388
+ var shift = (scale - 1) * distance;
70389
+ var left = -ax;
70390
+ var right = +ax + shift;
70391
+ var top = -ay - shift;
70392
+ var bottom = +ay + shift;
70393
+ var splitX = ax - ay;
70394
+ this.updateQuadBottom(0, 0, left, bottom, left, 0, splitX, 0, right, bottom, fdistance, scale, fx, fy, ax, ay);
70395
+ this.updateQuadTop(4, 6, left, 0, left, top, right, top, splitX, 0, fdistance, scale, fx, fy, ax, ay);
70396
+ this.updateTriRight(8, 12, splitX, 0, right, top, right, bottom, fdistance, scale, fx, fy, ax, ay);
70397
+ this.pad(11, 15, nv, ni, fdistance);
70398
+ };
70399
+ EShapeRectangleTriangulatedImpl.prototype.updateNotRight0 = function (fx, fy, ax, ay, scale, nv, ni) {
70400
+ var distance = 2 * ax;
70401
+ var fdistance = 1 / distance;
70402
+ var shift = (scale - 1) * distance;
70403
+ var left = -ax - shift;
70404
+ var right = +ax;
70405
+ var top = -ay - shift;
70406
+ var bottom = +ay + shift;
70407
+ var stop = 2 * ax - ay;
70408
+ var sbottom = ay - 2 * ax;
70409
+ this.updateTriBottom(0, 0, right, bottom, right, sbottom, left, bottom, fdistance, scale, fx, fy, ax, ay);
70410
+ this.updateQuadLeft(3, 3, right, sbottom, right, stop, left, top, left, bottom, fdistance, scale, fx, fy, ax, ay);
70411
+ this.updateTriTop(7, 9, right, stop, right, top, left, top, fdistance, scale, fx, fy, ax, ay);
70412
+ this.pad(10, 12, nv, ni, fdistance);
70413
+ };
70414
+ EShapeRectangleTriangulatedImpl.prototype.updateNotRight1 = function (fx, fy, ax, ay, scale, nv, ni) {
70415
+ var distance = ay;
70416
+ var fdistance = 1 / distance;
70417
+ var shift = (scale - 1) * distance;
70418
+ var left = -ax - shift;
70419
+ var right = +ax;
70420
+ var top = -ay - shift;
70421
+ var bottom = +ay + shift;
70422
+ var splitX = ay - ax;
70423
+ this.updateQuadBottom(0, 0, right, bottom, right, 0, splitX, 0, left, bottom, fdistance, scale, fx, fy, ax, ay);
70424
+ this.updateQuadTop(4, 6, right, 0, right, top, left, top, splitX, 0, fdistance, scale, fx, fy, ax, ay);
70425
+ this.updateTriLeft(8, 12, splitX, 0, left, top, left, bottom, fdistance, scale, fx, fy, ax, ay);
70426
+ this.pad(11, 15, nv, ni, fdistance);
70427
+ };
70428
+ EShapeRectangleTriangulatedImpl.prototype.updateTriTop = function (iv, ii, x0, y0, x1, y1, x2, y2, fdistance, scale, fx, fy, ax, ay, reverse) {
70429
+ if (reverse === void 0) { reverse = (x1 - x0) * (y2 - y0) < (y1 - y0) * (x2 - x0); }
70430
+ this.updateVertexTop(iv, x0, y0, fdistance, scale, fx, fy, ax, ay);
70431
+ this.updateVertexTop(iv + 1, x1, y1, fdistance, scale, fx, fy, ax, ay);
70432
+ this.updateVertexTop(iv + 2, x2, y2, fdistance, scale, fx, fy, ax, ay);
70433
+ this._indices[ii] = iv;
70434
+ this._indices[ii + 1] = iv + (reverse ? 2 : 1);
70435
+ this._indices[ii + 2] = iv + (reverse ? 1 : 2);
70436
+ };
70437
+ EShapeRectangleTriangulatedImpl.prototype.updateTriRight = function (iv, ii, x0, y0, x1, y1, x2, y2, fdistance, scale, fx, fy, ax, ay, reverse) {
70438
+ if (reverse === void 0) { reverse = (x1 - x0) * (y2 - y0) < (y1 - y0) * (x2 - x0); }
70439
+ this.updateVertexRight(iv, x0, y0, fdistance, scale, fx, fy, ax, ay);
70440
+ this.updateVertexRight(iv + 1, x1, y1, fdistance, scale, fx, fy, ax, ay);
70441
+ this.updateVertexRight(iv + 2, x2, y2, fdistance, scale, fx, fy, ax, ay);
70442
+ this._indices[ii] = iv;
70443
+ this._indices[ii + 1] = iv + (reverse ? 2 : 1);
70444
+ this._indices[ii + 2] = iv + (reverse ? 1 : 2);
70445
+ };
70446
+ EShapeRectangleTriangulatedImpl.prototype.updateTriBottom = function (iv, ii, x0, y0, x1, y1, x2, y2, fdistance, scale, fx, fy, ax, ay, reverse) {
70447
+ if (reverse === void 0) { reverse = (x1 - x0) * (y2 - y0) < (y1 - y0) * (x2 - x0); }
70448
+ this.updateVertexBottom(iv, x0, y0, fdistance, scale, fx, fy, ax, ay);
70449
+ this.updateVertexBottom(iv + 1, x1, y1, fdistance, scale, fx, fy, ax, ay);
70450
+ this.updateVertexBottom(iv + 2, x2, y2, fdistance, scale, fx, fy, ax, ay);
70451
+ this._indices[ii] = iv;
70452
+ this._indices[ii + 1] = iv + (reverse ? 2 : 1);
70453
+ this._indices[ii + 2] = iv + (reverse ? 1 : 2);
70454
+ };
70455
+ EShapeRectangleTriangulatedImpl.prototype.updateTriLeft = function (iv, ii, x0, y0, x1, y1, x2, y2, fdistance, scale, fx, fy, ax, ay, reverse) {
70456
+ if (reverse === void 0) { reverse = (x1 - x0) * (y2 - y0) < (y1 - y0) * (x2 - x0); }
70457
+ this.updateVertexLeft(iv, x0, y0, fdistance, scale, fx, fy, ax, ay);
70458
+ this.updateVertexLeft(iv + 1, x1, y1, fdistance, scale, fx, fy, ax, ay);
70459
+ this.updateVertexLeft(iv + 2, x2, y2, fdistance, scale, fx, fy, ax, ay);
70460
+ this._indices[ii] = iv;
70461
+ this._indices[ii + 1] = iv + (reverse ? 2 : 1);
70462
+ this._indices[ii + 2] = iv + (reverse ? 1 : 2);
70463
+ };
70464
+ EShapeRectangleTriangulatedImpl.prototype.updateQuadTop = function (iv, ii, x0, y0, x1, y1, x2, y2, x3, y3, fdistance, scale, fx, fy, ax, ay, reverse) {
70465
+ if (reverse === void 0) { reverse = (x1 - x0) * (y2 - y0) < (y1 - y0) * (x2 - x0); }
70466
+ this.updateVertexTop(iv, x0, y0, fdistance, scale, fx, fy, ax, ay);
70467
+ this.updateVertexTop(iv + 1, x1, y1, fdistance, scale, fx, fy, ax, ay);
70468
+ this.updateVertexTop(iv + 2, x2, y2, fdistance, scale, fx, fy, ax, ay);
70469
+ this.updateVertexTop(iv + 3, x3, y3, fdistance, scale, fx, fy, ax, ay);
70470
+ this._indices[ii] = iv;
70471
+ this._indices[ii + 1] = iv + (reverse ? 2 : 1);
70472
+ this._indices[ii + 2] = iv + (reverse ? 1 : 2);
70473
+ this._indices[ii + 3] = iv;
70474
+ this._indices[ii + 4] = iv + (reverse ? 3 : 2);
70475
+ this._indices[ii + 5] = iv + (reverse ? 2 : 3);
70476
+ };
70477
+ EShapeRectangleTriangulatedImpl.prototype.updateQuadRight = function (iv, ii, x0, y0, x1, y1, x2, y2, x3, y3, fdistance, scale, fx, fy, ax, ay, reverse) {
70478
+ if (reverse === void 0) { reverse = (x1 - x0) * (y2 - y0) < (y1 - y0) * (x2 - x0); }
70479
+ this.updateVertexRight(iv, x0, y0, fdistance, scale, fx, fy, ax, ay);
70480
+ this.updateVertexRight(iv + 1, x1, y1, fdistance, scale, fx, fy, ax, ay);
70481
+ this.updateVertexRight(iv + 2, x2, y2, fdistance, scale, fx, fy, ax, ay);
70482
+ this.updateVertexRight(iv + 3, x3, y3, fdistance, scale, fx, fy, ax, ay);
70483
+ this._indices[ii] = iv;
70484
+ this._indices[ii + 1] = iv + (reverse ? 2 : 1);
70485
+ this._indices[ii + 2] = iv + (reverse ? 1 : 2);
70486
+ this._indices[ii + 3] = iv;
70487
+ this._indices[ii + 4] = iv + (reverse ? 3 : 2);
70488
+ this._indices[ii + 5] = iv + (reverse ? 2 : 3);
70489
+ };
70490
+ EShapeRectangleTriangulatedImpl.prototype.updateQuadBottom = function (iv, ii, x0, y0, x1, y1, x2, y2, x3, y3, fdistance, scale, fx, fy, ax, ay, reverse) {
70491
+ if (reverse === void 0) { reverse = (x1 - x0) * (y2 - y0) < (y1 - y0) * (x2 - x0); }
70492
+ this.updateVertexBottom(iv, x0, y0, fdistance, scale, fx, fy, ax, ay);
70493
+ this.updateVertexBottom(iv + 1, x1, y1, fdistance, scale, fx, fy, ax, ay);
70494
+ this.updateVertexBottom(iv + 2, x2, y2, fdistance, scale, fx, fy, ax, ay);
70495
+ this.updateVertexBottom(iv + 3, x3, y3, fdistance, scale, fx, fy, ax, ay);
70496
+ this._indices[ii] = iv;
70497
+ this._indices[ii + 1] = iv + (reverse ? 2 : 1);
70498
+ this._indices[ii + 2] = iv + (reverse ? 1 : 2);
70499
+ this._indices[ii + 3] = iv;
70500
+ this._indices[ii + 4] = iv + (reverse ? 3 : 2);
70501
+ this._indices[ii + 5] = iv + (reverse ? 2 : 3);
70502
+ };
70503
+ EShapeRectangleTriangulatedImpl.prototype.updateQuadLeft = function (iv, ii, x0, y0, x1, y1, x2, y2, x3, y3, fdistance, scale, fx, fy, ax, ay, reverse) {
70504
+ if (reverse === void 0) { reverse = (x1 - x0) * (y2 - y0) < (y1 - y0) * (x2 - x0); }
70505
+ this.updateVertexLeft(iv, x0, y0, fdistance, scale, fx, fy, ax, ay);
70506
+ this.updateVertexLeft(iv + 1, x1, y1, fdistance, scale, fx, fy, ax, ay);
70507
+ this.updateVertexLeft(iv + 2, x2, y2, fdistance, scale, fx, fy, ax, ay);
70508
+ this.updateVertexLeft(iv + 3, x3, y3, fdistance, scale, fx, fy, ax, ay);
70509
+ this._indices[ii] = iv;
70510
+ this._indices[ii + 1] = iv + (reverse ? 2 : 1);
70511
+ this._indices[ii + 2] = iv + (reverse ? 1 : 2);
70512
+ this._indices[ii + 3] = iv;
70513
+ this._indices[ii + 4] = iv + (reverse ? 3 : 2);
70514
+ this._indices[ii + 5] = iv + (reverse ? 2 : 3);
70515
+ };
70516
+ EShapeRectangleTriangulatedImpl.prototype.updateNone = function (fx, fy, ax, ay, scale, nv, ni) {
70517
+ this.updateCellNone(-ax, -ay, +ax, +ay, 0, scale, fx, fy, ax, ay, 0);
70518
+ this.pad(4, 6, nv, ni, 0);
70519
+ };
70520
+ EShapeRectangleTriangulatedImpl.prototype.updateAll0 = function (fx, fy, ax, ay, scale, nv, ni) {
70521
+ var distance = ay;
70522
+ var fdistance = 1 / distance;
70523
+ var shift = (scale - 1) * distance;
70524
+ var outerLeft = -ax - shift;
70525
+ var outerRight = +ax + shift;
70526
+ var outerTop = -ay - shift;
70527
+ var outerBottom = +ay + shift;
70528
+ var innerLeft = -ax + ay;
70529
+ var innerRight = +ax - ay;
70530
+ this.updateQuadTop(0, 0, outerLeft, outerTop, outerRight, outerTop, innerRight, 0, innerLeft, 0, fdistance, scale, fx, fy, ax, ay);
70531
+ this.updateTriRight(4, 6, outerRight, outerTop, outerRight, outerBottom, innerRight, 0, fdistance, scale, fx, fy, ax, ay);
70532
+ this.updateQuadBottom(7, 9, outerRight, outerBottom, outerLeft, outerBottom, innerLeft, 0, innerRight, 0, fdistance, scale, fx, fy, ax, ay);
70533
+ this.updateTriLeft(11, 15, outerLeft, outerBottom, outerLeft, outerTop, innerLeft, 0, fdistance, scale, fx, fy, ax, ay);
70534
+ this.pad(14, 18, nv, ni, fdistance);
70535
+ };
70536
+ EShapeRectangleTriangulatedImpl.prototype.updateAll1 = function (fx, fy, ax, ay, scale, nv, ni) {
70537
+ var distance = ax;
70538
+ var fdistance = 1 / distance;
70539
+ var shift = (scale - 1) * distance;
70540
+ var outerLeft = -ax - shift;
70541
+ var outerRight = +ax + shift;
70542
+ var outerTop = -ay - shift;
70543
+ var outerBottom = +ay + shift;
70544
+ var innerTop = -ay + ax;
70545
+ var innerBottom = +ay - ax;
70546
+ this.updateTriTop(0, 0, outerLeft, outerTop, outerRight, outerTop, 0, innerTop, fdistance, scale, fx, fy, ax, ay);
70547
+ this.updateQuadRight(3, 3, outerRight, outerTop, outerRight, outerBottom, 0, innerBottom, 0, innerTop, fdistance, scale, fx, fy, ax, ay);
70548
+ this.updateTriBottom(7, 9, outerRight, outerBottom, outerLeft, outerBottom, 0, innerBottom, fdistance, scale, fx, fy, ax, ay);
70549
+ this.updateQuadLeft(10, 12, outerLeft, outerBottom, outerLeft, outerTop, 0, innerTop, 0, innerBottom, fdistance, scale, fx, fy, ax, ay);
70550
+ this.pad(14, 18, nv, ni, fdistance);
70551
+ };
70552
+ EShapeRectangleTriangulatedImpl.prototype.updateCellNone = function (x0, y0, x1, y1, fdistance, scale, fx, fy, ax, ay, iv) {
70553
+ this.updateVertex(iv, x0, y0, 0, 0, 0, fx, fy);
70554
+ this.updateVertex(iv + 1, x1, y0, 0, 0, 0, fx, fy);
70555
+ this.updateVertex(iv + 2, x1, y1, 0, 0, 0, fx, fy);
70556
+ this.updateVertex(iv + 3, x0, y1, 0, 0, 0, fx, fy);
70557
+ var ii = (iv >> 1) * 3;
70558
+ var indices = this._indices;
70559
+ indices[ii++] = iv;
70560
+ indices[ii++] = iv + 1;
70561
+ indices[ii++] = iv + 2;
70562
+ indices[ii++] = iv;
70563
+ indices[ii++] = iv + 2;
70564
+ indices[ii++] = iv + 3;
70565
+ };
70566
+ EShapeRectangleTriangulatedImpl.prototype.updateCellTop = function (x0, y0, x1, y1, fdistance, scale, fx, fy, ax, ay, iv) {
70567
+ this.updateVertexTop(iv, x0, y0, fdistance, scale, fx, fy, ax, ay);
70568
+ this.updateVertexTop(iv + 1, x1, y0, fdistance, scale, fx, fy, ax, ay);
70569
+ this.updateVertexTop(iv + 2, x1, y1, fdistance, scale, fx, fy, ax, ay);
70570
+ this.updateVertexTop(iv + 3, x0, y1, fdistance, scale, fx, fy, ax, ay);
70571
+ var ii = (iv >> 1) * 3;
70572
+ var indices = this._indices;
70573
+ indices[ii++] = iv;
70574
+ indices[ii++] = iv + 1;
70575
+ indices[ii++] = iv + 2;
70576
+ indices[ii++] = iv;
70577
+ indices[ii++] = iv + 2;
70578
+ indices[ii++] = iv + 3;
70579
+ };
70580
+ EShapeRectangleTriangulatedImpl.prototype.updateCellRight = function (x0, y0, x1, y1, fdistance, scale, fx, fy, ax, ay, iv) {
70581
+ this.updateVertexRight(iv, x0, y0, fdistance, scale, fx, fy, ax, ay);
70582
+ this.updateVertexRight(iv + 1, x1, y0, fdistance, scale, fx, fy, ax, ay);
70583
+ this.updateVertexRight(iv + 2, x1, y1, fdistance, scale, fx, fy, ax, ay);
70584
+ this.updateVertexRight(iv + 3, x0, y1, fdistance, scale, fx, fy, ax, ay);
70585
+ var ii = (iv >> 1) * 3;
70586
+ var indices = this._indices;
70587
+ indices[ii++] = iv;
70588
+ indices[ii++] = iv + 1;
70589
+ indices[ii++] = iv + 2;
70590
+ indices[ii++] = iv;
70591
+ indices[ii++] = iv + 2;
70592
+ indices[ii++] = iv + 3;
70593
+ };
70594
+ EShapeRectangleTriangulatedImpl.prototype.updateCellBottom = function (x0, y0, x1, y1, fdistance, scale, fx, fy, ax, ay, iv) {
70595
+ this.updateVertexBottom(iv, x0, y0, fdistance, scale, fx, fy, ax, ay);
70596
+ this.updateVertexBottom(iv + 1, x1, y0, fdistance, scale, fx, fy, ax, ay);
70597
+ this.updateVertexBottom(iv + 2, x1, y1, fdistance, scale, fx, fy, ax, ay);
70598
+ this.updateVertexBottom(iv + 3, x0, y1, fdistance, scale, fx, fy, ax, ay);
70599
+ var ii = (iv >> 1) * 3;
70600
+ var indices = this._indices;
70601
+ indices[ii++] = iv;
70602
+ indices[ii++] = iv + 1;
70603
+ indices[ii++] = iv + 2;
70604
+ indices[ii++] = iv;
70605
+ indices[ii++] = iv + 2;
70606
+ indices[ii++] = iv + 3;
70607
+ };
70608
+ EShapeRectangleTriangulatedImpl.prototype.updateCellLeft = function (x0, y0, x1, y1, fdistance, scale, fx, fy, ax, ay, iv) {
70609
+ this.updateVertexLeft(iv, x0, y0, fdistance, scale, fx, fy, ax, ay);
70610
+ this.updateVertexLeft(iv + 1, x1, y0, fdistance, scale, fx, fy, ax, ay);
70611
+ this.updateVertexLeft(iv + 2, x1, y1, fdistance, scale, fx, fy, ax, ay);
70612
+ this.updateVertexLeft(iv + 3, x0, y1, fdistance, scale, fx, fy, ax, ay);
70613
+ var ii = (iv >> 1) * 3;
70614
+ var indices = this._indices;
70615
+ indices[ii++] = iv;
70616
+ indices[ii++] = iv + 1;
70617
+ indices[ii++] = iv + 2;
70618
+ indices[ii++] = iv;
70619
+ indices[ii++] = iv + 2;
70620
+ indices[ii++] = iv + 3;
70621
+ };
70622
+ EShapeRectangleTriangulatedImpl.prototype.updateVertexTop = function (vertex, x, y, fdistance, scale, fx, fy, ax, ay) {
70623
+ this.updateVertex(vertex, x, y, fdistance, x + ax, Math.min(scale, (y + ay) * -fdistance + 1), fx, fy);
70624
+ };
70625
+ EShapeRectangleTriangulatedImpl.prototype.updateVertexRight = function (vertex, x, y, fdistance, scale, fx, fy, ax, ay) {
70626
+ this.updateVertex(vertex, x, y, fdistance, 2 * ax + y + ay, Math.min(scale, (x - ax) * fdistance + 1), fx, fy);
70627
+ };
70628
+ EShapeRectangleTriangulatedImpl.prototype.updateVertexBottom = function (vertex, x, y, fdistance, scale, fx, fy, ax, ay) {
70629
+ this.updateVertex(vertex, x, y, fdistance, 3 * ax + 2 * ay - x, Math.min(scale, (y - ay) * fdistance + 1), fx, fy);
70630
+ };
70631
+ EShapeRectangleTriangulatedImpl.prototype.updateVertexLeft = function (vertex, x, y, fdistance, scale, fx, fy, ax, ay) {
70632
+ this.updateVertex(vertex, x, y, fdistance, 4 * ax + 3 * ay - y, Math.min(scale, (x + ax) * -fdistance + 1), fx, fy);
70633
+ };
70634
+ EShapeRectangleTriangulatedImpl.prototype.updateVertex = function (vertex, x, y, distance, length, clipping, fx, fy) {
70635
+ var vertex2 = vertex << 1;
70636
+ this._vertices[vertex2] = x;
70637
+ this._vertices[vertex2 + 1] = y;
70638
+ this._distances[vertex] = distance;
70639
+ this._lengths[vertex] = length;
70640
+ this._clippings[vertex] = clipping;
70641
+ this._uvs[vertex2] = 0.5 * (x * fx + 1);
70642
+ this._uvs[vertex2 + 1] = 0.5 * (y * fy + 1);
70643
+ };
70644
+ return EShapeRectangleTriangulatedImpl;
70645
+ }());
70646
+
70647
+ /*
70648
+ * Copyright (C) 2019 Toshiba Corporation
70649
+ * SPDX-License-Identifier: Apache-2.0
70650
+ */
70651
+ var EShapeRectangle = /** @class */ (function (_super) {
70652
+ __extends(EShapeRectangle, _super);
70653
+ function EShapeRectangle(type) {
70654
+ if (type === void 0) { type = EShapeType.RECTANGLE; }
70655
+ var _this = _super.call(this, type) || this;
70656
+ _this._triangulated = _this.newTriangulated();
70657
+ return _this;
70658
+ }
70659
+ EShapeRectangle.prototype.newTriangulated = function () {
70660
+ return new EShapeRectangleTriangulatedImpl(this);
70661
+ };
70662
+ Object.defineProperty(EShapeRectangle.prototype, "triangulated", {
70663
+ get: function () {
70664
+ return this._triangulated;
70665
+ },
70666
+ enumerable: false,
70667
+ configurable: true
70668
+ });
70669
+ EShapeRectangle.prototype.clone = function () {
70670
+ return new EShapeRectangle(this.type).copy(this);
70671
+ };
70672
+ EShapeRectangle.prototype.containsAbs = function (x, y, ax, ay, sw, ss, sa) {
70673
+ if (_super.prototype.containsAbsBBox.call(this, x, y, ax, ay)) {
70674
+ return hitTestRectangle(this, x, y, ax, ay, sw, ss);
70675
+ }
70676
+ return false;
70677
+ };
70678
+ return EShapeRectangle;
70679
+ }(EShapePrimitive));
70680
+
69810
70681
  /*
69811
70682
  * Copyright (C) 2019 Toshiba Corporation
69812
70683
  * SPDX-License-Identifier: Apache-2.0
@@ -69940,7 +70811,7 @@ var createLineOfRectangleRoundedsUploaded = function (buffer, shape, voffset, io
69940
70811
  * SPDX-License-Identifier: Apache-2.0
69941
70812
  */
69942
70813
  var createLineOfRectanglesUploaded = function (buffer, shape, voffset, ioffset, antialiasWeight) {
69943
- return createLineOfAnyUploaded(buffer, shape, voffset, RECTANGLE_VERTEX_COUNT, ioffset, RECTANGLE_INDEX_COUNT, antialiasWeight, BuilderLineOfRectangles);
70814
+ return createLineOfAnyUploaded(buffer, shape, voffset, RECTANGLE_LEGACY_VERTEX_COUNT, ioffset, RECTANGLE_LEGACY_INDEX_COUNT, antialiasWeight, BuilderLineOfRectangles);
69944
70815
  };
69945
70816
 
69946
70817
  /*
@@ -69972,7 +70843,7 @@ var toMarkerVertexCount = function (type) {
69972
70843
  case EShapePointsMarkerType.TRIANGLE:
69973
70844
  return TRIANGLE_VERTEX_COUNT;
69974
70845
  case EShapePointsMarkerType.RECTANGLE:
69975
- return RECTANGLE_VERTEX_COUNT;
70846
+ return RECTANGLE_LEGACY_VERTEX_COUNT;
69976
70847
  }
69977
70848
  return 0;
69978
70849
  };
@@ -69985,7 +70856,7 @@ var toMarkerIndexCount = function (type) {
69985
70856
  case EShapePointsMarkerType.TRIANGLE:
69986
70857
  return TRIANGLE_INDEX_COUNT;
69987
70858
  case EShapePointsMarkerType.RECTANGLE:
69988
- return RECTANGLE_INDEX_COUNT;
70859
+ return RECTANGLE_LEGACY_INDEX_COUNT;
69989
70860
  }
69990
70861
  return 0;
69991
70862
  };
@@ -72060,16 +72931,16 @@ var createPolygon = function (points, result) {
72060
72931
  * Copyright (C) 2019 Toshiba Corporation
72061
72932
  * SPDX-License-Identifier: Apache-2.0
72062
72933
  */
72063
- var createRectanglePivotedUploaded = function (buffer, shape, voffset, ioffset, antialiasWeight) {
72934
+ var createRectangleLegacyUploaded = function (buffer, shape, voffset, ioffset, antialiasWeight) {
72064
72935
  var tcount = toTextBufferCount(shape);
72065
72936
  var tvcount = tcount << TEXT_VERTEX_COUNT_SHIFT;
72066
72937
  var ticount = tcount << TEXT_INDEX_COUNT_SHIFT;
72067
- var vcount = RECTANGLE_VERTEX_COUNT + tvcount;
72068
- var icount = RECTANGLE_INDEX_COUNT + ticount;
72938
+ var vcount = RECTANGLE_LEGACY_VERTEX_COUNT + tvcount;
72939
+ var icount = RECTANGLE_LEGACY_INDEX_COUNT + ticount;
72069
72940
  if (buffer.check(voffset, ioffset, vcount, icount)) {
72070
72941
  return new EShapeUploadedImpl(buffer, voffset, ioffset, vcount, icount, [
72071
- new BuilderRectanglePivoted(buffer, voffset, ioffset),
72072
- new BuilderText(buffer, voffset + RECTANGLE_VERTEX_COUNT, ioffset + RECTANGLE_INDEX_COUNT, tvcount, ticount)
72942
+ new BuilderRectangleLegacy(buffer, voffset, ioffset),
72943
+ new BuilderText(buffer, voffset + RECTANGLE_LEGACY_VERTEX_COUNT, ioffset + RECTANGLE_LEGACY_INDEX_COUNT, tvcount, ticount)
72073
72944
  ]).init(shape);
72074
72945
  }
72075
72946
  return null;
@@ -72079,16 +72950,16 @@ var createRectanglePivotedUploaded = function (buffer, shape, voffset, ioffset,
72079
72950
  * Copyright (C) 2019 Toshiba Corporation
72080
72951
  * SPDX-License-Identifier: Apache-2.0
72081
72952
  */
72082
- var createRectangleUploaded = function (buffer, shape, voffset, ioffset, antialiasWeight) {
72953
+ var createRectanglePivotedUploaded = function (buffer, shape, voffset, ioffset, antialiasWeight) {
72083
72954
  var tcount = toTextBufferCount(shape);
72084
72955
  var tvcount = tcount << TEXT_VERTEX_COUNT_SHIFT;
72085
72956
  var ticount = tcount << TEXT_INDEX_COUNT_SHIFT;
72086
- var vcount = RECTANGLE_VERTEX_COUNT + tvcount;
72087
- var icount = RECTANGLE_INDEX_COUNT + ticount;
72957
+ var vcount = RECTANGLE_LEGACY_VERTEX_COUNT + tvcount;
72958
+ var icount = RECTANGLE_LEGACY_INDEX_COUNT + ticount;
72088
72959
  if (buffer.check(voffset, ioffset, vcount, icount)) {
72089
72960
  return new EShapeUploadedImpl(buffer, voffset, ioffset, vcount, icount, [
72090
- new BuilderRectangle(buffer, voffset, ioffset),
72091
- new BuilderText(buffer, voffset + RECTANGLE_VERTEX_COUNT, ioffset + RECTANGLE_INDEX_COUNT, tvcount, ticount)
72961
+ new BuilderRectanglePivoted(buffer, voffset, ioffset),
72962
+ new BuilderText(buffer, voffset + RECTANGLE_LEGACY_VERTEX_COUNT, ioffset + RECTANGLE_LEGACY_INDEX_COUNT, tvcount, ticount)
72092
72963
  ]).init(shape);
72093
72964
  }
72094
72965
  return null;
@@ -73817,7 +74688,7 @@ var EShapeLineOfRectangles = /** @class */ (function (_super) {
73817
74688
  return false;
73818
74689
  };
73819
74690
  return EShapeLineOfRectangles;
73820
- }(EShapeRectangle));
74691
+ }(EShapeRectangleLegacy));
73821
74692
 
73822
74693
  /*
73823
74694
  * Copyright (C) 2019 Toshiba Corporation
@@ -74154,6 +75025,14 @@ var deserializePolygon = function (item, manager, shape) {
74154
75025
  return shape;
74155
75026
  };
74156
75027
 
75028
+ /*
75029
+ * Copyright (C) 2019 Toshiba Corporation
75030
+ * SPDX-License-Identifier: Apache-2.0
75031
+ */
75032
+ var deserializeRectangleLegacy = function (item, manager, shape) {
75033
+ return deserializeBase(item, manager, shape || new EShapeRectangleLegacy());
75034
+ };
75035
+
74157
75036
  /*
74158
75037
  * Copyright (C) 2019 Toshiba Corporation
74159
75038
  * SPDX-License-Identifier: Apache-2.0
@@ -74499,7 +75378,7 @@ var loadShapeGroupShadowed = function () {
74499
75378
  * SPDX-License-Identifier: Apache-2.0
74500
75379
  */
74501
75380
  var loadShapeImage = function () {
74502
- EShapeUploadeds[EShapeType.IMAGE] = createRectangleUploaded;
75381
+ EShapeUploadeds[EShapeType.IMAGE] = createPolygonUploaded;
74503
75382
  EShapeDeserializers[EShapeType.IMAGE] = deserializeImage;
74504
75383
  };
74505
75384
 
@@ -74602,11 +75481,21 @@ var loadShapePolygon = function () {
74602
75481
  * SPDX-License-Identifier: Apache-2.0
74603
75482
  */
74604
75483
  var loadShapeRectangle = function () {
74605
- EShapeUploadeds[EShapeType.RECTANGLE] = createRectangleUploaded;
75484
+ EShapeUploadeds[EShapeType.RECTANGLE] = createPolygonUploaded;
74606
75485
  EShapeDeserializers[EShapeType.RECTANGLE] = deserializeRectangle;
74607
75486
  EShapeCapabilities.set(EShapeType.RECTANGLE, EShapeCapability.PRIMITIVE | EShapeCapability.STROKE_SIDE);
74608
75487
  };
74609
75488
 
75489
+ /*
75490
+ * Copyright (C) 2019 Toshiba Corporation
75491
+ * SPDX-License-Identifier: Apache-2.0
75492
+ */
75493
+ var loadShapeRectangleLegacy = function () {
75494
+ EShapeUploadeds[EShapeType.RECTANGLE_LEGACY] = createRectangleLegacyUploaded;
75495
+ EShapeDeserializers[EShapeType.RECTANGLE_LEGACY] = deserializeRectangleLegacy;
75496
+ EShapeCapabilities.set(EShapeType.RECTANGLE_LEGACY, EShapeCapability.PRIMITIVE | EShapeCapability.STROKE_SIDE);
75497
+ };
75498
+
74610
75499
  /*
74611
75500
  * Copyright (C) 2019 Toshiba Corporation
74612
75501
  * SPDX-License-Identifier: Apache-2.0
@@ -74675,6 +75564,7 @@ var loadShapeAll = function () {
74675
75564
  loadShapeLine();
74676
75565
  loadShapeNull();
74677
75566
  loadShapePolygon();
75567
+ loadShapeRectangleLegacy();
74678
75568
  loadShapeRectanglePivoted();
74679
75569
  loadShapeRectangleRounded();
74680
75570
  loadShapeRectangle();
@@ -105536,7 +106426,8 @@ exports.BuilderMarkerTriangleHead = BuilderMarkerTriangleHead;
105536
106426
  exports.BuilderMarkerTriangleTail = BuilderMarkerTriangleTail;
105537
106427
  exports.BuilderNull = BuilderNull;
105538
106428
  exports.BuilderPolygon = BuilderPolygon;
105539
- exports.BuilderRectangle = BuilderRectangle;
106429
+ exports.BuilderRectangle = BuilderRectangleLegacy;
106430
+ exports.BuilderRectangleLegacy = BuilderRectangleLegacy;
105540
106431
  exports.BuilderRectanglePivoted = BuilderRectanglePivoted;
105541
106432
  exports.BuilderRectangleRounded = BuilderRectangleRounded;
105542
106433
  exports.BuilderSemicircle = BuilderSemicircle;
@@ -106863,8 +107754,10 @@ exports.EShapePolygonPoints = EShapePolygonPoints;
106863
107754
  exports.EShapePolygonTriangulatedImpl = EShapePolygonTriangulatedImpl;
106864
107755
  exports.EShapePrimitive = EShapePrimitive;
106865
107756
  exports.EShapeRectangle = EShapeRectangle;
107757
+ exports.EShapeRectangleLegacy = EShapeRectangleLegacy;
106866
107758
  exports.EShapeRectanglePivoted = EShapeRectanglePivoted;
106867
107759
  exports.EShapeRectangleRounded = EShapeRectangleRounded;
107760
+ exports.EShapeRectangleTriangulatedImpl = EShapeRectangleTriangulatedImpl;
106868
107761
  exports.EShapeRenderer = EShapeRenderer;
106869
107762
  exports.EShapeRendererIterator = EShapeRendererIterator;
106870
107763
  exports.EShapeRendererIteratorDatum = EShapeRendererIteratorDatum;
@@ -106953,12 +107846,15 @@ exports.IMAGE_SDF_WORLD_SIZE = IMAGE_SDF_WORLD_SIZE;
106953
107846
  exports.Lazy = Lazy;
106954
107847
  exports.NumberFormatterImpl = NumberFormatterImpl;
106955
107848
  exports.NumberFormatters = NumberFormatters;
106956
- exports.RECTANGLE_INDEX_COUNT = RECTANGLE_INDEX_COUNT;
107849
+ exports.RECTANGLE_INDEX_COUNT = RECTANGLE_LEGACY_INDEX_COUNT;
107850
+ exports.RECTANGLE_LEGACY_INDEX_COUNT = RECTANGLE_LEGACY_INDEX_COUNT;
107851
+ exports.RECTANGLE_LEGACY_VERTEX_COUNT = RECTANGLE_LEGACY_VERTEX_COUNT;
107852
+ exports.RECTANGLE_LEGACY_WORLD_SIZE = RECTANGLE_LEGACY_WORLD_SIZE;
106957
107853
  exports.RECTANGLE_ROUNDED_INDEX_COUNT = RECTANGLE_ROUNDED_INDEX_COUNT;
106958
107854
  exports.RECTANGLE_ROUNDED_VERTEX_COUNT = RECTANGLE_ROUNDED_VERTEX_COUNT;
106959
107855
  exports.RECTANGLE_ROUNDED_WORLD_SIZE = RECTANGLE_ROUNDED_WORLD_SIZE;
106960
- exports.RECTANGLE_VERTEX_COUNT = RECTANGLE_VERTEX_COUNT;
106961
- exports.RECTANGLE_WORLD_SIZE = RECTANGLE_WORLD_SIZE;
107856
+ exports.RECTANGLE_VERTEX_COUNT = RECTANGLE_LEGACY_VERTEX_COUNT;
107857
+ exports.RECTANGLE_WORLD_SIZE = RECTANGLE_LEGACY_WORLD_SIZE;
106962
107858
  exports.SEMICIRCLE_INDEX_COUNT = SEMICIRCLE_INDEX_COUNT;
106963
107859
  exports.SEMICIRCLE_VERTEX_COUNT = SEMICIRCLE_VERTEX_COUNT;
106964
107860
  exports.SEMICIRCLE_WORLD_SIZE = SEMICIRCLE_WORLD_SIZE;
@@ -107049,14 +107945,18 @@ exports.buildPolygonStepX = buildPolygonStepX;
107049
107945
  exports.buildPolygonStepY = buildPolygonStepY;
107050
107946
  exports.buildPolygonUv = buildPolygonUv;
107051
107947
  exports.buildPolygonVertex = buildPolygonVertex;
107052
- exports.buildRectangleIndex = buildRectangleIndex;
107948
+ exports.buildRectangleIndex = buildRectangleLegacyIndex;
107949
+ exports.buildRectangleLegacyIndex = buildRectangleLegacyIndex;
107950
+ exports.buildRectangleLegacyStep = buildRectangleLegacyStep;
107951
+ exports.buildRectangleLegacyUv = buildRectangleLegacyUv;
107952
+ exports.buildRectangleLegacyVertex = buildRectangleLegacyVertex;
107053
107953
  exports.buildRectangleRoundedIndex = buildRectangleRoundedIndex;
107054
107954
  exports.buildRectangleRoundedStep = buildRectangleRoundedStep;
107055
107955
  exports.buildRectangleRoundedUv = buildRectangleRoundedUv;
107056
107956
  exports.buildRectangleRoundedVertex = buildRectangleRoundedVertex;
107057
- exports.buildRectangleStep = buildRectangleStep;
107058
- exports.buildRectangleUv = buildRectangleUv;
107059
- exports.buildRectangleVertex = buildRectangleVertex;
107957
+ exports.buildRectangleStep = buildRectangleLegacyStep;
107958
+ exports.buildRectangleUv = buildRectangleLegacyUv;
107959
+ exports.buildRectangleVertex = buildRectangleLegacyVertex;
107060
107960
  exports.buildSemicircleIndex = buildSemicircleIndex;
107061
107961
  exports.buildSemicircleStep = buildSemicircleStep;
107062
107962
  exports.buildSemicircleUv = buildSemicircleUv;
@@ -107096,9 +107996,10 @@ exports.createLineUploaded = createLineUploaded;
107096
107996
  exports.createNullUploaded = createNullUploaded;
107097
107997
  exports.createPolygon = createPolygon;
107098
107998
  exports.createPolygonUploaded = createPolygonUploaded;
107999
+ exports.createRectangleLegacyUploaded = createRectangleLegacyUploaded;
107099
108000
  exports.createRectanglePivotedUploaded = createRectanglePivotedUploaded;
107100
108001
  exports.createRectangleRoundedUploaded = createRectangleRoundedUploaded;
107101
- exports.createRectangleUploaded = createRectangleUploaded;
108002
+ exports.createRectangleUploaded = createRectangleLegacyUploaded;
107102
108003
  exports.createSemicircleUploaded = createSemicircleUploaded;
107103
108004
  exports.createTriangleRoundedUploaded = createTriangleRoundedUploaded;
107104
108005
  exports.createTriangleUploaded = createTriangleUploaded;
@@ -107134,6 +108035,7 @@ exports.deserializeLineOfTriangles = deserializeLineOfTriangles;
107134
108035
  exports.deserializeNull = deserializeNull;
107135
108036
  exports.deserializePolygon = deserializePolygon;
107136
108037
  exports.deserializeRectangle = deserializeRectangle;
108038
+ exports.deserializeRectangleLegacy = deserializeRectangleLegacy;
107137
108039
  exports.deserializeRectanglePivoted = deserializeRectanglePivoted;
107138
108040
  exports.deserializeRectangleRounded = deserializeRectangleRounded;
107139
108041
  exports.deserializeSemicircle = deserializeSemicircle;
@@ -107186,6 +108088,8 @@ exports.loadShapeLineOfTriangles = loadShapeLineOfTriangles;
107186
108088
  exports.loadShapeNull = loadShapeNull;
107187
108089
  exports.loadShapePolygon = loadShapePolygon;
107188
108090
  exports.loadShapeRectangle = loadShapeRectangle;
108091
+ exports.loadShapeRectangleLegacy = loadShapeRectangleLegacy;
108092
+ exports.loadShapeRectanglePivoted = loadShapeRectanglePivoted;
107189
108093
  exports.loadShapeRectangleRounded = loadShapeRectangleRounded;
107190
108094
  exports.loadShapeSemicircle = loadShapeSemicircle;
107191
108095
  exports.loadShapeTriangle = loadShapeTriangle;