@wcardinal/wcardinal-ui 0.469.0-beta.2 → 0.469.0-beta.3

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 (30) hide show
  1. package/dist/types/wcardinal/ui/shape/variant/e-shape-fan-triangulated-impl.d.ts +12 -10
  2. package/dist/wcardinal/ui/shape/e-shape-renderer.js +1 -1
  3. package/dist/wcardinal/ui/shape/e-shape-renderer.js.map +1 -1
  4. package/dist/wcardinal/ui/shape/variant/e-shape-fan-triangulated-impl.js +33 -28
  5. package/dist/wcardinal/ui/shape/variant/e-shape-fan-triangulated-impl.js.map +1 -1
  6. package/dist/wcardinal/ui/shape/variant/e-shape-fan.js +1 -1
  7. package/dist/wcardinal/ui/shape/variant/e-shape-fan.js.map +1 -1
  8. package/dist/wcardinal/ui/shape/variant/e-shape-semicircle.js +1 -1
  9. package/dist/wcardinal/ui/shape/variant/e-shape-semicircle.js.map +1 -1
  10. package/dist/wcardinal/ui/shape/variant/hit-test-fan.js +3 -3
  11. package/dist/wcardinal/ui/shape/variant/hit-test-fan.js.map +1 -1
  12. package/dist/wcardinal/ui/shape/variant/to-packed.js +5 -3
  13. package/dist/wcardinal/ui/shape/variant/to-packed.js.map +1 -1
  14. package/dist/wcardinal-ui-theme-dark-en-us.js +1 -1
  15. package/dist/wcardinal-ui-theme-dark-en-us.min.js +1 -1
  16. package/dist/wcardinal-ui-theme-dark-ja-jp.js +1 -1
  17. package/dist/wcardinal-ui-theme-dark-ja-jp.min.js +1 -1
  18. package/dist/wcardinal-ui-theme-dark.js +1 -1
  19. package/dist/wcardinal-ui-theme-dark.min.js +1 -1
  20. package/dist/wcardinal-ui-theme-white-en-us.js +1 -1
  21. package/dist/wcardinal-ui-theme-white-en-us.min.js +1 -1
  22. package/dist/wcardinal-ui-theme-white-ja-jp.js +1 -1
  23. package/dist/wcardinal-ui-theme-white-ja-jp.min.js +1 -1
  24. package/dist/wcardinal-ui-theme-white.js +1 -1
  25. package/dist/wcardinal-ui-theme-white.min.js +1 -1
  26. package/dist/wcardinal-ui.cjs.js +45 -38
  27. package/dist/wcardinal-ui.js +45 -38
  28. package/dist/wcardinal-ui.min.js +2 -2
  29. package/dist/wcardinal-ui.min.js.map +1 -1
  30. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  /*!
2
- Winter Cardinal UI v0.469.0-beta.2
2
+ Winter Cardinal UI v0.469.0-beta.3
3
3
  Copyright (C) 2019-2026 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -263,9 +263,11 @@ var toPackedAlphas = function (a0, a1) {
263
263
  return Math.round(1023 * a0) + (Math.round(1023 * a1) << 10);
264
264
  };
265
265
  var toPackedClippings = function (x, y) {
266
- // Encode the range [-0.1, 1.1] into the 10-bit range [0, 1023]
267
- // Since 1023 / 1.2 = 852.5,
268
- return Math.round(852.5 * (x + 0.1)) + (Math.round(852.5 * (y + 0.1)) << 10);
266
+ // Encode the range [0, 1.1] into the 10-bit range [0, 1023]
267
+ // Since 1023 / 1.1 = 930, 0, 1 and 1.1 are exactly representable.
268
+ // The values out of the range are clamped.
269
+ return (Math.round(930 * Math.max(0, Math.min(1.1, x))) +
270
+ (Math.round(930 * Math.max(0, Math.min(1.1, y))) << 10));
269
271
  };
270
272
 
271
273
  var BAR_VERTEX_COUNT = 4;
@@ -16841,7 +16843,7 @@ var EShapeRendererIterator = /** @class */ (function () {
16841
16843
  * Copyright (C) 2019 Toshiba Corporation
16842
16844
  * SPDX-License-Identifier: Apache-2.0
16843
16845
  */
16844
- 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(852.5, 852.5);\n\tc -= vec2(0.1, 0.1);\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}";
16846
+ 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}";
16845
16847
  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\tvec2 zero = vec2(0.0);\n\tfloat s0 = smoothstep(length(c/clamp(one + awd, zero, one)), length(c/clamp(one - awd, zero, one)), 1.0);\n\tfloat s1 = smoothstep(length(c/clamp(one - swd + awd, zero, one)), length(c/clamp(one - swd - awd, zero, one)), 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\tfloat s3 = smoothstep(-awd, 0.0, vStepB.z);\n\treturn texture * (\n\t\tvColorStroke * (s1 - s0) +\n\t\tvColorFill * (1.0 - s1) * (1.0 - s0) * s2 * s3\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}";
16846
16848
  var EShapeRenderer = /** @class */ (function (_super) {
16847
16849
  __extends(EShapeRenderer, _super);
@@ -70115,15 +70117,17 @@ var toFanAngleEccentric = function (w, h, theta) {
70115
70117
  *
70116
70118
  * ## Stroke sides
70117
70119
  *
70120
+ * The arc is stroked if any of the LEFT, TOP and RIGHT bits of the stroke side is set (ARC below),
70121
+ * and the straight sides are stroked if the BOTTOM bit is set.
70118
70122
  * The clipping of a vertex is 1 on the outline and decreases toward the inside by (the distance from the outline) * fd,
70119
70123
  * where the outline is the arc and/or the straight sides depending on the stroke side.
70120
70124
  *
70121
- * - ALL (and NONE): the stroke is at the arc and the straight sides.
70125
+ * - ARC and BOTTOM (and NONE): the stroke is at the arc and the straight sides.
70122
70126
  * The fan is triangulated into the strip P[k], P[k + 1], Q[k + 1], Q[k] and
70123
70127
  * the two polygons O', A', Q[0], ..., Q[N] and O', B', Q[2N], ..., Q[N] at the bottom.
70124
- * - TOP: the stroke is only at the arc.
70128
+ * - ARC: the stroke is only at the arc.
70125
70129
  * For a circle and a semi-ellipse, Q[k] are the points on the axis, which gives the exact fan with the strip only.
70126
- * For the other ellipses, Q[k] are on the medial axis as ALL, and the two polygons
70130
+ * For the other ellipses, Q[k] are on the medial axis as ARC and BOTTOM, and the two polygons
70127
70131
  * O, Q[0], ..., Q[N] and O, Q[2N], ..., Q[N] are added at the bottom without the stroke and the anti-aliasing.
70128
70132
  * - BOTTOM: the stroke is only at the straight sides.
70129
70133
  * It is the same as a polygon. Two triangle fans from C cover the area between the arc and the segments CA and CB,
@@ -70137,7 +70141,7 @@ var EShapeFanTriangulatedImpl = /** @class */ (function () {
70137
70141
  this._height = 0;
70138
70142
  this._strokeAlign = 0;
70139
70143
  this._strokeWidth = 0;
70140
- this._strokeSideTop = true;
70144
+ this._strokeSideArc = true;
70141
70145
  this._strokeSideBottom = true;
70142
70146
  this._angle = 0;
70143
70147
  this._sizeX = 0;
@@ -70241,11 +70245,11 @@ var EShapeFanTriangulatedImpl = /** @class */ (function () {
70241
70245
  var isRectChanged = this._width !== width || this._height !== height;
70242
70246
  var stroke = parent.stroke;
70243
70247
  var strokeAlign = stroke.align;
70244
- var strokeSideTop = (stroke.side & EShapeStrokeSide.TOP) !== 0;
70248
+ var strokeSideArc = (stroke.side & EShapeStrokeSide.NOT_BOTTOM) !== 0;
70245
70249
  var strokeSideBottom = (stroke.side & EShapeStrokeSide.BOTTOM) !== 0;
70246
- var strokeWidth = stroke.enable && (strokeSideTop || strokeSideBottom) ? stroke.width : 0;
70250
+ var strokeWidth = stroke.enable && (strokeSideArc || strokeSideBottom) ? stroke.width : 0;
70247
70251
  var isStrokeChanged = this._strokeAlign !== strokeAlign || this._strokeWidth !== strokeWidth;
70248
- var isStrokeSideChanged = this._strokeSideTop !== strokeSideTop || this._strokeSideBottom !== strokeSideBottom;
70252
+ var isStrokeSideChanged = this._strokeSideArc !== strokeSideArc || this._strokeSideBottom !== strokeSideBottom;
70249
70253
  var angle = parent.angle;
70250
70254
  var isAngleChanged = this._angle !== angle;
70251
70255
  var isSizeChanged = false;
@@ -70264,13 +70268,13 @@ var EShapeFanTriangulatedImpl = /** @class */ (function () {
70264
70268
  if (isNotInitialized || isSizeChanged || isStrokeSideChanged || isAngleChanged) {
70265
70269
  this._sizeX = sizeX;
70266
70270
  this._sizeY = sizeY;
70267
- this._strokeSideTop = strokeSideTop;
70271
+ this._strokeSideArc = strokeSideArc;
70268
70272
  this._strokeSideBottom = strokeSideBottom;
70269
70273
  this._angle = angle;
70270
- this.update(sizeX, sizeY, angle, strokeSideTop, strokeSideBottom);
70274
+ this.update(sizeX, sizeY, angle, strokeSideArc, strokeSideBottom);
70271
70275
  }
70272
70276
  };
70273
- EShapeFanTriangulatedImpl.prototype.update = function (sx, sy, angle, sst, ssb) {
70277
+ EShapeFanTriangulatedImpl.prototype.update = function (sx, sy, angle, ssa, ssb) {
70274
70278
  // The number of the arc segments is 2n and the number of the points on the arc is m.
70275
70279
  var n = EShapeDefaults.CIRCLE_SEGMENT_COUNT >> 2;
70276
70280
  var m = 2 * n + 1;
@@ -70306,11 +70310,11 @@ var EShapeFanTriangulatedImpl = /** @class */ (function () {
70306
70310
  var fy = 1 / ay;
70307
70311
  var gx = Math.sign(sx);
70308
70312
  var gy = Math.sign(sy);
70309
- if (!sst && ssb) {
70313
+ if (!ssa && ssb) {
70310
70314
  this.updateBottom(ax, ay, n, ea, sea, cea, bx, by, st, ct, fx, fy, gx, gy, nv, ni);
70311
70315
  }
70312
70316
  else {
70313
- this.updateArc(ax, ay, n, ea, sea, cea, bx, oa, st, ct, fx, fy, gx, gy, sst, ssb, nv, ni);
70317
+ this.updateArc(ax, ay, n, ea, sea, cea, bx, oa, st, ct, fx, fy, gx, gy, ssa, ssb, nv, ni);
70314
70318
  }
70315
70319
  };
70316
70320
  /**
@@ -70324,13 +70328,13 @@ var EShapeFanTriangulatedImpl = /** @class */ (function () {
70324
70328
  boundary[3] = +h;
70325
70329
  this.pad(0, 0, nv, ni, 0);
70326
70330
  };
70327
- EShapeFanTriangulatedImpl.prototype.updateArc = function (w, h, n, ea, sea, cea, bx, oa, st, ct, fx, fy, gx, gy, sst, ssb, nv, ni) {
70331
+ EShapeFanTriangulatedImpl.prototype.updateArc = function (w, h, n, ea, sea, cea, bx, oa, st, ct, fx, fy, gx, gy, ssa, ssb, nv, ni) {
70328
70332
  var m = 2 * n + 1;
70329
70333
  // sided: the straight sides are the outline, which has the stroke and the anti-aliasing
70330
70334
  // capped: the polygons are added at the bottom to cover the sector with the hard straight sides
70331
70335
  // chained: Q is on the medial axis. Otherwise, Q is on the axis x = 0 (w <= h) or y = 0 (h < w)
70332
70336
  // For a circle and a semi-ellipse, Q on the axis gives the exact fan.
70333
- var sided = !sst || ssb;
70337
+ var sided = !ssa || ssb;
70334
70338
  var isExact = Math.abs(w - h) <= 1e-9 * w || Math.PI * 0.5 <= ea;
70335
70339
  var capped = !sided && !isExact;
70336
70340
  var chained = sided || capped;
@@ -70693,17 +70697,20 @@ var EShapeFanTriangulatedImpl = /** @class */ (function () {
70693
70697
  var fd = (1 + st) / (h * st);
70694
70698
  var fs = (EShapeFanTriangulatedImpl.SCALE - 1) / fd;
70695
70699
  this.computeArcPoints(w, h, n, ea, sea, cea);
70700
+ this.computeArcNormals(w, h, n);
70701
+ // The length of O, which is the same as the one of writeSidePolygon: |OA| + the length of the arc
70702
+ var l0 = Math.sqrt(bx * bx + by * by) + EShapeFanTriangulatedImpl.WORK_ARC_L[2 * n];
70696
70703
  // Triangle fans from C to the arc: left (sign = -1) and right (sign = +1)
70697
70704
  var iv = 0;
70698
70705
  var ii = 0;
70699
70706
  for (var sign = -1; sign <= 1; sign += 2) {
70700
- var count = this.writeBottomFan(iv, ii, sign, n, yc, st, ct, fd, fx, fy, gx, gy);
70707
+ var count = this.writeBottomFan(iv, ii, sign, n, yc, l0, st, ct, fd, fx, fy, gx, gy);
70701
70708
  iv += count;
70702
70709
  ii += 3 * (count - 2);
70703
70710
  }
70704
70711
  // Quads at the bottom: O', A', A, C and O', B', B, C
70705
70712
  for (var sign = -1; sign <= 1; sign += 2) {
70706
- var count = this.writeBottomQuad(iv, ii, sign, bx, by, yc, fs, st, ct, fd, fx, fy, gx, gy);
70713
+ var count = this.writeBottomQuad(iv, ii, sign, bx, by, yc, l0, fs, st, ct, fd, fx, fy, gx, gy);
70707
70714
  iv += count;
70708
70715
  ii += 3 * (count - 2);
70709
70716
  }
@@ -70714,19 +70721,19 @@ var EShapeFanTriangulatedImpl = /** @class */ (function () {
70714
70721
  * Returns the number of the written vertices.
70715
70722
  *
70716
70723
  * The clipping is 1 + fd * (n . p) where n is the outward unit normal of the straight side,
70717
- * and the length is the distance along the straight side measured from O.
70718
- * The side OA has n = (-ct, st) and l = (-st, -ct), and the side OB has n = (ct, st) and l = (st, -ct).
70724
+ * and the length is l0 + (-st, sign * ct) . p, which is the same as the one of writeSidePolygon
70725
+ * so that the dashes of the straight sides do not depend on the stroke side.
70719
70726
  */
70720
- EShapeFanTriangulatedImpl.prototype.writeBottomFan = function (iv, ii, sign, n, yc, st, ct, fd, fx, fy, gx, gy) {
70727
+ EShapeFanTriangulatedImpl.prototype.writeBottomFan = function (iv, ii, sign, n, yc, l0, st, ct, fd, fx, fy, gx, gy) {
70721
70728
  var px = EShapeFanTriangulatedImpl.WORK_ARC_X;
70722
70729
  var py = EShapeFanTriangulatedImpl.WORK_ARC_Y;
70723
70730
  var nx = sign * ct;
70724
- var lx = sign * st;
70731
+ var ly = sign * ct;
70725
70732
  var count = 0;
70726
- this.writeSideVertex(iv + count++, 0, -yc, 0, nx, st, 0, lx, -ct, fd, fx, fy, gx, gy);
70733
+ this.writeSideVertex(iv + count++, 0, -yc, 0, nx, st, l0, -st, ly, fd, fx, fy, gx, gy);
70727
70734
  for (var j = 0; j <= n; ++j) {
70728
70735
  var k = sign < 0 ? j : n + j;
70729
- this.writeSideVertex(iv + count++, px[k], py[k], 0, nx, st, 0, lx, -ct, fd, fx, fy, gx, gy);
70736
+ this.writeSideVertex(iv + count++, px[k], py[k], 0, nx, st, l0, -st, ly, fd, fx, fy, gx, gy);
70730
70737
  }
70731
70738
  this.writeFan(ii, iv, count);
70732
70739
  return count;
@@ -70736,13 +70743,13 @@ var EShapeFanTriangulatedImpl = /** @class */ (function () {
70736
70743
  * O' is shifted outward by fs / st, and A' (B') is shifted outward by fs perpendicular to the straight side.
70737
70744
  * Returns the number of the written vertices.
70738
70745
  */
70739
- EShapeFanTriangulatedImpl.prototype.writeBottomQuad = function (iv, ii, sign, bx, by, yc, fs, st, ct, fd, fx, fy, gx, gy) {
70746
+ EShapeFanTriangulatedImpl.prototype.writeBottomQuad = function (iv, ii, sign, bx, by, yc, l0, fs, st, ct, fd, fx, fy, gx, gy) {
70740
70747
  var nx = sign * ct;
70741
- var lx = sign * st;
70742
- this.writeSideVertex(iv, 0, fs / st, 0, nx, st, 0, lx, -ct, fd, fx, fy, gx, gy);
70743
- this.writeSideVertex(iv + 1, sign * (bx + fs * ct), -by + fs * st, 0, nx, st, 0, lx, -ct, fd, fx, fy, gx, gy);
70744
- this.writeSideVertex(iv + 2, sign * bx, -by, 0, nx, st, 0, lx, -ct, fd, fx, fy, gx, gy);
70745
- this.writeSideVertex(iv + 3, 0, -yc, 0, nx, st, 0, lx, -ct, fd, fx, fy, gx, gy);
70748
+ var ly = sign * ct;
70749
+ this.writeSideVertex(iv, 0, fs / st, 0, nx, st, l0, -st, ly, fd, fx, fy, gx, gy);
70750
+ this.writeSideVertex(iv + 1, sign * (bx + fs * ct), -by + fs * st, 0, nx, st, l0, -st, ly, fd, fx, fy, gx, gy);
70751
+ this.writeSideVertex(iv + 2, sign * bx, -by, 0, nx, st, l0, -st, ly, fd, fx, fy, gx, gy);
70752
+ this.writeSideVertex(iv + 3, 0, -yc, 0, nx, st, l0, -st, ly, fd, fx, fy, gx, gy);
70746
70753
  this.writeFan(ii, iv, 4);
70747
70754
  return 4;
70748
70755
  };
@@ -70898,16 +70905,16 @@ var hitTestFan = function (shape, x, y, ax, ay, sw, ss) {
70898
70905
  var ct = Math.cos(ca);
70899
70906
  var fill = shape.fill;
70900
70907
  var strokeSide = shape.stroke.side;
70901
- var strokeSideTop = (strokeSide & EShapeStrokeSide.TOP) !== 0;
70908
+ var strokeSideArc = (strokeSide & EShapeStrokeSide.NOT_BOTTOM) !== 0;
70902
70909
  var strokeSideBottom = (strokeSide & EShapeStrokeSide.BOTTOM) !== 0;
70903
- var strokeWidth = strokeSideTop || strokeSideBottom ? sw : 0;
70910
+ var strokeWidth = strokeSideArc || strokeSideBottom ? sw : 0;
70904
70911
  if ((fill.enable || 0 < strokeWidth) && isInFan(x, y, ax, ay, st, ct, 0, 0)) {
70905
70912
  if (fill.enable && hitTestFanFill(shape, x, y, bx, ay)) {
70906
70913
  return true;
70907
70914
  }
70908
70915
  if (0 < strokeWidth) {
70909
70916
  var s = strokeWidth * ss;
70910
- var arc = strokeSideTop ? s : 0;
70917
+ var arc = strokeSideArc ? s : 0;
70911
70918
  var sides = strokeSideBottom ? s : 0;
70912
70919
  if (!isInFan(x, y, ax, ay, st, ct, arc, sides)) {
70913
70920
  return true;
@@ -70961,7 +70968,7 @@ var EShapeFan = /** @class */ (function (_super) {
70961
70968
  configurable: true
70962
70969
  });
70963
70970
  EShapeFan.prototype.toHitTestStrokeShift = function (strokeWidth, strokeScale, strokeAlign) {
70964
- if ((this.stroke.side & EShapeStrokeSide.TOP_OR_BOTTOM) !== 0) {
70971
+ if (this.stroke.side !== EShapeStrokeSide.NONE) {
70965
70972
  return _super.prototype.toHitTestStrokeShift.call(this, strokeWidth, strokeScale, strokeAlign);
70966
70973
  }
70967
70974
  return 0;
@@ -78913,7 +78920,7 @@ var EShapeSemicircle = /** @class */ (function (_super) {
78913
78920
  configurable: true
78914
78921
  });
78915
78922
  EShapeSemicircle.prototype.toHitTestStrokeShift = function (strokeWidth, strokeScale, strokeAlign) {
78916
- if ((this.stroke.side & EShapeStrokeSide.TOP_OR_BOTTOM) !== 0) {
78923
+ if (this.stroke.side !== EShapeStrokeSide.NONE) {
78917
78924
  return _super.prototype.toHitTestStrokeShift.call(this, strokeWidth, strokeScale, strokeAlign);
78918
78925
  }
78919
78926
  return 0;
@@ -1,5 +1,5 @@
1
1
  /*!
2
- Winter Cardinal UI v0.469.0-beta.2
2
+ Winter Cardinal UI v0.469.0-beta.3
3
3
  Copyright (C) 2019-2026 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -260,9 +260,11 @@
260
260
  return Math.round(1023 * a0) + (Math.round(1023 * a1) << 10);
261
261
  };
262
262
  var toPackedClippings = function (x, y) {
263
- // Encode the range [-0.1, 1.1] into the 10-bit range [0, 1023]
264
- // Since 1023 / 1.2 = 852.5,
265
- return Math.round(852.5 * (x + 0.1)) + (Math.round(852.5 * (y + 0.1)) << 10);
263
+ // Encode the range [0, 1.1] into the 10-bit range [0, 1023]
264
+ // Since 1023 / 1.1 = 930, 0, 1 and 1.1 are exactly representable.
265
+ // The values out of the range are clamped.
266
+ return (Math.round(930 * Math.max(0, Math.min(1.1, x))) +
267
+ (Math.round(930 * Math.max(0, Math.min(1.1, y))) << 10));
266
268
  };
267
269
 
268
270
  var BAR_VERTEX_COUNT = 4;
@@ -16838,7 +16840,7 @@
16838
16840
  * Copyright (C) 2019 Toshiba Corporation
16839
16841
  * SPDX-License-Identifier: Apache-2.0
16840
16842
  */
16841
- 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(852.5, 852.5);\n\tc -= vec2(0.1, 0.1);\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}";
16843
+ 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}";
16842
16844
  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\tvec2 zero = vec2(0.0);\n\tfloat s0 = smoothstep(length(c/clamp(one + awd, zero, one)), length(c/clamp(one - awd, zero, one)), 1.0);\n\tfloat s1 = smoothstep(length(c/clamp(one - swd + awd, zero, one)), length(c/clamp(one - swd - awd, zero, one)), 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\tfloat s3 = smoothstep(-awd, 0.0, vStepB.z);\n\treturn texture * (\n\t\tvColorStroke * (s1 - s0) +\n\t\tvColorFill * (1.0 - s1) * (1.0 - s0) * s2 * s3\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}";
16843
16845
  var EShapeRenderer = /** @class */ (function (_super) {
16844
16846
  __extends(EShapeRenderer, _super);
@@ -48006,15 +48008,17 @@
48006
48008
  *
48007
48009
  * ## Stroke sides
48008
48010
  *
48011
+ * The arc is stroked if any of the LEFT, TOP and RIGHT bits of the stroke side is set (ARC below),
48012
+ * and the straight sides are stroked if the BOTTOM bit is set.
48009
48013
  * The clipping of a vertex is 1 on the outline and decreases toward the inside by (the distance from the outline) * fd,
48010
48014
  * where the outline is the arc and/or the straight sides depending on the stroke side.
48011
48015
  *
48012
- * - ALL (and NONE): the stroke is at the arc and the straight sides.
48016
+ * - ARC and BOTTOM (and NONE): the stroke is at the arc and the straight sides.
48013
48017
  * The fan is triangulated into the strip P[k], P[k + 1], Q[k + 1], Q[k] and
48014
48018
  * the two polygons O', A', Q[0], ..., Q[N] and O', B', Q[2N], ..., Q[N] at the bottom.
48015
- * - TOP: the stroke is only at the arc.
48019
+ * - ARC: the stroke is only at the arc.
48016
48020
  * For a circle and a semi-ellipse, Q[k] are the points on the axis, which gives the exact fan with the strip only.
48017
- * For the other ellipses, Q[k] are on the medial axis as ALL, and the two polygons
48021
+ * For the other ellipses, Q[k] are on the medial axis as ARC and BOTTOM, and the two polygons
48018
48022
  * O, Q[0], ..., Q[N] and O, Q[2N], ..., Q[N] are added at the bottom without the stroke and the anti-aliasing.
48019
48023
  * - BOTTOM: the stroke is only at the straight sides.
48020
48024
  * It is the same as a polygon. Two triangle fans from C cover the area between the arc and the segments CA and CB,
@@ -48028,7 +48032,7 @@
48028
48032
  this._height = 0;
48029
48033
  this._strokeAlign = 0;
48030
48034
  this._strokeWidth = 0;
48031
- this._strokeSideTop = true;
48035
+ this._strokeSideArc = true;
48032
48036
  this._strokeSideBottom = true;
48033
48037
  this._angle = 0;
48034
48038
  this._sizeX = 0;
@@ -48132,11 +48136,11 @@
48132
48136
  var isRectChanged = this._width !== width || this._height !== height;
48133
48137
  var stroke = parent.stroke;
48134
48138
  var strokeAlign = stroke.align;
48135
- var strokeSideTop = (stroke.side & EShapeStrokeSide.TOP) !== 0;
48139
+ var strokeSideArc = (stroke.side & EShapeStrokeSide.NOT_BOTTOM) !== 0;
48136
48140
  var strokeSideBottom = (stroke.side & EShapeStrokeSide.BOTTOM) !== 0;
48137
- var strokeWidth = stroke.enable && (strokeSideTop || strokeSideBottom) ? stroke.width : 0;
48141
+ var strokeWidth = stroke.enable && (strokeSideArc || strokeSideBottom) ? stroke.width : 0;
48138
48142
  var isStrokeChanged = this._strokeAlign !== strokeAlign || this._strokeWidth !== strokeWidth;
48139
- var isStrokeSideChanged = this._strokeSideTop !== strokeSideTop || this._strokeSideBottom !== strokeSideBottom;
48143
+ var isStrokeSideChanged = this._strokeSideArc !== strokeSideArc || this._strokeSideBottom !== strokeSideBottom;
48140
48144
  var angle = parent.angle;
48141
48145
  var isAngleChanged = this._angle !== angle;
48142
48146
  var isSizeChanged = false;
@@ -48155,13 +48159,13 @@
48155
48159
  if (isNotInitialized || isSizeChanged || isStrokeSideChanged || isAngleChanged) {
48156
48160
  this._sizeX = sizeX;
48157
48161
  this._sizeY = sizeY;
48158
- this._strokeSideTop = strokeSideTop;
48162
+ this._strokeSideArc = strokeSideArc;
48159
48163
  this._strokeSideBottom = strokeSideBottom;
48160
48164
  this._angle = angle;
48161
- this.update(sizeX, sizeY, angle, strokeSideTop, strokeSideBottom);
48165
+ this.update(sizeX, sizeY, angle, strokeSideArc, strokeSideBottom);
48162
48166
  }
48163
48167
  };
48164
- EShapeFanTriangulatedImpl.prototype.update = function (sx, sy, angle, sst, ssb) {
48168
+ EShapeFanTriangulatedImpl.prototype.update = function (sx, sy, angle, ssa, ssb) {
48165
48169
  // The number of the arc segments is 2n and the number of the points on the arc is m.
48166
48170
  var n = EShapeDefaults.CIRCLE_SEGMENT_COUNT >> 2;
48167
48171
  var m = 2 * n + 1;
@@ -48197,11 +48201,11 @@
48197
48201
  var fy = 1 / ay;
48198
48202
  var gx = Math.sign(sx);
48199
48203
  var gy = Math.sign(sy);
48200
- if (!sst && ssb) {
48204
+ if (!ssa && ssb) {
48201
48205
  this.updateBottom(ax, ay, n, ea, sea, cea, bx, by, st, ct, fx, fy, gx, gy, nv, ni);
48202
48206
  }
48203
48207
  else {
48204
- this.updateArc(ax, ay, n, ea, sea, cea, bx, oa, st, ct, fx, fy, gx, gy, sst, ssb, nv, ni);
48208
+ this.updateArc(ax, ay, n, ea, sea, cea, bx, oa, st, ct, fx, fy, gx, gy, ssa, ssb, nv, ni);
48205
48209
  }
48206
48210
  };
48207
48211
  /**
@@ -48215,13 +48219,13 @@
48215
48219
  boundary[3] = +h;
48216
48220
  this.pad(0, 0, nv, ni, 0);
48217
48221
  };
48218
- EShapeFanTriangulatedImpl.prototype.updateArc = function (w, h, n, ea, sea, cea, bx, oa, st, ct, fx, fy, gx, gy, sst, ssb, nv, ni) {
48222
+ EShapeFanTriangulatedImpl.prototype.updateArc = function (w, h, n, ea, sea, cea, bx, oa, st, ct, fx, fy, gx, gy, ssa, ssb, nv, ni) {
48219
48223
  var m = 2 * n + 1;
48220
48224
  // sided: the straight sides are the outline, which has the stroke and the anti-aliasing
48221
48225
  // capped: the polygons are added at the bottom to cover the sector with the hard straight sides
48222
48226
  // chained: Q is on the medial axis. Otherwise, Q is on the axis x = 0 (w <= h) or y = 0 (h < w)
48223
48227
  // For a circle and a semi-ellipse, Q on the axis gives the exact fan.
48224
- var sided = !sst || ssb;
48228
+ var sided = !ssa || ssb;
48225
48229
  var isExact = Math.abs(w - h) <= 1e-9 * w || Math.PI * 0.5 <= ea;
48226
48230
  var capped = !sided && !isExact;
48227
48231
  var chained = sided || capped;
@@ -48584,17 +48588,20 @@
48584
48588
  var fd = (1 + st) / (h * st);
48585
48589
  var fs = (EShapeFanTriangulatedImpl.SCALE - 1) / fd;
48586
48590
  this.computeArcPoints(w, h, n, ea, sea, cea);
48591
+ this.computeArcNormals(w, h, n);
48592
+ // The length of O, which is the same as the one of writeSidePolygon: |OA| + the length of the arc
48593
+ var l0 = Math.sqrt(bx * bx + by * by) + EShapeFanTriangulatedImpl.WORK_ARC_L[2 * n];
48587
48594
  // Triangle fans from C to the arc: left (sign = -1) and right (sign = +1)
48588
48595
  var iv = 0;
48589
48596
  var ii = 0;
48590
48597
  for (var sign = -1; sign <= 1; sign += 2) {
48591
- var count = this.writeBottomFan(iv, ii, sign, n, yc, st, ct, fd, fx, fy, gx, gy);
48598
+ var count = this.writeBottomFan(iv, ii, sign, n, yc, l0, st, ct, fd, fx, fy, gx, gy);
48592
48599
  iv += count;
48593
48600
  ii += 3 * (count - 2);
48594
48601
  }
48595
48602
  // Quads at the bottom: O', A', A, C and O', B', B, C
48596
48603
  for (var sign = -1; sign <= 1; sign += 2) {
48597
- var count = this.writeBottomQuad(iv, ii, sign, bx, by, yc, fs, st, ct, fd, fx, fy, gx, gy);
48604
+ var count = this.writeBottomQuad(iv, ii, sign, bx, by, yc, l0, fs, st, ct, fd, fx, fy, gx, gy);
48598
48605
  iv += count;
48599
48606
  ii += 3 * (count - 2);
48600
48607
  }
@@ -48605,19 +48612,19 @@
48605
48612
  * Returns the number of the written vertices.
48606
48613
  *
48607
48614
  * The clipping is 1 + fd * (n . p) where n is the outward unit normal of the straight side,
48608
- * and the length is the distance along the straight side measured from O.
48609
- * The side OA has n = (-ct, st) and l = (-st, -ct), and the side OB has n = (ct, st) and l = (st, -ct).
48615
+ * and the length is l0 + (-st, sign * ct) . p, which is the same as the one of writeSidePolygon
48616
+ * so that the dashes of the straight sides do not depend on the stroke side.
48610
48617
  */
48611
- EShapeFanTriangulatedImpl.prototype.writeBottomFan = function (iv, ii, sign, n, yc, st, ct, fd, fx, fy, gx, gy) {
48618
+ EShapeFanTriangulatedImpl.prototype.writeBottomFan = function (iv, ii, sign, n, yc, l0, st, ct, fd, fx, fy, gx, gy) {
48612
48619
  var px = EShapeFanTriangulatedImpl.WORK_ARC_X;
48613
48620
  var py = EShapeFanTriangulatedImpl.WORK_ARC_Y;
48614
48621
  var nx = sign * ct;
48615
- var lx = sign * st;
48622
+ var ly = sign * ct;
48616
48623
  var count = 0;
48617
- this.writeSideVertex(iv + count++, 0, -yc, 0, nx, st, 0, lx, -ct, fd, fx, fy, gx, gy);
48624
+ this.writeSideVertex(iv + count++, 0, -yc, 0, nx, st, l0, -st, ly, fd, fx, fy, gx, gy);
48618
48625
  for (var j = 0; j <= n; ++j) {
48619
48626
  var k = sign < 0 ? j : n + j;
48620
- this.writeSideVertex(iv + count++, px[k], py[k], 0, nx, st, 0, lx, -ct, fd, fx, fy, gx, gy);
48627
+ this.writeSideVertex(iv + count++, px[k], py[k], 0, nx, st, l0, -st, ly, fd, fx, fy, gx, gy);
48621
48628
  }
48622
48629
  this.writeFan(ii, iv, count);
48623
48630
  return count;
@@ -48627,13 +48634,13 @@
48627
48634
  * O' is shifted outward by fs / st, and A' (B') is shifted outward by fs perpendicular to the straight side.
48628
48635
  * Returns the number of the written vertices.
48629
48636
  */
48630
- EShapeFanTriangulatedImpl.prototype.writeBottomQuad = function (iv, ii, sign, bx, by, yc, fs, st, ct, fd, fx, fy, gx, gy) {
48637
+ EShapeFanTriangulatedImpl.prototype.writeBottomQuad = function (iv, ii, sign, bx, by, yc, l0, fs, st, ct, fd, fx, fy, gx, gy) {
48631
48638
  var nx = sign * ct;
48632
- var lx = sign * st;
48633
- this.writeSideVertex(iv, 0, fs / st, 0, nx, st, 0, lx, -ct, fd, fx, fy, gx, gy);
48634
- this.writeSideVertex(iv + 1, sign * (bx + fs * ct), -by + fs * st, 0, nx, st, 0, lx, -ct, fd, fx, fy, gx, gy);
48635
- this.writeSideVertex(iv + 2, sign * bx, -by, 0, nx, st, 0, lx, -ct, fd, fx, fy, gx, gy);
48636
- this.writeSideVertex(iv + 3, 0, -yc, 0, nx, st, 0, lx, -ct, fd, fx, fy, gx, gy);
48639
+ var ly = sign * ct;
48640
+ this.writeSideVertex(iv, 0, fs / st, 0, nx, st, l0, -st, ly, fd, fx, fy, gx, gy);
48641
+ this.writeSideVertex(iv + 1, sign * (bx + fs * ct), -by + fs * st, 0, nx, st, l0, -st, ly, fd, fx, fy, gx, gy);
48642
+ this.writeSideVertex(iv + 2, sign * bx, -by, 0, nx, st, l0, -st, ly, fd, fx, fy, gx, gy);
48643
+ this.writeSideVertex(iv + 3, 0, -yc, 0, nx, st, l0, -st, ly, fd, fx, fy, gx, gy);
48637
48644
  this.writeFan(ii, iv, 4);
48638
48645
  return 4;
48639
48646
  };
@@ -48789,16 +48796,16 @@
48789
48796
  var ct = Math.cos(ca);
48790
48797
  var fill = shape.fill;
48791
48798
  var strokeSide = shape.stroke.side;
48792
- var strokeSideTop = (strokeSide & EShapeStrokeSide.TOP) !== 0;
48799
+ var strokeSideArc = (strokeSide & EShapeStrokeSide.NOT_BOTTOM) !== 0;
48793
48800
  var strokeSideBottom = (strokeSide & EShapeStrokeSide.BOTTOM) !== 0;
48794
- var strokeWidth = strokeSideTop || strokeSideBottom ? sw : 0;
48801
+ var strokeWidth = strokeSideArc || strokeSideBottom ? sw : 0;
48795
48802
  if ((fill.enable || 0 < strokeWidth) && isInFan(x, y, ax, ay, st, ct, 0, 0)) {
48796
48803
  if (fill.enable && hitTestFanFill(shape, x, y, bx, ay)) {
48797
48804
  return true;
48798
48805
  }
48799
48806
  if (0 < strokeWidth) {
48800
48807
  var s = strokeWidth * ss;
48801
- var arc = strokeSideTop ? s : 0;
48808
+ var arc = strokeSideArc ? s : 0;
48802
48809
  var sides = strokeSideBottom ? s : 0;
48803
48810
  if (!isInFan(x, y, ax, ay, st, ct, arc, sides)) {
48804
48811
  return true;
@@ -48852,7 +48859,7 @@
48852
48859
  configurable: true
48853
48860
  });
48854
48861
  EShapeFan.prototype.toHitTestStrokeShift = function (strokeWidth, strokeScale, strokeAlign) {
48855
- if ((this.stroke.side & EShapeStrokeSide.TOP_OR_BOTTOM) !== 0) {
48862
+ if (this.stroke.side !== EShapeStrokeSide.NONE) {
48856
48863
  return _super.prototype.toHitTestStrokeShift.call(this, strokeWidth, strokeScale, strokeAlign);
48857
48864
  }
48858
48865
  return 0;
@@ -56804,7 +56811,7 @@
56804
56811
  configurable: true
56805
56812
  });
56806
56813
  EShapeSemicircle.prototype.toHitTestStrokeShift = function (strokeWidth, strokeScale, strokeAlign) {
56807
- if ((this.stroke.side & EShapeStrokeSide.TOP_OR_BOTTOM) !== 0) {
56814
+ if (this.stroke.side !== EShapeStrokeSide.NONE) {
56808
56815
  return _super.prototype.toHitTestStrokeShift.call(this, strokeWidth, strokeScale, strokeAlign);
56809
56816
  }
56810
56817
  return 0;