@wcardinal/wcardinal-ui 0.464.0-rc.3 → 0.465.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 (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 +61 -41
  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 +147 -88
  43. package/dist/wcardinal-ui.js +147 -88
  44. package/dist/wcardinal-ui.min.js +2 -2
  45. package/dist/wcardinal-ui.min.js.map +1 -1
  46. package/package.json +6 -4
@@ -1,5 +1,5 @@
1
1
  /*!
2
- Winter Cardinal UI v0.464.0-rc.3
2
+ Winter Cardinal UI v0.465.0
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-rc.3
2
+ Winter Cardinal UI v0.465.0
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-rc.3
2
+ Winter Cardinal UI v0.465.0
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-rc.3
2
+ Winter Cardinal UI v0.465.0
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;
@@ -32733,11 +32742,11 @@ var EShapeCircleTriangulatedImpl = /** @class */ (function () {
32733
32742
  var nny = nx * fy * s + ny * c;
32734
32743
  var sx = this.toSkeletonX(ppx, ppy, px, py, nx, ny);
32735
32744
  vertices[0] = 0;
32736
- vertices[1] = sizeY;
32737
- clippings[0] = 0;
32745
+ vertices[1] = scale * sizeY;
32746
+ clippings[0] = -1;
32738
32747
  lengths[0] = 0;
32739
32748
  uvs[0] = 0.5;
32740
- uvs[1] = 1;
32749
+ uvs[1] = 0.5 * (scale + 1);
32741
32750
  var iv = 1;
32742
32751
  var ii = 0;
32743
32752
  var length = 0;
@@ -32760,16 +32769,18 @@ var EShapeCircleTriangulatedImpl = /** @class */ (function () {
32760
32769
  var nlength = length + dl;
32761
32770
  var iv1 = iv++;
32762
32771
  var iv2 = iv1 << 1;
32763
- vertices[iv2 + 0] = nx;
32764
- vertices[iv2 + 1] = ny;
32765
- clippings[iv1] = 0;
32772
+ var snx = scale * nx;
32773
+ var sny = scale * ny;
32774
+ vertices[iv2 + 0] = snx;
32775
+ vertices[iv2 + 1] = sny;
32776
+ clippings[iv1] = -1;
32766
32777
  lengths[iv1] = nlength;
32767
- uvs[iv2 + 0] = 0.5 * (nx / sizeX + 1);
32768
- uvs[iv2 + 1] = 0.5 * (ny / sizeY + 1);
32778
+ uvs[iv2 + 0] = 0.5 * (snx / sizeX + 1);
32779
+ uvs[iv2 + 1] = 0.5 * (sny / sizeY + 1);
32769
32780
  var niv1 = iv++;
32770
32781
  var niv2 = niv1 << 1;
32771
32782
  var ndistance = Math.abs(-dx * py - dy * (nsx - px)) * fl;
32772
- vertices[niv2] = nsx;
32783
+ vertices[niv2 + 0] = nsx;
32773
32784
  vertices[niv2 + 1] = 0;
32774
32785
  clippings[niv1] = ndistance;
32775
32786
  maxDistance = Math.max(maxDistance, ndistance);
@@ -32810,7 +32821,13 @@ var EShapeCircleTriangulatedImpl = /** @class */ (function () {
32810
32821
  }
32811
32822
  for (var i = 0; i < iv; ++i) {
32812
32823
  distances[i] = fdistance;
32813
- clippings[i] = 1 - clippings[i] * fdistance;
32824
+ var clipping = clippings[i];
32825
+ if (0 <= clipping) {
32826
+ clippings[i] = 1 - clipping * fdistance;
32827
+ }
32828
+ else {
32829
+ clippings[i] = scale;
32830
+ }
32814
32831
  }
32815
32832
  // The skeleton points of adjacent vertices may coincide on a nearly circular ellipse.
32816
32833
  this.pad(iv, ii, nv, ni, fdistance);
@@ -32829,7 +32846,7 @@ var EShapeCircleTriangulatedImpl = /** @class */ (function () {
32829
32846
  /**
32830
32847
  * Precondition: sizeX !== 0 && sizeY !== 0 && abs(sizeX) < abs(sizeY)
32831
32848
  */
32832
- EShapeCircleTriangulatedImpl.prototype.update2 = function (sizeX, sizeY, n, nv, ni) {
32849
+ EShapeCircleTriangulatedImpl.prototype.update2 = function (sizeX, sizeY, scale, n, nv, ni) {
32833
32850
  var vertices = this._vertices;
32834
32851
  var distances = this._distances;
32835
32852
  var lengths = this._lengths;
@@ -32855,11 +32872,11 @@ var EShapeCircleTriangulatedImpl = /** @class */ (function () {
32855
32872
  var nny = s * nx * fy + c * ny;
32856
32873
  var sy = this.toSkeletonY(pppx, pppy, ppx, ppy, px, py);
32857
32874
  vertices[0] = 0;
32858
- vertices[1] = sizeY;
32859
- clippings[0] = 0;
32875
+ vertices[1] = scale * sizeY;
32876
+ clippings[0] = -1;
32860
32877
  lengths[0] = 0;
32861
32878
  uvs[0] = 0.5;
32862
- uvs[1] = 1;
32879
+ uvs[1] = 0.5 * (scale + 1);
32863
32880
  var iv = 1;
32864
32881
  var ii = 0;
32865
32882
  var length = 0;
@@ -32882,12 +32899,14 @@ var EShapeCircleTriangulatedImpl = /** @class */ (function () {
32882
32899
  var nlength = length + dl;
32883
32900
  var iv1 = iv++;
32884
32901
  var iv2 = iv1 << 1;
32885
- vertices[iv2 + 0] = nx;
32886
- vertices[iv2 + 1] = ny;
32887
- clippings[iv1] = 0;
32902
+ var snx = scale * nx;
32903
+ var sny = scale * ny;
32904
+ vertices[iv2 + 0] = snx;
32905
+ vertices[iv2 + 1] = sny;
32906
+ clippings[iv1] = -1;
32888
32907
  lengths[iv1] = nlength;
32889
- uvs[iv2 + 0] = 0.5 * (nx / sizeX + 1);
32890
- uvs[iv2 + 1] = 0.5 * (ny / sizeY + 1);
32908
+ uvs[iv2 + 0] = 0.5 * (snx / sizeX + 1);
32909
+ uvs[iv2 + 1] = 0.5 * (sny / sizeY + 1);
32891
32910
  var niv1 = iv++;
32892
32911
  var niv2 = niv1 << 1;
32893
32912
  var ndistance = Math.abs(dx * (nsy - py) + dy * px) * fl;
@@ -32932,7 +32951,13 @@ var EShapeCircleTriangulatedImpl = /** @class */ (function () {
32932
32951
  }
32933
32952
  for (var i = 0; i < iv; ++i) {
32934
32953
  distances[i] = fdistance;
32935
- clippings[i] = 1 - clippings[i] * fdistance;
32954
+ var clipping = clippings[i];
32955
+ if (0 <= clipping) {
32956
+ clippings[i] = 1 - clipping * fdistance;
32957
+ }
32958
+ else {
32959
+ clippings[i] = scale;
32960
+ }
32936
32961
  }
32937
32962
  // The skeleton points of adjacent vertices may coincide on a nearly circular ellipse.
32938
32963
  this.pad(iv, ii, nv, ni, fdistance);
@@ -63155,14 +63180,14 @@ var buildRectangleRoundedStep = function (steps, voffset, strokeWidth, strokeSid
63155
63180
  var erb1 = toPackedI4x64(1, scaleInvariant, wr, wb);
63156
63181
  var rxi = 1 - worldSize[3];
63157
63182
  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);
63183
+ var c11 = toPackedClippings(1, 1);
63184
+ var c01 = toPackedClippings(0, 1);
63185
+ var c10 = toPackedClippings(1, 0);
63186
+ var c00 = toPackedClippings(0, 0);
63187
+ var cx1 = toPackedClippings(rxi, 1);
63188
+ var c1y = toPackedClippings(1, ryi);
63189
+ var cxy = toPackedClippings(rxi, ryi);
63190
+ var c0y = toPackedClippings(0, ryi);
63166
63191
  // c0 c1 c4 c5
63167
63192
  // |---| |---|
63168
63193
  // | | | |
@@ -64669,7 +64694,7 @@ var buildPolygonStepX = function (steps, polygonDistances, polygonLengths, polyg
64669
64694
  steps[++is] = e;
64670
64695
  steps[++is] = polygonDistances[i];
64671
64696
  steps[++is] = afp * (fp - polygonUvs[j]);
64672
- steps[++is] = toPackedF2x1024(polygonClippings[i], 0);
64697
+ steps[++is] = toPackedClippings(polygonClippings[i], 0);
64673
64698
  steps[++is] = polygonLengths[i];
64674
64699
  }
64675
64700
  };
@@ -64680,7 +64705,7 @@ var buildPolygonStepY = function (steps, polygonDistances, polygonLengths, polyg
64680
64705
  steps[++is] = e;
64681
64706
  steps[++is] = polygonDistances[i];
64682
64707
  steps[++is] = afp * (fp - polygonUvs[j]);
64683
- steps[++is] = toPackedF2x1024(polygonClippings[i], 0);
64708
+ steps[++is] = toPackedClippings(polygonClippings[i], 0);
64684
64709
  steps[++is] = polygonLengths[i];
64685
64710
  }
64686
64711
  };
@@ -64967,10 +64992,10 @@ var buildCircleLegacyStep = function (steps, voffset, strokeWidth, strokeStyle,
64967
64992
  var ax = worldSize[0];
64968
64993
  var ay = worldSize[1];
64969
64994
  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);
64995
+ var c11 = toPackedClippings(1, 1);
64996
+ var c01 = toPackedClippings(0, 1);
64997
+ var c10 = toPackedClippings(1, 0);
64998
+ var c00 = toPackedClippings(0, 0);
64974
64999
  var is = voffset * 6 - 1;
64975
65000
  steps[++is] = strokeWidth;
64976
65001
  steps[++is] = e;
@@ -66159,10 +66184,10 @@ var buildRectangleStep = function (voffset, steps, strokeWidth, strokeSide, stro
66159
66184
  var ert = toPackedI4x64(0, scaleInvariant, wr, wt);
66160
66185
  var elb = toPackedI4x64(0, scaleInvariant, wl, wb);
66161
66186
  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);
66187
+ var c11 = toPackedClippings(1, 1);
66188
+ var c01 = toPackedClippings(0, 1);
66189
+ var c00 = toPackedClippings(0, 0);
66190
+ var c10 = toPackedClippings(1, 0);
66166
66191
  // c0 c1 c4 c5
66167
66192
  // |-----| |-----|
66168
66193
  // | | | |
@@ -66420,10 +66445,10 @@ var buildSemicircleStep = function (steps, voffset, strokeWidth, strokeStyle, wo
66420
66445
  var ws0 = worldSize[0];
66421
66446
  var ws1 = worldSize[1];
66422
66447
  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);
66448
+ var c11 = toPackedClippings(1, 1);
66449
+ var c01 = toPackedClippings(0, 1);
66450
+ var c10 = toPackedClippings(1, 0);
66451
+ var c00 = toPackedClippings(0, 0);
66427
66452
  var is = voffset * 6 - 1;
66428
66453
  steps[++is] = strokeWidth;
66429
66454
  steps[++is] = e;
@@ -66668,14 +66693,14 @@ var buildTriangleRoundedStep = function (steps, voffset, strokeWidth, strokeStyl
66668
66693
  var w = 1 - radius;
66669
66694
  var e0 = toPackedI4x64(0, scaleInvariant, 1, 1);
66670
66695
  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);
66696
+ var c00 = toPackedClippings(0, 0);
66697
+ var c10 = toPackedClippings(1, 0);
66698
+ var c11 = toPackedClippings(1, 1);
66699
+ var c01 = toPackedClippings(0, 1);
66700
+ var cww = toPackedClippings(w, w);
66701
+ var c1w = toPackedClippings(1, w);
66702
+ var cw1 = toPackedClippings(w, 1);
66703
+ var cw0 = toPackedClippings(w, 0);
66679
66704
  // Top corner
66680
66705
  var is = voffset * 6 - 1;
66681
66706
  if (corner & EShapeCorner.TOP) {
@@ -67090,9 +67115,9 @@ var buildTriangleStep = function (steps, voffset, strokeWidth, strokeStyle, worl
67090
67115
  var scaleInvariant = toScaleInvariant(strokeStyle);
67091
67116
  var s = worldSize[0];
67092
67117
  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);
67118
+ var c00 = toPackedClippings(0, 0);
67119
+ var c10 = toPackedClippings(1, 0);
67120
+ var c01 = toPackedClippings(0, 1);
67096
67121
  // 000
67097
67122
  var is = voffset * 6 - 1;
67098
67123
  steps[++is] = strokeWidth;
@@ -71199,7 +71224,7 @@ var UtilStraightSkeletonBufferBuilder = /** @class */ (function () {
71199
71224
  this._lengths.push(length);
71200
71225
  return result;
71201
71226
  };
71202
- UtilStraightSkeletonBufferBuilder.prototype.addWavefront = function (wavefront) {
71227
+ UtilStraightSkeletonBufferBuilder.prototype.addWavefront = function (wavefront, shift) {
71203
71228
  if (wavefront.parent != null) {
71204
71229
  return;
71205
71230
  }
@@ -71246,25 +71271,56 @@ var UtilStraightSkeletonBufferBuilder = /** @class */ (function () {
71246
71271
  for (var i = oldDistancesLength + 1; i < newDistancesLength; ++i) {
71247
71272
  mdistance = Math.max(mdistance, distances[i]);
71248
71273
  }
71274
+ var shifted = this.shift(wavefront, (shift - 1) * mdistance);
71249
71275
  var clippings = this._clippings;
71250
71276
  if (0 < mdistance) {
71251
71277
  var fdistance = 1 / mdistance;
71252
71278
  for (var i = oldDistancesLength; i < newDistancesLength; ++i) {
71253
- clippings.push(1 - distances[i] * fdistance);
71279
+ clippings.push(shifted.has(i) ? shift : 1 - distances[i] * fdistance);
71254
71280
  distances[i] = fdistance;
71255
71281
  }
71256
71282
  }
71257
71283
  else {
71258
71284
  for (var i = oldDistancesLength; i < newDistancesLength; ++i) {
71259
- clippings.push(1);
71285
+ clippings.push(shifted.has(i) ? shift : 1);
71260
71286
  distances[i] = mdistance;
71261
71287
  }
71262
71288
  }
71263
71289
  };
71264
- UtilStraightSkeletonBufferBuilder.prototype.addWavefrontAll = function (wavefronts) {
71290
+ UtilStraightSkeletonBufferBuilder.prototype.shift = function (wavefront, distance) {
71291
+ var result = new Set();
71292
+ var indexToLengthToIv = this._ivs.get(wavefront);
71293
+ if (indexToLengthToIv != null) {
71294
+ var normals_1 = wavefront.normals;
71295
+ var normalsLength_1 = normals_1.length;
71296
+ var vertices_1 = this._vertices;
71297
+ indexToLengthToIv.forEach(function (lengthToIv, index) {
71298
+ var pindex = (index - 2 + normalsLength_1) % normalsLength_1;
71299
+ var nx = normals_1[index];
71300
+ var ny = normals_1[index + 1];
71301
+ var mx = ny;
71302
+ var my = -nx;
71303
+ var pnx = normals_1[pindex];
71304
+ var pny = normals_1[pindex + 1];
71305
+ var dnm = mx * pnx + my * pny;
71306
+ var dnn = nx * pnx + ny * pny;
71307
+ var s = 0 < Math.abs(dnm) ? (1 - dnn) / dnm : 0 <= dnn ? -0.5 * dnm : 0;
71308
+ var dx = distance * (nx + s * mx);
71309
+ var dy = distance * (ny + s * my);
71310
+ lengthToIv.forEach(function (iv) {
71311
+ var iv2 = iv << 1;
71312
+ vertices_1[iv2] += dx;
71313
+ vertices_1[iv2 + 1] += dy;
71314
+ result.add(iv);
71315
+ });
71316
+ });
71317
+ }
71318
+ return result;
71319
+ };
71320
+ UtilStraightSkeletonBufferBuilder.prototype.addWavefrontAll = function (wavefronts, shift) {
71265
71321
  var wavefrontsLength = wavefronts.length;
71266
71322
  for (var i = 0; i < wavefrontsLength; ++i) {
71267
- this.addWavefront(wavefronts[i]);
71323
+ this.addWavefront(wavefronts[i], shift);
71268
71324
  }
71269
71325
  return this;
71270
71326
  };
@@ -71394,8 +71450,10 @@ var UtilStraightSkeletonBuffer = /** @class */ (function () {
71394
71450
  this.clippings = clippings;
71395
71451
  this.indices = indices;
71396
71452
  }
71397
- UtilStraightSkeletonBuffer.from = function (wavefronts) {
71398
- return new UtilStraightSkeletonBufferBuilder().addWavefrontAll(wavefronts).build();
71453
+ UtilStraightSkeletonBuffer.from = function (wavefronts, shift) {
71454
+ return new UtilStraightSkeletonBufferBuilder()
71455
+ .addWavefrontAll(wavefronts, Math.min(1.1, Math.max(1.0, shift !== null && shift !== void 0 ? shift : 1.1)))
71456
+ .build();
71399
71457
  };
71400
71458
  return UtilStraightSkeletonBuffer;
71401
71459
  }());
@@ -71591,7 +71649,8 @@ var EShapePolygonTriangulatedImpl = /** @class */ (function () {
71591
71649
  var isParentIdChanged = this._parentPointsId !== parentPointsId;
71592
71650
  if (isParentIdChanged) {
71593
71651
  this._parentPointsId = parentPointsId;
71594
- var buffer = UtilStraightSkeletonBuffer.from(UtilStraightSkeleton.from(parentPoints.formatted.values));
71652
+ var values = parentPoints.formatted.values;
71653
+ var buffer = UtilStraightSkeletonBuffer.from(UtilStraightSkeleton.from(values));
71595
71654
  this._id += 1;
71596
71655
  var vertices = buffer.vertices;
71597
71656
  this._vertices = vertices;
@@ -71600,7 +71659,7 @@ var EShapePolygonTriangulatedImpl = /** @class */ (function () {
71600
71659
  this._lengths = buffer.lengths;
71601
71660
  this._clippings = buffer.clippings;
71602
71661
  var boundary = this._boundary;
71603
- toPointsBoundary(vertices, boundary);
71662
+ toPointsBoundary(values, boundary);
71604
71663
  this._uvs = this.toUvs(vertices, boundary);
71605
71664
  this._indices = buffer.indices;
71606
71665
  this._nindices = buffer.indices.length / 3;