@wcardinal/wcardinal-ui 0.464.0 → 0.465.1

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 (46) hide show
  1. package/dist/types/wcardinal/ui/shape/variant/e-shape-circle-triangulated-impl.d.ts +4 -4
  2. package/dist/types/wcardinal/ui/shape/variant/to-packed.d.ts +2 -1
  3. package/dist/types/wcardinal/ui/util/util-straight-skeleton-buffer.d.ts +4 -3
  4. package/dist/wcardinal/ui/shape/e-shape-renderer.js +1 -1
  5. package/dist/wcardinal/ui/shape/e-shape-renderer.js.map +1 -1
  6. package/dist/wcardinal/ui/shape/variant/build-circle-legacy.js +5 -5
  7. package/dist/wcardinal/ui/shape/variant/build-circle-legacy.js.map +1 -1
  8. package/dist/wcardinal/ui/shape/variant/build-color.js +2 -2
  9. package/dist/wcardinal/ui/shape/variant/build-color.js.map +1 -1
  10. package/dist/wcardinal/ui/shape/variant/build-polygon.js +3 -3
  11. package/dist/wcardinal/ui/shape/variant/build-polygon.js.map +1 -1
  12. package/dist/wcardinal/ui/shape/variant/build-rectangle-rounded.js +9 -9
  13. package/dist/wcardinal/ui/shape/variant/build-rectangle-rounded.js.map +1 -1
  14. package/dist/wcardinal/ui/shape/variant/build-rectangle.js +5 -5
  15. package/dist/wcardinal/ui/shape/variant/build-rectangle.js.map +1 -1
  16. package/dist/wcardinal/ui/shape/variant/build-semicircle.js +5 -5
  17. package/dist/wcardinal/ui/shape/variant/build-semicircle.js.map +1 -1
  18. package/dist/wcardinal/ui/shape/variant/build-triangle-rounded.js +9 -9
  19. package/dist/wcardinal/ui/shape/variant/build-triangle-rounded.js.map +1 -1
  20. package/dist/wcardinal/ui/shape/variant/build-triangle.js +4 -4
  21. package/dist/wcardinal/ui/shape/variant/build-triangle.js.map +1 -1
  22. package/dist/wcardinal/ui/shape/variant/e-shape-circle-triangulated-impl.js +101 -43
  23. package/dist/wcardinal/ui/shape/variant/e-shape-circle-triangulated-impl.js.map +1 -1
  24. package/dist/wcardinal/ui/shape/variant/e-shape-polygon-triangulated-impl.js +3 -2
  25. package/dist/wcardinal/ui/shape/variant/e-shape-polygon-triangulated-impl.js.map +1 -1
  26. package/dist/wcardinal/ui/shape/variant/to-packed.js +7 -2
  27. package/dist/wcardinal/ui/shape/variant/to-packed.js.map +1 -1
  28. package/dist/wcardinal/ui/util/util-straight-skeleton-buffer.js +40 -7
  29. package/dist/wcardinal/ui/util/util-straight-skeleton-buffer.js.map +1 -1
  30. package/dist/wcardinal-ui-theme-dark-en-us.js +1 -1
  31. package/dist/wcardinal-ui-theme-dark-en-us.min.js +1 -1
  32. package/dist/wcardinal-ui-theme-dark-ja-jp.js +1 -1
  33. package/dist/wcardinal-ui-theme-dark-ja-jp.min.js +1 -1
  34. package/dist/wcardinal-ui-theme-dark.js +1 -1
  35. package/dist/wcardinal-ui-theme-dark.min.js +1 -1
  36. package/dist/wcardinal-ui-theme-white-en-us.js +1 -1
  37. package/dist/wcardinal-ui-theme-white-en-us.min.js +1 -1
  38. package/dist/wcardinal-ui-theme-white-ja-jp.js +1 -1
  39. package/dist/wcardinal-ui-theme-white-ja-jp.min.js +1 -1
  40. package/dist/wcardinal-ui-theme-white.js +1 -1
  41. package/dist/wcardinal-ui-theme-white.min.js +1 -1
  42. package/dist/wcardinal-ui.cjs.js +187 -90
  43. package/dist/wcardinal-ui.js +187 -90
  44. package/dist/wcardinal-ui.min.js +2 -2
  45. package/dist/wcardinal-ui.min.js.map +1 -1
  46. package/package.json +4 -2
@@ -1,5 +1,5 @@
1
1
  /*!
2
- Winter Cardinal UI v0.464.0
2
+ Winter Cardinal UI v0.465.1
3
3
  Copyright (C) 2019-2026 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*!
2
- Winter Cardinal UI v0.464.0
2
+ Winter Cardinal UI v0.465.1
3
3
  Copyright (C) 2019-2026 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*!
2
- Winter Cardinal UI v0.464.0
2
+ Winter Cardinal UI v0.465.1
3
3
  Copyright (C) 2019-2026 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*!
2
- Winter Cardinal UI v0.464.0
2
+ Winter Cardinal UI v0.465.1
3
3
  Copyright (C) 2019-2026 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*!
2
- Winter Cardinal UI v0.464.0
2
+ Winter Cardinal UI v0.465.1
3
3
  Copyright (C) 2019-2026 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -253,8 +253,13 @@ var toNormalPacked = function (n0, n1) {
253
253
  var toPackedI4x64 = function (i0, i1, i2, i3) {
254
254
  return i0 + (i1 << 6) + (i2 << 12) + (i3 << 18);
255
255
  };
256
- var toPackedF2x1024 = function (f0, f1) {
257
- return Math.round(1023 * f0) + (Math.round(1023 * f1) << 10);
256
+ var toPackedAlphas = function (a0, a1) {
257
+ return Math.round(1023 * a0) + (Math.round(1023 * a1) << 10);
258
+ };
259
+ var toPackedClippings = function (x, y) {
260
+ // Since 1023 / 1.1 = 930,
261
+ // Math.round(1023 * (x / 1.1)) = Math.round(930 * x)
262
+ return Math.round(930 * x) + (Math.round(930 * y) << 10);
258
263
  };
259
264
 
260
265
  var BAR_VERTEX_COUNT = 4;
@@ -1438,7 +1443,7 @@ var BuilderFlag = {
1438
1443
  };
1439
1444
 
1440
1445
  var buildColor = function (fillColor, fillAlpha, strokeColor, strokeAlpha, voffset, vcount, colors) {
1441
- var alpha = toPackedF2x1024(Math.max(0, Math.min(1, fillAlpha)), Math.max(0, Math.min(1, strokeAlpha)));
1446
+ var alpha = toPackedAlphas(Math.max(0, Math.min(1, fillAlpha)), Math.max(0, Math.min(1, strokeAlpha)));
1442
1447
  var ic = voffset * 3 - 1;
1443
1448
  var icmax = (voffset + vcount) * 3 - 1;
1444
1449
  for (; ic < icmax;) {
@@ -16700,7 +16705,7 @@ var EShapeRendererIterator = /** @class */ (function () {
16700
16705
  * Copyright (C) 2019 Toshiba Corporation
16701
16706
  * SPDX-License-Identifier: Apache-2.0
16702
16707
  */
16703
- 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 toUnpackedF2x1024(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, toUnpackedF2x1024(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 = toUnpackedF2x1024(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}";
16708
+ 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}";
16704
16709
  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}";
16705
16710
  var EShapeRenderer = /** @class */ (function (_super) {
16706
16711
  __extends(EShapeRenderer, _super);
@@ -32554,10 +32559,10 @@ var EShapeCircleTriangulatedImpl = /** @class */ (function () {
32554
32559
  if (isNotInitialized || isSizeChanged) {
32555
32560
  this._sizeX = sizeX;
32556
32561
  this._sizeY = sizeY;
32557
- this.update(sizeX, sizeY, this._n);
32562
+ this.update(sizeX, sizeY, 1.1, this._n);
32558
32563
  }
32559
32564
  };
32560
- EShapeCircleTriangulatedImpl.prototype.update = function (sizeX, sizeY, n) {
32565
+ EShapeCircleTriangulatedImpl.prototype.update = function (sizeX, sizeY, scale, n) {
32561
32566
  // Boundary
32562
32567
  var ax = Math.abs(sizeX);
32563
32568
  var ay = Math.abs(sizeY);
@@ -32578,13 +32583,13 @@ var EShapeCircleTriangulatedImpl = /** @class */ (function () {
32578
32583
  this.pad(0, 0, nv, ni, 0);
32579
32584
  }
32580
32585
  else if (ax === ay) {
32581
- this.update0(sizeX, sizeY, n, nv, ni);
32586
+ this.update0(sizeX, sizeY, scale, n, nv, ni);
32582
32587
  }
32583
32588
  else if (ay < ax) {
32584
- this.update1(sizeX, sizeY, n, nv, ni);
32589
+ this.update1(sizeX, sizeY, scale, n, nv, ni);
32585
32590
  }
32586
32591
  else {
32587
- this.update2(sizeX, sizeY, n, nv, ni);
32592
+ this.update2(sizeX, sizeY, scale, n, nv, ni);
32588
32593
  }
32589
32594
  };
32590
32595
  /**
@@ -32622,7 +32627,7 @@ var EShapeCircleTriangulatedImpl = /** @class */ (function () {
32622
32627
  /**
32623
32628
  * Precondition: sizeX !== 0 && sizeY !== 0 & abs(sizeX) === abs(sizeY)
32624
32629
  */
32625
- EShapeCircleTriangulatedImpl.prototype.update0 = function (sizeX, sizeY, n, nv, ni) {
32630
+ EShapeCircleTriangulatedImpl.prototype.update0 = function (sizeX, sizeY, scale, n, nv, ni) {
32626
32631
  var vertices = this._vertices;
32627
32632
  var distances = this._distances;
32628
32633
  var lengths = this._lengths;
@@ -32637,6 +32642,8 @@ var EShapeCircleTriangulatedImpl = /** @class */ (function () {
32637
32642
  var y0 = sizeY;
32638
32643
  var u = -s;
32639
32644
  var v = c;
32645
+ var su = scale * u;
32646
+ var sv = scale * v;
32640
32647
  var x1 = u * sizeX;
32641
32648
  var y1 = v * sizeY;
32642
32649
  var dx = 0.5 * (x1 + x0) - 0;
@@ -32647,25 +32654,25 @@ var EShapeCircleTriangulatedImpl = /** @class */ (function () {
32647
32654
  var dl = Math.sqrt(lx * lx + ly * ly);
32648
32655
  var l1 = dl;
32649
32656
  var l2 = 0.5 * dl;
32650
- vertices[0] = x0;
32651
- vertices[1] = y0;
32652
- vertices[2] = x1;
32653
- vertices[3] = y1;
32657
+ vertices[0] = 0;
32658
+ vertices[1] = scale * sizeY;
32659
+ vertices[2] = su * sizeX;
32660
+ vertices[3] = sv * sizeY;
32654
32661
  vertices[4] = 0;
32655
32662
  vertices[5] = 0;
32656
32663
  distances[0] = fdistance;
32657
32664
  distances[1] = fdistance;
32658
32665
  distances[2] = fdistance;
32659
- clippings[0] = 1;
32660
- clippings[1] = 1;
32666
+ clippings[0] = scale;
32667
+ clippings[1] = scale;
32661
32668
  clippings[2] = 0;
32662
32669
  lengths[0] = 0;
32663
32670
  lengths[1] = l1;
32664
32671
  lengths[2] = l2;
32665
32672
  uvs[0] = 0.5;
32666
- uvs[1] = 1.0;
32667
- uvs[2] = 0.5 * (u + 1);
32668
- uvs[3] = 0.5 * (v + 1);
32673
+ uvs[1] = 0.5 * (scale + 1);
32674
+ uvs[2] = 0.5 * (su + 1);
32675
+ uvs[3] = 0.5 * (sv + 1);
32669
32676
  uvs[4] = 0.5;
32670
32677
  uvs[5] = 0.5;
32671
32678
  indices[0] = 0;
@@ -32680,20 +32687,22 @@ var EShapeCircleTriangulatedImpl = /** @class */ (function () {
32680
32687
  var vn = s * u + c * v;
32681
32688
  u = un;
32682
32689
  v = vn;
32690
+ su = scale * u;
32691
+ sv = scale * v;
32683
32692
  l1 += dl;
32684
32693
  l2 += dl;
32685
- vertices[iv2 + 0] = sizeX * u;
32686
- vertices[iv2 + 1] = sizeY * v;
32694
+ vertices[iv2 + 0] = su * sizeX;
32695
+ vertices[iv2 + 1] = sv * sizeY;
32687
32696
  vertices[iv2 + 2] = 0;
32688
32697
  vertices[iv2 + 3] = 0;
32689
32698
  distances[iv1 + 0] = fdistance;
32690
32699
  distances[iv1 + 1] = fdistance;
32691
- clippings[iv1 + 0] = 1;
32700
+ clippings[iv1 + 0] = scale;
32692
32701
  clippings[iv1 + 1] = 0;
32693
32702
  lengths[iv1 + 0] = l1;
32694
32703
  lengths[iv1 + 1] = l2;
32695
- uvs[iv2 + 0] = 0.5 * (u + 1);
32696
- uvs[iv2 + 1] = 0.5 * (v + 1);
32704
+ uvs[iv2 + 0] = 0.5 * (su + 1);
32705
+ uvs[iv2 + 1] = 0.5 * (sv + 1);
32697
32706
  uvs[iv2 + 2] = 0.5;
32698
32707
  uvs[iv2 + 3] = 0.5;
32699
32708
  indices[ii + 0] = iv1 - 2;
@@ -32709,7 +32718,7 @@ var EShapeCircleTriangulatedImpl = /** @class */ (function () {
32709
32718
  /**
32710
32719
  * Precondition: sizeX !== 0 && sizeY !== 0 && abs(sizeY) < abs(sizeX)
32711
32720
  */
32712
- EShapeCircleTriangulatedImpl.prototype.update1 = function (sizeX, sizeY, n, nv, ni) {
32721
+ EShapeCircleTriangulatedImpl.prototype.update1 = function (sizeX, sizeY, scale, n, nv, ni) {
32713
32722
  var vertices = this._vertices;
32714
32723
  var distances = this._distances;
32715
32724
  var lengths = this._lengths;
@@ -32734,7 +32743,8 @@ var EShapeCircleTriangulatedImpl = /** @class */ (function () {
32734
32743
  var sx = this.toSkeletonX(ppx, ppy, px, py, nx, ny);
32735
32744
  vertices[0] = 0;
32736
32745
  vertices[1] = sizeY;
32737
- clippings[0] = 0;
32746
+ clippings[0] = -1;
32747
+ distances[0] = sx;
32738
32748
  lengths[0] = 0;
32739
32749
  uvs[0] = 0.5;
32740
32750
  uvs[1] = 1;
@@ -32760,33 +32770,41 @@ var EShapeCircleTriangulatedImpl = /** @class */ (function () {
32760
32770
  var nlength = length + dl;
32761
32771
  var iv1 = iv++;
32762
32772
  var iv2 = iv1 << 1;
32773
+ var niv1 = iv++;
32774
+ var niv2 = niv1 << 1;
32775
+ var ndistance = Math.abs(-dx * py - dy * (nsx - px)) * fl;
32776
+ maxDistance = Math.max(maxDistance, ndistance);
32763
32777
  vertices[iv2 + 0] = nx;
32764
32778
  vertices[iv2 + 1] = ny;
32765
- clippings[iv1] = 0;
32779
+ clippings[iv1] = -1 - ndistance;
32780
+ distances[iv1] = nsx;
32766
32781
  lengths[iv1] = nlength;
32767
32782
  uvs[iv2 + 0] = 0.5 * (nx / sizeX + 1);
32768
32783
  uvs[iv2 + 1] = 0.5 * (ny / sizeY + 1);
32769
- var niv1 = iv++;
32770
- var niv2 = niv1 << 1;
32771
- var ndistance = Math.abs(-dx * py - dy * (nsx - px)) * fl;
32772
- vertices[niv2] = nsx;
32784
+ vertices[niv2 + 0] = nsx;
32773
32785
  vertices[niv2 + 1] = 0;
32774
32786
  clippings[niv1] = ndistance;
32775
- maxDistance = Math.max(maxDistance, ndistance);
32787
+ distances[niv1] = 0;
32776
32788
  lengths[niv1] = length + ((nsx - px) * dx - py * dy) * fl;
32777
32789
  uvs[niv2] = 0.5 * (nsx / sizeX + 1);
32778
32790
  uvs[niv2 + 1] = 0.5;
32779
32791
  indices[ii++] = current;
32780
32792
  indices[ii++] = iv1;
32781
32793
  indices[ii++] = niv1;
32782
- if (sx !== nsx) {
32794
+ distances[current] = sx;
32795
+ if (sx === nsx) {
32796
+ clippings[current] = -1 - ndistance;
32797
+ }
32798
+ else {
32799
+ var mdistance = Math.abs(-dx * py - dy * (sx - px)) * fl;
32800
+ maxDistance = Math.max(maxDistance, mdistance);
32801
+ clippings[current] = -1 - mdistance;
32783
32802
  var miv1 = iv++;
32784
32803
  var miv2 = miv1 << 1;
32785
- var mdistance = Math.abs(-dx * py - dy * (sx - px)) * fl;
32786
32804
  vertices[miv2] = sx;
32787
32805
  vertices[miv2 + 1] = 0;
32788
32806
  clippings[miv1] = mdistance;
32789
- maxDistance = Math.max(maxDistance, mdistance);
32807
+ distances[miv1] = 0;
32790
32808
  lengths[miv1] = length + ((sx - px) * dx - py * dy) * fl;
32791
32809
  uvs[miv2] = 0.5 * (sx / sizeX + 1);
32792
32810
  uvs[miv2 + 1] = 0.5;
@@ -32808,9 +32826,27 @@ var EShapeCircleTriangulatedImpl = /** @class */ (function () {
32808
32826
  if (0 < maxDistance) {
32809
32827
  fdistance = 1 / maxDistance;
32810
32828
  }
32829
+ var shift = (scale - 1) * maxDistance;
32811
32830
  for (var i = 0; i < iv; ++i) {
32831
+ var clipping = clippings[i];
32832
+ if (0 <= clipping) {
32833
+ clippings[i] = 1 - clipping * fdistance;
32834
+ }
32835
+ else {
32836
+ var distance = -1 - clipping;
32837
+ if (0 < distance) {
32838
+ var i2 = i << 1;
32839
+ var factor = shift / distance;
32840
+ var x = vertices[i2] + (vertices[i2] - distances[i]) * factor;
32841
+ var y = vertices[i2 + 1] * (1 + factor);
32842
+ vertices[i2] = x;
32843
+ vertices[i2 + 1] = y;
32844
+ uvs[i2] = 0.5 * (x / sizeX + 1);
32845
+ uvs[i2 + 1] = 0.5 * (y / sizeY + 1);
32846
+ }
32847
+ clippings[i] = scale;
32848
+ }
32812
32849
  distances[i] = fdistance;
32813
- clippings[i] = 1 - clippings[i] * fdistance;
32814
32850
  }
32815
32851
  // The skeleton points of adjacent vertices may coincide on a nearly circular ellipse.
32816
32852
  this.pad(iv, ii, nv, ni, fdistance);
@@ -32829,7 +32865,7 @@ var EShapeCircleTriangulatedImpl = /** @class */ (function () {
32829
32865
  /**
32830
32866
  * Precondition: sizeX !== 0 && sizeY !== 0 && abs(sizeX) < abs(sizeY)
32831
32867
  */
32832
- EShapeCircleTriangulatedImpl.prototype.update2 = function (sizeX, sizeY, n, nv, ni) {
32868
+ EShapeCircleTriangulatedImpl.prototype.update2 = function (sizeX, sizeY, scale, n, nv, ni) {
32833
32869
  var vertices = this._vertices;
32834
32870
  var distances = this._distances;
32835
32871
  var lengths = this._lengths;
@@ -32856,7 +32892,8 @@ var EShapeCircleTriangulatedImpl = /** @class */ (function () {
32856
32892
  var sy = this.toSkeletonY(pppx, pppy, ppx, ppy, px, py);
32857
32893
  vertices[0] = 0;
32858
32894
  vertices[1] = sizeY;
32859
- clippings[0] = 0;
32895
+ clippings[0] = -1;
32896
+ distances[0] = sy;
32860
32897
  lengths[0] = 0;
32861
32898
  uvs[0] = 0.5;
32862
32899
  uvs[1] = 1;
@@ -32882,33 +32919,41 @@ var EShapeCircleTriangulatedImpl = /** @class */ (function () {
32882
32919
  var nlength = length + dl;
32883
32920
  var iv1 = iv++;
32884
32921
  var iv2 = iv1 << 1;
32922
+ var niv1 = iv++;
32923
+ var niv2 = niv1 << 1;
32924
+ var ndistance = Math.abs(dx * (nsy - py) + dy * px) * fl;
32925
+ maxDistance = Math.max(maxDistance, ndistance);
32885
32926
  vertices[iv2 + 0] = nx;
32886
32927
  vertices[iv2 + 1] = ny;
32887
- clippings[iv1] = 0;
32928
+ clippings[iv1] = -1 - ndistance;
32929
+ distances[iv1] = nsy;
32888
32930
  lengths[iv1] = nlength;
32889
32931
  uvs[iv2 + 0] = 0.5 * (nx / sizeX + 1);
32890
32932
  uvs[iv2 + 1] = 0.5 * (ny / sizeY + 1);
32891
- var niv1 = iv++;
32892
- var niv2 = niv1 << 1;
32893
- var ndistance = Math.abs(dx * (nsy - py) + dy * px) * fl;
32894
32933
  vertices[niv2] = 0;
32895
32934
  vertices[niv2 + 1] = nsy;
32896
32935
  clippings[niv1] = ndistance;
32897
- maxDistance = Math.max(maxDistance, ndistance);
32936
+ distances[niv1] = 0;
32898
32937
  lengths[niv1] = length + (-px * dx + (nsy - py) * dy) * fl;
32899
32938
  uvs[niv2] = 0.5;
32900
32939
  uvs[niv2 + 1] = 0.5 * (nsy / sizeY + 1);
32901
32940
  indices[ii++] = current;
32902
32941
  indices[ii++] = iv1;
32903
32942
  indices[ii++] = niv1;
32904
- if (sy !== nsy) {
32943
+ distances[current] = sy;
32944
+ if (sy === nsy) {
32945
+ clippings[current] = -1 - ndistance;
32946
+ }
32947
+ else {
32948
+ var mdistance = Math.abs(dx * (sy - py) + dy * px) * fl;
32949
+ maxDistance = Math.max(maxDistance, mdistance);
32950
+ clippings[current] = -1 - mdistance;
32905
32951
  var miv1 = iv++;
32906
32952
  var miv2 = miv1 << 1;
32907
- var mdistance = Math.abs(dx * (sy - py) + dy * px) * fl;
32908
32953
  vertices[miv2] = 0;
32909
32954
  vertices[miv2 + 1] = sy;
32910
32955
  clippings[miv1] = mdistance;
32911
- maxDistance = Math.max(maxDistance, mdistance);
32956
+ distances[miv1] = 0;
32912
32957
  lengths[miv1] = length + (-px * dx + (sy - py) * dy) * fl;
32913
32958
  uvs[miv2] = 0.5;
32914
32959
  uvs[miv2 + 1] = 0.5 * (sy / sizeY + 1);
@@ -32930,9 +32975,27 @@ var EShapeCircleTriangulatedImpl = /** @class */ (function () {
32930
32975
  if (0 < maxDistance) {
32931
32976
  fdistance = 1 / maxDistance;
32932
32977
  }
32978
+ var shift = (scale - 1) * maxDistance;
32933
32979
  for (var i = 0; i < iv; ++i) {
32980
+ var clipping = clippings[i];
32981
+ if (0 <= clipping) {
32982
+ clippings[i] = 1 - clipping * fdistance;
32983
+ }
32984
+ else {
32985
+ var distance = -1 - clipping;
32986
+ if (0 < distance) {
32987
+ var i2 = i << 1;
32988
+ var factor = shift / distance;
32989
+ var x = vertices[i2] * (1 + factor);
32990
+ var y = vertices[i2 + 1] + (vertices[i2 + 1] - distances[i]) * factor;
32991
+ vertices[i2] = x;
32992
+ vertices[i2 + 1] = y;
32993
+ uvs[i2] = 0.5 * (x / sizeX + 1);
32994
+ uvs[i2 + 1] = 0.5 * (y / sizeY + 1);
32995
+ }
32996
+ clippings[i] = scale;
32997
+ }
32934
32998
  distances[i] = fdistance;
32935
- clippings[i] = 1 - clippings[i] * fdistance;
32936
32999
  }
32937
33000
  // The skeleton points of adjacent vertices may coincide on a nearly circular ellipse.
32938
33001
  this.pad(iv, ii, nv, ni, fdistance);
@@ -63155,14 +63218,14 @@ var buildRectangleRoundedStep = function (steps, voffset, strokeWidth, strokeSid
63155
63218
  var erb1 = toPackedI4x64(1, scaleInvariant, wr, wb);
63156
63219
  var rxi = 1 - worldSize[3];
63157
63220
  var ryi = 1 - worldSize[4];
63158
- var c11 = toPackedF2x1024(1, 1);
63159
- var c01 = toPackedF2x1024(0, 1);
63160
- var c10 = toPackedF2x1024(1, 0);
63161
- var c00 = toPackedF2x1024(0, 0);
63162
- var cx1 = toPackedF2x1024(rxi, 1);
63163
- var c1y = toPackedF2x1024(1, ryi);
63164
- var cxy = toPackedF2x1024(rxi, ryi);
63165
- var c0y = toPackedF2x1024(0, ryi);
63221
+ var c11 = toPackedClippings(1, 1);
63222
+ var c01 = toPackedClippings(0, 1);
63223
+ var c10 = toPackedClippings(1, 0);
63224
+ var c00 = toPackedClippings(0, 0);
63225
+ var cx1 = toPackedClippings(rxi, 1);
63226
+ var c1y = toPackedClippings(1, ryi);
63227
+ var cxy = toPackedClippings(rxi, ryi);
63228
+ var c0y = toPackedClippings(0, ryi);
63166
63229
  // c0 c1 c4 c5
63167
63230
  // |---| |---|
63168
63231
  // | | | |
@@ -64669,7 +64732,7 @@ var buildPolygonStepX = function (steps, polygonDistances, polygonLengths, polyg
64669
64732
  steps[++is] = e;
64670
64733
  steps[++is] = polygonDistances[i];
64671
64734
  steps[++is] = afp * (fp - polygonUvs[j]);
64672
- steps[++is] = toPackedF2x1024(polygonClippings[i], 0);
64735
+ steps[++is] = toPackedClippings(polygonClippings[i], 0);
64673
64736
  steps[++is] = polygonLengths[i];
64674
64737
  }
64675
64738
  };
@@ -64680,7 +64743,7 @@ var buildPolygonStepY = function (steps, polygonDistances, polygonLengths, polyg
64680
64743
  steps[++is] = e;
64681
64744
  steps[++is] = polygonDistances[i];
64682
64745
  steps[++is] = afp * (fp - polygonUvs[j]);
64683
- steps[++is] = toPackedF2x1024(polygonClippings[i], 0);
64746
+ steps[++is] = toPackedClippings(polygonClippings[i], 0);
64684
64747
  steps[++is] = polygonLengths[i];
64685
64748
  }
64686
64749
  };
@@ -64967,10 +65030,10 @@ var buildCircleLegacyStep = function (steps, voffset, strokeWidth, strokeStyle,
64967
65030
  var ax = worldSize[0];
64968
65031
  var ay = worldSize[1];
64969
65032
  var e = toPackedI4x64(1, scaleInvariant, 1, 1);
64970
- var c11 = toPackedF2x1024(1, 1);
64971
- var c01 = toPackedF2x1024(0, 1);
64972
- var c10 = toPackedF2x1024(1, 0);
64973
- var c00 = toPackedF2x1024(0, 0);
65033
+ var c11 = toPackedClippings(1, 1);
65034
+ var c01 = toPackedClippings(0, 1);
65035
+ var c10 = toPackedClippings(1, 0);
65036
+ var c00 = toPackedClippings(0, 0);
64974
65037
  var is = voffset * 6 - 1;
64975
65038
  steps[++is] = strokeWidth;
64976
65039
  steps[++is] = e;
@@ -66159,10 +66222,10 @@ var buildRectangleStep = function (voffset, steps, strokeWidth, strokeSide, stro
66159
66222
  var ert = toPackedI4x64(0, scaleInvariant, wr, wt);
66160
66223
  var elb = toPackedI4x64(0, scaleInvariant, wl, wb);
66161
66224
  var erb = toPackedI4x64(0, scaleInvariant, wr, wb);
66162
- var c11 = toPackedF2x1024(1, 1);
66163
- var c01 = toPackedF2x1024(0, 1);
66164
- var c00 = toPackedF2x1024(0, 0);
66165
- var c10 = toPackedF2x1024(1, 0);
66225
+ var c11 = toPackedClippings(1, 1);
66226
+ var c01 = toPackedClippings(0, 1);
66227
+ var c00 = toPackedClippings(0, 0);
66228
+ var c10 = toPackedClippings(1, 0);
66166
66229
  // c0 c1 c4 c5
66167
66230
  // |-----| |-----|
66168
66231
  // | | | |
@@ -66420,10 +66483,10 @@ var buildSemicircleStep = function (steps, voffset, strokeWidth, strokeStyle, wo
66420
66483
  var ws0 = worldSize[0];
66421
66484
  var ws1 = worldSize[1];
66422
66485
  var e = toPackedI4x64(1, scaleInvariant, 1, 1);
66423
- var c11 = toPackedF2x1024(1, 1);
66424
- var c01 = toPackedF2x1024(0, 1);
66425
- var c10 = toPackedF2x1024(1, 0);
66426
- var c00 = toPackedF2x1024(0, 0);
66486
+ var c11 = toPackedClippings(1, 1);
66487
+ var c01 = toPackedClippings(0, 1);
66488
+ var c10 = toPackedClippings(1, 0);
66489
+ var c00 = toPackedClippings(0, 0);
66427
66490
  var is = voffset * 6 - 1;
66428
66491
  steps[++is] = strokeWidth;
66429
66492
  steps[++is] = e;
@@ -66668,14 +66731,14 @@ var buildTriangleRoundedStep = function (steps, voffset, strokeWidth, strokeStyl
66668
66731
  var w = 1 - radius;
66669
66732
  var e0 = toPackedI4x64(0, scaleInvariant, 1, 1);
66670
66733
  var e1 = toPackedI4x64(1, scaleInvariant, 1, 1);
66671
- var c00 = toPackedF2x1024(0, 0);
66672
- var c10 = toPackedF2x1024(1, 0);
66673
- var c11 = toPackedF2x1024(1, 1);
66674
- var c01 = toPackedF2x1024(0, 1);
66675
- var cww = toPackedF2x1024(w, w);
66676
- var c1w = toPackedF2x1024(1, w);
66677
- var cw1 = toPackedF2x1024(w, 1);
66678
- var cw0 = toPackedF2x1024(w, 0);
66734
+ var c00 = toPackedClippings(0, 0);
66735
+ var c10 = toPackedClippings(1, 0);
66736
+ var c11 = toPackedClippings(1, 1);
66737
+ var c01 = toPackedClippings(0, 1);
66738
+ var cww = toPackedClippings(w, w);
66739
+ var c1w = toPackedClippings(1, w);
66740
+ var cw1 = toPackedClippings(w, 1);
66741
+ var cw0 = toPackedClippings(w, 0);
66679
66742
  // Top corner
66680
66743
  var is = voffset * 6 - 1;
66681
66744
  if (corner & EShapeCorner.TOP) {
@@ -67090,9 +67153,9 @@ var buildTriangleStep = function (steps, voffset, strokeWidth, strokeStyle, worl
67090
67153
  var scaleInvariant = toScaleInvariant(strokeStyle);
67091
67154
  var s = worldSize[0];
67092
67155
  var e = toPackedI4x64(0, scaleInvariant, 1, 1);
67093
- var c00 = toPackedF2x1024(0, 0);
67094
- var c10 = toPackedF2x1024(1, 0);
67095
- var c01 = toPackedF2x1024(0, 1);
67156
+ var c00 = toPackedClippings(0, 0);
67157
+ var c10 = toPackedClippings(1, 0);
67158
+ var c01 = toPackedClippings(0, 1);
67096
67159
  // 000
67097
67160
  var is = voffset * 6 - 1;
67098
67161
  steps[++is] = strokeWidth;
@@ -71199,7 +71262,7 @@ var UtilStraightSkeletonBufferBuilder = /** @class */ (function () {
71199
71262
  this._lengths.push(length);
71200
71263
  return result;
71201
71264
  };
71202
- UtilStraightSkeletonBufferBuilder.prototype.addWavefront = function (wavefront) {
71265
+ UtilStraightSkeletonBufferBuilder.prototype.addWavefront = function (wavefront, shift) {
71203
71266
  if (wavefront.parent != null) {
71204
71267
  return;
71205
71268
  }
@@ -71246,25 +71309,56 @@ var UtilStraightSkeletonBufferBuilder = /** @class */ (function () {
71246
71309
  for (var i = oldDistancesLength + 1; i < newDistancesLength; ++i) {
71247
71310
  mdistance = Math.max(mdistance, distances[i]);
71248
71311
  }
71312
+ var shifted = this.shift(wavefront, (shift - 1) * mdistance);
71249
71313
  var clippings = this._clippings;
71250
71314
  if (0 < mdistance) {
71251
71315
  var fdistance = 1 / mdistance;
71252
71316
  for (var i = oldDistancesLength; i < newDistancesLength; ++i) {
71253
- clippings.push(1 - distances[i] * fdistance);
71317
+ clippings.push(shifted.has(i) ? shift : 1 - distances[i] * fdistance);
71254
71318
  distances[i] = fdistance;
71255
71319
  }
71256
71320
  }
71257
71321
  else {
71258
71322
  for (var i = oldDistancesLength; i < newDistancesLength; ++i) {
71259
- clippings.push(1);
71323
+ clippings.push(shifted.has(i) ? shift : 1);
71260
71324
  distances[i] = mdistance;
71261
71325
  }
71262
71326
  }
71263
71327
  };
71264
- UtilStraightSkeletonBufferBuilder.prototype.addWavefrontAll = function (wavefronts) {
71328
+ UtilStraightSkeletonBufferBuilder.prototype.shift = function (wavefront, distance) {
71329
+ var result = new Set();
71330
+ var indexToLengthToIv = this._ivs.get(wavefront);
71331
+ if (indexToLengthToIv != null) {
71332
+ var normals_1 = wavefront.normals;
71333
+ var normalsLength_1 = normals_1.length;
71334
+ var vertices_1 = this._vertices;
71335
+ indexToLengthToIv.forEach(function (lengthToIv, index) {
71336
+ var pindex = (index - 2 + normalsLength_1) % normalsLength_1;
71337
+ var nx = normals_1[index];
71338
+ var ny = normals_1[index + 1];
71339
+ var mx = ny;
71340
+ var my = -nx;
71341
+ var pnx = normals_1[pindex];
71342
+ var pny = normals_1[pindex + 1];
71343
+ var dnm = mx * pnx + my * pny;
71344
+ var dnn = nx * pnx + ny * pny;
71345
+ var s = 0 < Math.abs(dnm) ? (1 - dnn) / dnm : 0 <= dnn ? -0.5 * dnm : 0;
71346
+ var dx = distance * (nx + s * mx);
71347
+ var dy = distance * (ny + s * my);
71348
+ lengthToIv.forEach(function (iv) {
71349
+ var iv2 = iv << 1;
71350
+ vertices_1[iv2] += dx;
71351
+ vertices_1[iv2 + 1] += dy;
71352
+ result.add(iv);
71353
+ });
71354
+ });
71355
+ }
71356
+ return result;
71357
+ };
71358
+ UtilStraightSkeletonBufferBuilder.prototype.addWavefrontAll = function (wavefronts, shift) {
71265
71359
  var wavefrontsLength = wavefronts.length;
71266
71360
  for (var i = 0; i < wavefrontsLength; ++i) {
71267
- this.addWavefront(wavefronts[i]);
71361
+ this.addWavefront(wavefronts[i], shift);
71268
71362
  }
71269
71363
  return this;
71270
71364
  };
@@ -71394,8 +71488,10 @@ var UtilStraightSkeletonBuffer = /** @class */ (function () {
71394
71488
  this.clippings = clippings;
71395
71489
  this.indices = indices;
71396
71490
  }
71397
- UtilStraightSkeletonBuffer.from = function (wavefronts) {
71398
- return new UtilStraightSkeletonBufferBuilder().addWavefrontAll(wavefronts).build();
71491
+ UtilStraightSkeletonBuffer.from = function (wavefronts, shift) {
71492
+ return new UtilStraightSkeletonBufferBuilder()
71493
+ .addWavefrontAll(wavefronts, Math.min(1.1, Math.max(1.0, shift !== null && shift !== void 0 ? shift : 1.1)))
71494
+ .build();
71399
71495
  };
71400
71496
  return UtilStraightSkeletonBuffer;
71401
71497
  }());
@@ -71591,7 +71687,8 @@ var EShapePolygonTriangulatedImpl = /** @class */ (function () {
71591
71687
  var isParentIdChanged = this._parentPointsId !== parentPointsId;
71592
71688
  if (isParentIdChanged) {
71593
71689
  this._parentPointsId = parentPointsId;
71594
- var buffer = UtilStraightSkeletonBuffer.from(UtilStraightSkeleton.from(parentPoints.formatted.values));
71690
+ var values = parentPoints.formatted.values;
71691
+ var buffer = UtilStraightSkeletonBuffer.from(UtilStraightSkeleton.from(values));
71595
71692
  this._id += 1;
71596
71693
  var vertices = buffer.vertices;
71597
71694
  this._vertices = vertices;
@@ -71600,7 +71697,7 @@ var EShapePolygonTriangulatedImpl = /** @class */ (function () {
71600
71697
  this._lengths = buffer.lengths;
71601
71698
  this._clippings = buffer.clippings;
71602
71699
  var boundary = this._boundary;
71603
- toPointsBoundary(vertices, boundary);
71700
+ toPointsBoundary(values, boundary);
71604
71701
  this._uvs = this.toUvs(vertices, boundary);
71605
71702
  this._indices = buffer.indices;
71606
71703
  this._nindices = buffer.indices.length / 3;