@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
 
@@ -250,8 +250,13 @@
250
250
  var toPackedI4x64 = function (i0, i1, i2, i3) {
251
251
  return i0 + (i1 << 6) + (i2 << 12) + (i3 << 18);
252
252
  };
253
- var toPackedF2x1024 = function (f0, f1) {
254
- return Math.round(1023 * f0) + (Math.round(1023 * f1) << 10);
253
+ var toPackedAlphas = function (a0, a1) {
254
+ return Math.round(1023 * a0) + (Math.round(1023 * a1) << 10);
255
+ };
256
+ var toPackedClippings = function (x, y) {
257
+ // Since 1023 / 1.1 = 930,
258
+ // Math.round(1023 * (x / 1.1)) = Math.round(930 * x)
259
+ return Math.round(930 * x) + (Math.round(930 * y) << 10);
255
260
  };
256
261
 
257
262
  var BAR_VERTEX_COUNT = 4;
@@ -1435,7 +1440,7 @@
1435
1440
  };
1436
1441
 
1437
1442
  var buildColor = function (fillColor, fillAlpha, strokeColor, strokeAlpha, voffset, vcount, colors) {
1438
- var alpha = toPackedF2x1024(Math.max(0, Math.min(1, fillAlpha)), Math.max(0, Math.min(1, strokeAlpha)));
1443
+ var alpha = toPackedAlphas(Math.max(0, Math.min(1, fillAlpha)), Math.max(0, Math.min(1, strokeAlpha)));
1439
1444
  var ic = voffset * 3 - 1;
1440
1445
  var icmax = (voffset + vcount) * 3 - 1;
1441
1446
  for (; ic < icmax;) {
@@ -16697,7 +16702,7 @@
16697
16702
  * Copyright (C) 2019 Toshiba Corporation
16698
16703
  * SPDX-License-Identifier: Apache-2.0
16699
16704
  */
16700
- 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}";
16705
+ 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}";
16701
16706
  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}";
16702
16707
  var EShapeRenderer = /** @class */ (function (_super) {
16703
16708
  __extends(EShapeRenderer, _super);
@@ -40489,14 +40494,14 @@
40489
40494
  var erb1 = toPackedI4x64(1, scaleInvariant, wr, wb);
40490
40495
  var rxi = 1 - worldSize[3];
40491
40496
  var ryi = 1 - worldSize[4];
40492
- var c11 = toPackedF2x1024(1, 1);
40493
- var c01 = toPackedF2x1024(0, 1);
40494
- var c10 = toPackedF2x1024(1, 0);
40495
- var c00 = toPackedF2x1024(0, 0);
40496
- var cx1 = toPackedF2x1024(rxi, 1);
40497
- var c1y = toPackedF2x1024(1, ryi);
40498
- var cxy = toPackedF2x1024(rxi, ryi);
40499
- var c0y = toPackedF2x1024(0, ryi);
40497
+ var c11 = toPackedClippings(1, 1);
40498
+ var c01 = toPackedClippings(0, 1);
40499
+ var c10 = toPackedClippings(1, 0);
40500
+ var c00 = toPackedClippings(0, 0);
40501
+ var cx1 = toPackedClippings(rxi, 1);
40502
+ var c1y = toPackedClippings(1, ryi);
40503
+ var cxy = toPackedClippings(rxi, ryi);
40504
+ var c0y = toPackedClippings(0, ryi);
40500
40505
  // c0 c1 c4 c5
40501
40506
  // |---| |---|
40502
40507
  // | | | |
@@ -42003,7 +42008,7 @@
42003
42008
  steps[++is] = e;
42004
42009
  steps[++is] = polygonDistances[i];
42005
42010
  steps[++is] = afp * (fp - polygonUvs[j]);
42006
- steps[++is] = toPackedF2x1024(polygonClippings[i], 0);
42011
+ steps[++is] = toPackedClippings(polygonClippings[i], 0);
42007
42012
  steps[++is] = polygonLengths[i];
42008
42013
  }
42009
42014
  };
@@ -42014,7 +42019,7 @@
42014
42019
  steps[++is] = e;
42015
42020
  steps[++is] = polygonDistances[i];
42016
42021
  steps[++is] = afp * (fp - polygonUvs[j]);
42017
- steps[++is] = toPackedF2x1024(polygonClippings[i], 0);
42022
+ steps[++is] = toPackedClippings(polygonClippings[i], 0);
42018
42023
  steps[++is] = polygonLengths[i];
42019
42024
  }
42020
42025
  };
@@ -42327,10 +42332,10 @@
42327
42332
  if (isNotInitialized || isSizeChanged) {
42328
42333
  this._sizeX = sizeX;
42329
42334
  this._sizeY = sizeY;
42330
- this.update(sizeX, sizeY, this._n);
42335
+ this.update(sizeX, sizeY, 1.1, this._n);
42331
42336
  }
42332
42337
  };
42333
- EShapeCircleTriangulatedImpl.prototype.update = function (sizeX, sizeY, n) {
42338
+ EShapeCircleTriangulatedImpl.prototype.update = function (sizeX, sizeY, scale, n) {
42334
42339
  // Boundary
42335
42340
  var ax = Math.abs(sizeX);
42336
42341
  var ay = Math.abs(sizeY);
@@ -42351,13 +42356,13 @@
42351
42356
  this.pad(0, 0, nv, ni, 0);
42352
42357
  }
42353
42358
  else if (ax === ay) {
42354
- this.update0(sizeX, sizeY, n, nv, ni);
42359
+ this.update0(sizeX, sizeY, scale, n, nv, ni);
42355
42360
  }
42356
42361
  else if (ay < ax) {
42357
- this.update1(sizeX, sizeY, n, nv, ni);
42362
+ this.update1(sizeX, sizeY, scale, n, nv, ni);
42358
42363
  }
42359
42364
  else {
42360
- this.update2(sizeX, sizeY, n, nv, ni);
42365
+ this.update2(sizeX, sizeY, scale, n, nv, ni);
42361
42366
  }
42362
42367
  };
42363
42368
  /**
@@ -42395,7 +42400,7 @@
42395
42400
  /**
42396
42401
  * Precondition: sizeX !== 0 && sizeY !== 0 & abs(sizeX) === abs(sizeY)
42397
42402
  */
42398
- EShapeCircleTriangulatedImpl.prototype.update0 = function (sizeX, sizeY, n, nv, ni) {
42403
+ EShapeCircleTriangulatedImpl.prototype.update0 = function (sizeX, sizeY, scale, n, nv, ni) {
42399
42404
  var vertices = this._vertices;
42400
42405
  var distances = this._distances;
42401
42406
  var lengths = this._lengths;
@@ -42410,6 +42415,8 @@
42410
42415
  var y0 = sizeY;
42411
42416
  var u = -s;
42412
42417
  var v = c;
42418
+ var su = scale * u;
42419
+ var sv = scale * v;
42413
42420
  var x1 = u * sizeX;
42414
42421
  var y1 = v * sizeY;
42415
42422
  var dx = 0.5 * (x1 + x0) - 0;
@@ -42420,25 +42427,25 @@
42420
42427
  var dl = Math.sqrt(lx * lx + ly * ly);
42421
42428
  var l1 = dl;
42422
42429
  var l2 = 0.5 * dl;
42423
- vertices[0] = x0;
42424
- vertices[1] = y0;
42425
- vertices[2] = x1;
42426
- vertices[3] = y1;
42430
+ vertices[0] = 0;
42431
+ vertices[1] = scale * sizeY;
42432
+ vertices[2] = su * sizeX;
42433
+ vertices[3] = sv * sizeY;
42427
42434
  vertices[4] = 0;
42428
42435
  vertices[5] = 0;
42429
42436
  distances[0] = fdistance;
42430
42437
  distances[1] = fdistance;
42431
42438
  distances[2] = fdistance;
42432
- clippings[0] = 1;
42433
- clippings[1] = 1;
42439
+ clippings[0] = scale;
42440
+ clippings[1] = scale;
42434
42441
  clippings[2] = 0;
42435
42442
  lengths[0] = 0;
42436
42443
  lengths[1] = l1;
42437
42444
  lengths[2] = l2;
42438
42445
  uvs[0] = 0.5;
42439
- uvs[1] = 1.0;
42440
- uvs[2] = 0.5 * (u + 1);
42441
- uvs[3] = 0.5 * (v + 1);
42446
+ uvs[1] = 0.5 * (scale + 1);
42447
+ uvs[2] = 0.5 * (su + 1);
42448
+ uvs[3] = 0.5 * (sv + 1);
42442
42449
  uvs[4] = 0.5;
42443
42450
  uvs[5] = 0.5;
42444
42451
  indices[0] = 0;
@@ -42453,20 +42460,22 @@
42453
42460
  var vn = s * u + c * v;
42454
42461
  u = un;
42455
42462
  v = vn;
42463
+ su = scale * u;
42464
+ sv = scale * v;
42456
42465
  l1 += dl;
42457
42466
  l2 += dl;
42458
- vertices[iv2 + 0] = sizeX * u;
42459
- vertices[iv2 + 1] = sizeY * v;
42467
+ vertices[iv2 + 0] = su * sizeX;
42468
+ vertices[iv2 + 1] = sv * sizeY;
42460
42469
  vertices[iv2 + 2] = 0;
42461
42470
  vertices[iv2 + 3] = 0;
42462
42471
  distances[iv1 + 0] = fdistance;
42463
42472
  distances[iv1 + 1] = fdistance;
42464
- clippings[iv1 + 0] = 1;
42473
+ clippings[iv1 + 0] = scale;
42465
42474
  clippings[iv1 + 1] = 0;
42466
42475
  lengths[iv1 + 0] = l1;
42467
42476
  lengths[iv1 + 1] = l2;
42468
- uvs[iv2 + 0] = 0.5 * (u + 1);
42469
- uvs[iv2 + 1] = 0.5 * (v + 1);
42477
+ uvs[iv2 + 0] = 0.5 * (su + 1);
42478
+ uvs[iv2 + 1] = 0.5 * (sv + 1);
42470
42479
  uvs[iv2 + 2] = 0.5;
42471
42480
  uvs[iv2 + 3] = 0.5;
42472
42481
  indices[ii + 0] = iv1 - 2;
@@ -42482,7 +42491,7 @@
42482
42491
  /**
42483
42492
  * Precondition: sizeX !== 0 && sizeY !== 0 && abs(sizeY) < abs(sizeX)
42484
42493
  */
42485
- EShapeCircleTriangulatedImpl.prototype.update1 = function (sizeX, sizeY, n, nv, ni) {
42494
+ EShapeCircleTriangulatedImpl.prototype.update1 = function (sizeX, sizeY, scale, n, nv, ni) {
42486
42495
  var vertices = this._vertices;
42487
42496
  var distances = this._distances;
42488
42497
  var lengths = this._lengths;
@@ -42507,7 +42516,8 @@
42507
42516
  var sx = this.toSkeletonX(ppx, ppy, px, py, nx, ny);
42508
42517
  vertices[0] = 0;
42509
42518
  vertices[1] = sizeY;
42510
- clippings[0] = 0;
42519
+ clippings[0] = -1;
42520
+ distances[0] = sx;
42511
42521
  lengths[0] = 0;
42512
42522
  uvs[0] = 0.5;
42513
42523
  uvs[1] = 1;
@@ -42533,33 +42543,41 @@
42533
42543
  var nlength = length + dl;
42534
42544
  var iv1 = iv++;
42535
42545
  var iv2 = iv1 << 1;
42546
+ var niv1 = iv++;
42547
+ var niv2 = niv1 << 1;
42548
+ var ndistance = Math.abs(-dx * py - dy * (nsx - px)) * fl;
42549
+ maxDistance = Math.max(maxDistance, ndistance);
42536
42550
  vertices[iv2 + 0] = nx;
42537
42551
  vertices[iv2 + 1] = ny;
42538
- clippings[iv1] = 0;
42552
+ clippings[iv1] = -1 - ndistance;
42553
+ distances[iv1] = nsx;
42539
42554
  lengths[iv1] = nlength;
42540
42555
  uvs[iv2 + 0] = 0.5 * (nx / sizeX + 1);
42541
42556
  uvs[iv2 + 1] = 0.5 * (ny / sizeY + 1);
42542
- var niv1 = iv++;
42543
- var niv2 = niv1 << 1;
42544
- var ndistance = Math.abs(-dx * py - dy * (nsx - px)) * fl;
42545
- vertices[niv2] = nsx;
42557
+ vertices[niv2 + 0] = nsx;
42546
42558
  vertices[niv2 + 1] = 0;
42547
42559
  clippings[niv1] = ndistance;
42548
- maxDistance = Math.max(maxDistance, ndistance);
42560
+ distances[niv1] = 0;
42549
42561
  lengths[niv1] = length + ((nsx - px) * dx - py * dy) * fl;
42550
42562
  uvs[niv2] = 0.5 * (nsx / sizeX + 1);
42551
42563
  uvs[niv2 + 1] = 0.5;
42552
42564
  indices[ii++] = current;
42553
42565
  indices[ii++] = iv1;
42554
42566
  indices[ii++] = niv1;
42555
- if (sx !== nsx) {
42567
+ distances[current] = sx;
42568
+ if (sx === nsx) {
42569
+ clippings[current] = -1 - ndistance;
42570
+ }
42571
+ else {
42572
+ var mdistance = Math.abs(-dx * py - dy * (sx - px)) * fl;
42573
+ maxDistance = Math.max(maxDistance, mdistance);
42574
+ clippings[current] = -1 - mdistance;
42556
42575
  var miv1 = iv++;
42557
42576
  var miv2 = miv1 << 1;
42558
- var mdistance = Math.abs(-dx * py - dy * (sx - px)) * fl;
42559
42577
  vertices[miv2] = sx;
42560
42578
  vertices[miv2 + 1] = 0;
42561
42579
  clippings[miv1] = mdistance;
42562
- maxDistance = Math.max(maxDistance, mdistance);
42580
+ distances[miv1] = 0;
42563
42581
  lengths[miv1] = length + ((sx - px) * dx - py * dy) * fl;
42564
42582
  uvs[miv2] = 0.5 * (sx / sizeX + 1);
42565
42583
  uvs[miv2 + 1] = 0.5;
@@ -42581,9 +42599,27 @@
42581
42599
  if (0 < maxDistance) {
42582
42600
  fdistance = 1 / maxDistance;
42583
42601
  }
42602
+ var shift = (scale - 1) * maxDistance;
42584
42603
  for (var i = 0; i < iv; ++i) {
42604
+ var clipping = clippings[i];
42605
+ if (0 <= clipping) {
42606
+ clippings[i] = 1 - clipping * fdistance;
42607
+ }
42608
+ else {
42609
+ var distance = -1 - clipping;
42610
+ if (0 < distance) {
42611
+ var i2 = i << 1;
42612
+ var factor = shift / distance;
42613
+ var x = vertices[i2] + (vertices[i2] - distances[i]) * factor;
42614
+ var y = vertices[i2 + 1] * (1 + factor);
42615
+ vertices[i2] = x;
42616
+ vertices[i2 + 1] = y;
42617
+ uvs[i2] = 0.5 * (x / sizeX + 1);
42618
+ uvs[i2 + 1] = 0.5 * (y / sizeY + 1);
42619
+ }
42620
+ clippings[i] = scale;
42621
+ }
42585
42622
  distances[i] = fdistance;
42586
- clippings[i] = 1 - clippings[i] * fdistance;
42587
42623
  }
42588
42624
  // The skeleton points of adjacent vertices may coincide on a nearly circular ellipse.
42589
42625
  this.pad(iv, ii, nv, ni, fdistance);
@@ -42602,7 +42638,7 @@
42602
42638
  /**
42603
42639
  * Precondition: sizeX !== 0 && sizeY !== 0 && abs(sizeX) < abs(sizeY)
42604
42640
  */
42605
- EShapeCircleTriangulatedImpl.prototype.update2 = function (sizeX, sizeY, n, nv, ni) {
42641
+ EShapeCircleTriangulatedImpl.prototype.update2 = function (sizeX, sizeY, scale, n, nv, ni) {
42606
42642
  var vertices = this._vertices;
42607
42643
  var distances = this._distances;
42608
42644
  var lengths = this._lengths;
@@ -42629,7 +42665,8 @@
42629
42665
  var sy = this.toSkeletonY(pppx, pppy, ppx, ppy, px, py);
42630
42666
  vertices[0] = 0;
42631
42667
  vertices[1] = sizeY;
42632
- clippings[0] = 0;
42668
+ clippings[0] = -1;
42669
+ distances[0] = sy;
42633
42670
  lengths[0] = 0;
42634
42671
  uvs[0] = 0.5;
42635
42672
  uvs[1] = 1;
@@ -42655,33 +42692,41 @@
42655
42692
  var nlength = length + dl;
42656
42693
  var iv1 = iv++;
42657
42694
  var iv2 = iv1 << 1;
42695
+ var niv1 = iv++;
42696
+ var niv2 = niv1 << 1;
42697
+ var ndistance = Math.abs(dx * (nsy - py) + dy * px) * fl;
42698
+ maxDistance = Math.max(maxDistance, ndistance);
42658
42699
  vertices[iv2 + 0] = nx;
42659
42700
  vertices[iv2 + 1] = ny;
42660
- clippings[iv1] = 0;
42701
+ clippings[iv1] = -1 - ndistance;
42702
+ distances[iv1] = nsy;
42661
42703
  lengths[iv1] = nlength;
42662
42704
  uvs[iv2 + 0] = 0.5 * (nx / sizeX + 1);
42663
42705
  uvs[iv2 + 1] = 0.5 * (ny / sizeY + 1);
42664
- var niv1 = iv++;
42665
- var niv2 = niv1 << 1;
42666
- var ndistance = Math.abs(dx * (nsy - py) + dy * px) * fl;
42667
42706
  vertices[niv2] = 0;
42668
42707
  vertices[niv2 + 1] = nsy;
42669
42708
  clippings[niv1] = ndistance;
42670
- maxDistance = Math.max(maxDistance, ndistance);
42709
+ distances[niv1] = 0;
42671
42710
  lengths[niv1] = length + (-px * dx + (nsy - py) * dy) * fl;
42672
42711
  uvs[niv2] = 0.5;
42673
42712
  uvs[niv2 + 1] = 0.5 * (nsy / sizeY + 1);
42674
42713
  indices[ii++] = current;
42675
42714
  indices[ii++] = iv1;
42676
42715
  indices[ii++] = niv1;
42677
- if (sy !== nsy) {
42716
+ distances[current] = sy;
42717
+ if (sy === nsy) {
42718
+ clippings[current] = -1 - ndistance;
42719
+ }
42720
+ else {
42721
+ var mdistance = Math.abs(dx * (sy - py) + dy * px) * fl;
42722
+ maxDistance = Math.max(maxDistance, mdistance);
42723
+ clippings[current] = -1 - mdistance;
42678
42724
  var miv1 = iv++;
42679
42725
  var miv2 = miv1 << 1;
42680
- var mdistance = Math.abs(dx * (sy - py) + dy * px) * fl;
42681
42726
  vertices[miv2] = 0;
42682
42727
  vertices[miv2 + 1] = sy;
42683
42728
  clippings[miv1] = mdistance;
42684
- maxDistance = Math.max(maxDistance, mdistance);
42729
+ distances[miv1] = 0;
42685
42730
  lengths[miv1] = length + (-px * dx + (sy - py) * dy) * fl;
42686
42731
  uvs[miv2] = 0.5;
42687
42732
  uvs[miv2 + 1] = 0.5 * (sy / sizeY + 1);
@@ -42703,9 +42748,27 @@
42703
42748
  if (0 < maxDistance) {
42704
42749
  fdistance = 1 / maxDistance;
42705
42750
  }
42751
+ var shift = (scale - 1) * maxDistance;
42706
42752
  for (var i = 0; i < iv; ++i) {
42753
+ var clipping = clippings[i];
42754
+ if (0 <= clipping) {
42755
+ clippings[i] = 1 - clipping * fdistance;
42756
+ }
42757
+ else {
42758
+ var distance = -1 - clipping;
42759
+ if (0 < distance) {
42760
+ var i2 = i << 1;
42761
+ var factor = shift / distance;
42762
+ var x = vertices[i2] * (1 + factor);
42763
+ var y = vertices[i2 + 1] + (vertices[i2 + 1] - distances[i]) * factor;
42764
+ vertices[i2] = x;
42765
+ vertices[i2 + 1] = y;
42766
+ uvs[i2] = 0.5 * (x / sizeX + 1);
42767
+ uvs[i2 + 1] = 0.5 * (y / sizeY + 1);
42768
+ }
42769
+ clippings[i] = scale;
42770
+ }
42707
42771
  distances[i] = fdistance;
42708
- clippings[i] = 1 - clippings[i] * fdistance;
42709
42772
  }
42710
42773
  // The skeleton points of adjacent vertices may coincide on a nearly circular ellipse.
42711
42774
  this.pad(iv, ii, nv, ni, fdistance);
@@ -42864,10 +42927,10 @@
42864
42927
  var ax = worldSize[0];
42865
42928
  var ay = worldSize[1];
42866
42929
  var e = toPackedI4x64(1, scaleInvariant, 1, 1);
42867
- var c11 = toPackedF2x1024(1, 1);
42868
- var c01 = toPackedF2x1024(0, 1);
42869
- var c10 = toPackedF2x1024(1, 0);
42870
- var c00 = toPackedF2x1024(0, 0);
42930
+ var c11 = toPackedClippings(1, 1);
42931
+ var c01 = toPackedClippings(0, 1);
42932
+ var c10 = toPackedClippings(1, 0);
42933
+ var c00 = toPackedClippings(0, 0);
42871
42934
  var is = voffset * 6 - 1;
42872
42935
  steps[++is] = strokeWidth;
42873
42936
  steps[++is] = e;
@@ -44056,10 +44119,10 @@
44056
44119
  var ert = toPackedI4x64(0, scaleInvariant, wr, wt);
44057
44120
  var elb = toPackedI4x64(0, scaleInvariant, wl, wb);
44058
44121
  var erb = toPackedI4x64(0, scaleInvariant, wr, wb);
44059
- var c11 = toPackedF2x1024(1, 1);
44060
- var c01 = toPackedF2x1024(0, 1);
44061
- var c00 = toPackedF2x1024(0, 0);
44062
- var c10 = toPackedF2x1024(1, 0);
44122
+ var c11 = toPackedClippings(1, 1);
44123
+ var c01 = toPackedClippings(0, 1);
44124
+ var c00 = toPackedClippings(0, 0);
44125
+ var c10 = toPackedClippings(1, 0);
44063
44126
  // c0 c1 c4 c5
44064
44127
  // |-----| |-----|
44065
44128
  // | | | |
@@ -44317,10 +44380,10 @@
44317
44380
  var ws0 = worldSize[0];
44318
44381
  var ws1 = worldSize[1];
44319
44382
  var e = toPackedI4x64(1, scaleInvariant, 1, 1);
44320
- var c11 = toPackedF2x1024(1, 1);
44321
- var c01 = toPackedF2x1024(0, 1);
44322
- var c10 = toPackedF2x1024(1, 0);
44323
- var c00 = toPackedF2x1024(0, 0);
44383
+ var c11 = toPackedClippings(1, 1);
44384
+ var c01 = toPackedClippings(0, 1);
44385
+ var c10 = toPackedClippings(1, 0);
44386
+ var c00 = toPackedClippings(0, 0);
44324
44387
  var is = voffset * 6 - 1;
44325
44388
  steps[++is] = strokeWidth;
44326
44389
  steps[++is] = e;
@@ -44565,14 +44628,14 @@
44565
44628
  var w = 1 - radius;
44566
44629
  var e0 = toPackedI4x64(0, scaleInvariant, 1, 1);
44567
44630
  var e1 = toPackedI4x64(1, scaleInvariant, 1, 1);
44568
- var c00 = toPackedF2x1024(0, 0);
44569
- var c10 = toPackedF2x1024(1, 0);
44570
- var c11 = toPackedF2x1024(1, 1);
44571
- var c01 = toPackedF2x1024(0, 1);
44572
- var cww = toPackedF2x1024(w, w);
44573
- var c1w = toPackedF2x1024(1, w);
44574
- var cw1 = toPackedF2x1024(w, 1);
44575
- var cw0 = toPackedF2x1024(w, 0);
44631
+ var c00 = toPackedClippings(0, 0);
44632
+ var c10 = toPackedClippings(1, 0);
44633
+ var c11 = toPackedClippings(1, 1);
44634
+ var c01 = toPackedClippings(0, 1);
44635
+ var cww = toPackedClippings(w, w);
44636
+ var c1w = toPackedClippings(1, w);
44637
+ var cw1 = toPackedClippings(w, 1);
44638
+ var cw0 = toPackedClippings(w, 0);
44576
44639
  // Top corner
44577
44640
  var is = voffset * 6 - 1;
44578
44641
  if (corner & EShapeCorner.TOP) {
@@ -44987,9 +45050,9 @@
44987
45050
  var scaleInvariant = toScaleInvariant(strokeStyle);
44988
45051
  var s = worldSize[0];
44989
45052
  var e = toPackedI4x64(0, scaleInvariant, 1, 1);
44990
- var c00 = toPackedF2x1024(0, 0);
44991
- var c10 = toPackedF2x1024(1, 0);
44992
- var c01 = toPackedF2x1024(0, 1);
45053
+ var c00 = toPackedClippings(0, 0);
45054
+ var c10 = toPackedClippings(1, 0);
45055
+ var c01 = toPackedClippings(0, 1);
44993
45056
  // 000
44994
45057
  var is = voffset * 6 - 1;
44995
45058
  steps[++is] = strokeWidth;
@@ -49096,7 +49159,7 @@
49096
49159
  this._lengths.push(length);
49097
49160
  return result;
49098
49161
  };
49099
- UtilStraightSkeletonBufferBuilder.prototype.addWavefront = function (wavefront) {
49162
+ UtilStraightSkeletonBufferBuilder.prototype.addWavefront = function (wavefront, shift) {
49100
49163
  if (wavefront.parent != null) {
49101
49164
  return;
49102
49165
  }
@@ -49143,25 +49206,56 @@
49143
49206
  for (var i = oldDistancesLength + 1; i < newDistancesLength; ++i) {
49144
49207
  mdistance = Math.max(mdistance, distances[i]);
49145
49208
  }
49209
+ var shifted = this.shift(wavefront, (shift - 1) * mdistance);
49146
49210
  var clippings = this._clippings;
49147
49211
  if (0 < mdistance) {
49148
49212
  var fdistance = 1 / mdistance;
49149
49213
  for (var i = oldDistancesLength; i < newDistancesLength; ++i) {
49150
- clippings.push(1 - distances[i] * fdistance);
49214
+ clippings.push(shifted.has(i) ? shift : 1 - distances[i] * fdistance);
49151
49215
  distances[i] = fdistance;
49152
49216
  }
49153
49217
  }
49154
49218
  else {
49155
49219
  for (var i = oldDistancesLength; i < newDistancesLength; ++i) {
49156
- clippings.push(1);
49220
+ clippings.push(shifted.has(i) ? shift : 1);
49157
49221
  distances[i] = mdistance;
49158
49222
  }
49159
49223
  }
49160
49224
  };
49161
- UtilStraightSkeletonBufferBuilder.prototype.addWavefrontAll = function (wavefronts) {
49225
+ UtilStraightSkeletonBufferBuilder.prototype.shift = function (wavefront, distance) {
49226
+ var result = new Set();
49227
+ var indexToLengthToIv = this._ivs.get(wavefront);
49228
+ if (indexToLengthToIv != null) {
49229
+ var normals_1 = wavefront.normals;
49230
+ var normalsLength_1 = normals_1.length;
49231
+ var vertices_1 = this._vertices;
49232
+ indexToLengthToIv.forEach(function (lengthToIv, index) {
49233
+ var pindex = (index - 2 + normalsLength_1) % normalsLength_1;
49234
+ var nx = normals_1[index];
49235
+ var ny = normals_1[index + 1];
49236
+ var mx = ny;
49237
+ var my = -nx;
49238
+ var pnx = normals_1[pindex];
49239
+ var pny = normals_1[pindex + 1];
49240
+ var dnm = mx * pnx + my * pny;
49241
+ var dnn = nx * pnx + ny * pny;
49242
+ var s = 0 < Math.abs(dnm) ? (1 - dnn) / dnm : 0 <= dnn ? -0.5 * dnm : 0;
49243
+ var dx = distance * (nx + s * mx);
49244
+ var dy = distance * (ny + s * my);
49245
+ lengthToIv.forEach(function (iv) {
49246
+ var iv2 = iv << 1;
49247
+ vertices_1[iv2] += dx;
49248
+ vertices_1[iv2 + 1] += dy;
49249
+ result.add(iv);
49250
+ });
49251
+ });
49252
+ }
49253
+ return result;
49254
+ };
49255
+ UtilStraightSkeletonBufferBuilder.prototype.addWavefrontAll = function (wavefronts, shift) {
49162
49256
  var wavefrontsLength = wavefronts.length;
49163
49257
  for (var i = 0; i < wavefrontsLength; ++i) {
49164
- this.addWavefront(wavefronts[i]);
49258
+ this.addWavefront(wavefronts[i], shift);
49165
49259
  }
49166
49260
  return this;
49167
49261
  };
@@ -49291,8 +49385,10 @@
49291
49385
  this.clippings = clippings;
49292
49386
  this.indices = indices;
49293
49387
  }
49294
- UtilStraightSkeletonBuffer.from = function (wavefronts) {
49295
- return new UtilStraightSkeletonBufferBuilder().addWavefrontAll(wavefronts).build();
49388
+ UtilStraightSkeletonBuffer.from = function (wavefronts, shift) {
49389
+ return new UtilStraightSkeletonBufferBuilder()
49390
+ .addWavefrontAll(wavefronts, Math.min(1.1, Math.max(1.0, shift !== null && shift !== void 0 ? shift : 1.1)))
49391
+ .build();
49296
49392
  };
49297
49393
  return UtilStraightSkeletonBuffer;
49298
49394
  }());
@@ -49488,7 +49584,8 @@
49488
49584
  var isParentIdChanged = this._parentPointsId !== parentPointsId;
49489
49585
  if (isParentIdChanged) {
49490
49586
  this._parentPointsId = parentPointsId;
49491
- var buffer = UtilStraightSkeletonBuffer.from(UtilStraightSkeleton.from(parentPoints.formatted.values));
49587
+ var values = parentPoints.formatted.values;
49588
+ var buffer = UtilStraightSkeletonBuffer.from(UtilStraightSkeleton.from(values));
49492
49589
  this._id += 1;
49493
49590
  var vertices = buffer.vertices;
49494
49591
  this._vertices = vertices;
@@ -49497,7 +49594,7 @@
49497
49594
  this._lengths = buffer.lengths;
49498
49595
  this._clippings = buffer.clippings;
49499
49596
  var boundary = this._boundary;
49500
- toPointsBoundary(vertices, boundary);
49597
+ toPointsBoundary(values, boundary);
49501
49598
  this._uvs = this.toUvs(vertices, boundary);
49502
49599
  this._indices = buffer.indices;
49503
49600
  this._nindices = buffer.indices.length / 3;