@wcardinal/wcardinal-ui 0.464.0 → 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 +4 -2
@@ -1,5 +1,5 @@
1
1
  /*!
2
- Winter Cardinal UI v0.464.0
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
 
@@ -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;
@@ -42506,11 +42515,11 @@
42506
42515
  var nny = nx * fy * s + ny * c;
42507
42516
  var sx = this.toSkeletonX(ppx, ppy, px, py, nx, ny);
42508
42517
  vertices[0] = 0;
42509
- vertices[1] = sizeY;
42510
- clippings[0] = 0;
42518
+ vertices[1] = scale * sizeY;
42519
+ clippings[0] = -1;
42511
42520
  lengths[0] = 0;
42512
42521
  uvs[0] = 0.5;
42513
- uvs[1] = 1;
42522
+ uvs[1] = 0.5 * (scale + 1);
42514
42523
  var iv = 1;
42515
42524
  var ii = 0;
42516
42525
  var length = 0;
@@ -42533,16 +42542,18 @@
42533
42542
  var nlength = length + dl;
42534
42543
  var iv1 = iv++;
42535
42544
  var iv2 = iv1 << 1;
42536
- vertices[iv2 + 0] = nx;
42537
- vertices[iv2 + 1] = ny;
42538
- clippings[iv1] = 0;
42545
+ var snx = scale * nx;
42546
+ var sny = scale * ny;
42547
+ vertices[iv2 + 0] = snx;
42548
+ vertices[iv2 + 1] = sny;
42549
+ clippings[iv1] = -1;
42539
42550
  lengths[iv1] = nlength;
42540
- uvs[iv2 + 0] = 0.5 * (nx / sizeX + 1);
42541
- uvs[iv2 + 1] = 0.5 * (ny / sizeY + 1);
42551
+ uvs[iv2 + 0] = 0.5 * (snx / sizeX + 1);
42552
+ uvs[iv2 + 1] = 0.5 * (sny / sizeY + 1);
42542
42553
  var niv1 = iv++;
42543
42554
  var niv2 = niv1 << 1;
42544
42555
  var ndistance = Math.abs(-dx * py - dy * (nsx - px)) * fl;
42545
- vertices[niv2] = nsx;
42556
+ vertices[niv2 + 0] = nsx;
42546
42557
  vertices[niv2 + 1] = 0;
42547
42558
  clippings[niv1] = ndistance;
42548
42559
  maxDistance = Math.max(maxDistance, ndistance);
@@ -42583,7 +42594,13 @@
42583
42594
  }
42584
42595
  for (var i = 0; i < iv; ++i) {
42585
42596
  distances[i] = fdistance;
42586
- clippings[i] = 1 - clippings[i] * fdistance;
42597
+ var clipping = clippings[i];
42598
+ if (0 <= clipping) {
42599
+ clippings[i] = 1 - clipping * fdistance;
42600
+ }
42601
+ else {
42602
+ clippings[i] = scale;
42603
+ }
42587
42604
  }
42588
42605
  // The skeleton points of adjacent vertices may coincide on a nearly circular ellipse.
42589
42606
  this.pad(iv, ii, nv, ni, fdistance);
@@ -42602,7 +42619,7 @@
42602
42619
  /**
42603
42620
  * Precondition: sizeX !== 0 && sizeY !== 0 && abs(sizeX) < abs(sizeY)
42604
42621
  */
42605
- EShapeCircleTriangulatedImpl.prototype.update2 = function (sizeX, sizeY, n, nv, ni) {
42622
+ EShapeCircleTriangulatedImpl.prototype.update2 = function (sizeX, sizeY, scale, n, nv, ni) {
42606
42623
  var vertices = this._vertices;
42607
42624
  var distances = this._distances;
42608
42625
  var lengths = this._lengths;
@@ -42628,11 +42645,11 @@
42628
42645
  var nny = s * nx * fy + c * ny;
42629
42646
  var sy = this.toSkeletonY(pppx, pppy, ppx, ppy, px, py);
42630
42647
  vertices[0] = 0;
42631
- vertices[1] = sizeY;
42632
- clippings[0] = 0;
42648
+ vertices[1] = scale * sizeY;
42649
+ clippings[0] = -1;
42633
42650
  lengths[0] = 0;
42634
42651
  uvs[0] = 0.5;
42635
- uvs[1] = 1;
42652
+ uvs[1] = 0.5 * (scale + 1);
42636
42653
  var iv = 1;
42637
42654
  var ii = 0;
42638
42655
  var length = 0;
@@ -42655,12 +42672,14 @@
42655
42672
  var nlength = length + dl;
42656
42673
  var iv1 = iv++;
42657
42674
  var iv2 = iv1 << 1;
42658
- vertices[iv2 + 0] = nx;
42659
- vertices[iv2 + 1] = ny;
42660
- clippings[iv1] = 0;
42675
+ var snx = scale * nx;
42676
+ var sny = scale * ny;
42677
+ vertices[iv2 + 0] = snx;
42678
+ vertices[iv2 + 1] = sny;
42679
+ clippings[iv1] = -1;
42661
42680
  lengths[iv1] = nlength;
42662
- uvs[iv2 + 0] = 0.5 * (nx / sizeX + 1);
42663
- uvs[iv2 + 1] = 0.5 * (ny / sizeY + 1);
42681
+ uvs[iv2 + 0] = 0.5 * (snx / sizeX + 1);
42682
+ uvs[iv2 + 1] = 0.5 * (sny / sizeY + 1);
42664
42683
  var niv1 = iv++;
42665
42684
  var niv2 = niv1 << 1;
42666
42685
  var ndistance = Math.abs(dx * (nsy - py) + dy * px) * fl;
@@ -42705,7 +42724,13 @@
42705
42724
  }
42706
42725
  for (var i = 0; i < iv; ++i) {
42707
42726
  distances[i] = fdistance;
42708
- clippings[i] = 1 - clippings[i] * fdistance;
42727
+ var clipping = clippings[i];
42728
+ if (0 <= clipping) {
42729
+ clippings[i] = 1 - clipping * fdistance;
42730
+ }
42731
+ else {
42732
+ clippings[i] = scale;
42733
+ }
42709
42734
  }
42710
42735
  // The skeleton points of adjacent vertices may coincide on a nearly circular ellipse.
42711
42736
  this.pad(iv, ii, nv, ni, fdistance);
@@ -42864,10 +42889,10 @@
42864
42889
  var ax = worldSize[0];
42865
42890
  var ay = worldSize[1];
42866
42891
  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);
42892
+ var c11 = toPackedClippings(1, 1);
42893
+ var c01 = toPackedClippings(0, 1);
42894
+ var c10 = toPackedClippings(1, 0);
42895
+ var c00 = toPackedClippings(0, 0);
42871
42896
  var is = voffset * 6 - 1;
42872
42897
  steps[++is] = strokeWidth;
42873
42898
  steps[++is] = e;
@@ -44056,10 +44081,10 @@
44056
44081
  var ert = toPackedI4x64(0, scaleInvariant, wr, wt);
44057
44082
  var elb = toPackedI4x64(0, scaleInvariant, wl, wb);
44058
44083
  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);
44084
+ var c11 = toPackedClippings(1, 1);
44085
+ var c01 = toPackedClippings(0, 1);
44086
+ var c00 = toPackedClippings(0, 0);
44087
+ var c10 = toPackedClippings(1, 0);
44063
44088
  // c0 c1 c4 c5
44064
44089
  // |-----| |-----|
44065
44090
  // | | | |
@@ -44317,10 +44342,10 @@
44317
44342
  var ws0 = worldSize[0];
44318
44343
  var ws1 = worldSize[1];
44319
44344
  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);
44345
+ var c11 = toPackedClippings(1, 1);
44346
+ var c01 = toPackedClippings(0, 1);
44347
+ var c10 = toPackedClippings(1, 0);
44348
+ var c00 = toPackedClippings(0, 0);
44324
44349
  var is = voffset * 6 - 1;
44325
44350
  steps[++is] = strokeWidth;
44326
44351
  steps[++is] = e;
@@ -44565,14 +44590,14 @@
44565
44590
  var w = 1 - radius;
44566
44591
  var e0 = toPackedI4x64(0, scaleInvariant, 1, 1);
44567
44592
  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);
44593
+ var c00 = toPackedClippings(0, 0);
44594
+ var c10 = toPackedClippings(1, 0);
44595
+ var c11 = toPackedClippings(1, 1);
44596
+ var c01 = toPackedClippings(0, 1);
44597
+ var cww = toPackedClippings(w, w);
44598
+ var c1w = toPackedClippings(1, w);
44599
+ var cw1 = toPackedClippings(w, 1);
44600
+ var cw0 = toPackedClippings(w, 0);
44576
44601
  // Top corner
44577
44602
  var is = voffset * 6 - 1;
44578
44603
  if (corner & EShapeCorner.TOP) {
@@ -44987,9 +45012,9 @@
44987
45012
  var scaleInvariant = toScaleInvariant(strokeStyle);
44988
45013
  var s = worldSize[0];
44989
45014
  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);
45015
+ var c00 = toPackedClippings(0, 0);
45016
+ var c10 = toPackedClippings(1, 0);
45017
+ var c01 = toPackedClippings(0, 1);
44993
45018
  // 000
44994
45019
  var is = voffset * 6 - 1;
44995
45020
  steps[++is] = strokeWidth;
@@ -49096,7 +49121,7 @@
49096
49121
  this._lengths.push(length);
49097
49122
  return result;
49098
49123
  };
49099
- UtilStraightSkeletonBufferBuilder.prototype.addWavefront = function (wavefront) {
49124
+ UtilStraightSkeletonBufferBuilder.prototype.addWavefront = function (wavefront, shift) {
49100
49125
  if (wavefront.parent != null) {
49101
49126
  return;
49102
49127
  }
@@ -49143,25 +49168,56 @@
49143
49168
  for (var i = oldDistancesLength + 1; i < newDistancesLength; ++i) {
49144
49169
  mdistance = Math.max(mdistance, distances[i]);
49145
49170
  }
49171
+ var shifted = this.shift(wavefront, (shift - 1) * mdistance);
49146
49172
  var clippings = this._clippings;
49147
49173
  if (0 < mdistance) {
49148
49174
  var fdistance = 1 / mdistance;
49149
49175
  for (var i = oldDistancesLength; i < newDistancesLength; ++i) {
49150
- clippings.push(1 - distances[i] * fdistance);
49176
+ clippings.push(shifted.has(i) ? shift : 1 - distances[i] * fdistance);
49151
49177
  distances[i] = fdistance;
49152
49178
  }
49153
49179
  }
49154
49180
  else {
49155
49181
  for (var i = oldDistancesLength; i < newDistancesLength; ++i) {
49156
- clippings.push(1);
49182
+ clippings.push(shifted.has(i) ? shift : 1);
49157
49183
  distances[i] = mdistance;
49158
49184
  }
49159
49185
  }
49160
49186
  };
49161
- UtilStraightSkeletonBufferBuilder.prototype.addWavefrontAll = function (wavefronts) {
49187
+ UtilStraightSkeletonBufferBuilder.prototype.shift = function (wavefront, distance) {
49188
+ var result = new Set();
49189
+ var indexToLengthToIv = this._ivs.get(wavefront);
49190
+ if (indexToLengthToIv != null) {
49191
+ var normals_1 = wavefront.normals;
49192
+ var normalsLength_1 = normals_1.length;
49193
+ var vertices_1 = this._vertices;
49194
+ indexToLengthToIv.forEach(function (lengthToIv, index) {
49195
+ var pindex = (index - 2 + normalsLength_1) % normalsLength_1;
49196
+ var nx = normals_1[index];
49197
+ var ny = normals_1[index + 1];
49198
+ var mx = ny;
49199
+ var my = -nx;
49200
+ var pnx = normals_1[pindex];
49201
+ var pny = normals_1[pindex + 1];
49202
+ var dnm = mx * pnx + my * pny;
49203
+ var dnn = nx * pnx + ny * pny;
49204
+ var s = 0 < Math.abs(dnm) ? (1 - dnn) / dnm : 0 <= dnn ? -0.5 * dnm : 0;
49205
+ var dx = distance * (nx + s * mx);
49206
+ var dy = distance * (ny + s * my);
49207
+ lengthToIv.forEach(function (iv) {
49208
+ var iv2 = iv << 1;
49209
+ vertices_1[iv2] += dx;
49210
+ vertices_1[iv2 + 1] += dy;
49211
+ result.add(iv);
49212
+ });
49213
+ });
49214
+ }
49215
+ return result;
49216
+ };
49217
+ UtilStraightSkeletonBufferBuilder.prototype.addWavefrontAll = function (wavefronts, shift) {
49162
49218
  var wavefrontsLength = wavefronts.length;
49163
49219
  for (var i = 0; i < wavefrontsLength; ++i) {
49164
- this.addWavefront(wavefronts[i]);
49220
+ this.addWavefront(wavefronts[i], shift);
49165
49221
  }
49166
49222
  return this;
49167
49223
  };
@@ -49291,8 +49347,10 @@
49291
49347
  this.clippings = clippings;
49292
49348
  this.indices = indices;
49293
49349
  }
49294
- UtilStraightSkeletonBuffer.from = function (wavefronts) {
49295
- return new UtilStraightSkeletonBufferBuilder().addWavefrontAll(wavefronts).build();
49350
+ UtilStraightSkeletonBuffer.from = function (wavefronts, shift) {
49351
+ return new UtilStraightSkeletonBufferBuilder()
49352
+ .addWavefrontAll(wavefronts, Math.min(1.1, Math.max(1.0, shift !== null && shift !== void 0 ? shift : 1.1)))
49353
+ .build();
49296
49354
  };
49297
49355
  return UtilStraightSkeletonBuffer;
49298
49356
  }());
@@ -49488,7 +49546,8 @@
49488
49546
  var isParentIdChanged = this._parentPointsId !== parentPointsId;
49489
49547
  if (isParentIdChanged) {
49490
49548
  this._parentPointsId = parentPointsId;
49491
- var buffer = UtilStraightSkeletonBuffer.from(UtilStraightSkeleton.from(parentPoints.formatted.values));
49549
+ var values = parentPoints.formatted.values;
49550
+ var buffer = UtilStraightSkeletonBuffer.from(UtilStraightSkeleton.from(values));
49492
49551
  this._id += 1;
49493
49552
  var vertices = buffer.vertices;
49494
49553
  this._vertices = vertices;
@@ -49497,7 +49556,7 @@
49497
49556
  this._lengths = buffer.lengths;
49498
49557
  this._clippings = buffer.clippings;
49499
49558
  var boundary = this._boundary;
49500
- toPointsBoundary(vertices, boundary);
49559
+ toPointsBoundary(values, boundary);
49501
49560
  this._uvs = this.toUvs(vertices, boundary);
49502
49561
  this._indices = buffer.indices;
49503
49562
  this._nindices = buffer.indices.length / 3;