@wcardinal/wcardinal-ui 0.469.0-beta.3 → 0.470.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.
- package/dist/types/wcardinal/ui/shape/e-shape-type.d.ts +1 -1
- package/dist/types/wcardinal/ui/shape/load/index.d.ts +1 -1
- package/dist/types/wcardinal/ui/shape/load/load-shape-sector.d.ts +1 -0
- package/dist/types/wcardinal/ui/shape/variant/deserialize-sector.d.ts +4 -0
- package/dist/types/wcardinal/ui/shape/variant/{e-shape-fan-triangulated-impl.d.ts → e-shape-sector-triangulated-impl.d.ts} +9 -9
- package/dist/types/wcardinal/ui/shape/variant/{e-shape-fan-triangulated.d.ts → e-shape-sector-triangulated.d.ts} +1 -1
- package/dist/types/wcardinal/ui/shape/variant/{e-shape-fan.d.ts → e-shape-sector.d.ts} +7 -7
- package/dist/types/wcardinal/ui/shape/variant/e-shape-semicircle.d.ts +4 -4
- package/dist/types/wcardinal/ui/shape/variant/hit-test-sector.d.ts +2 -0
- package/dist/types/wcardinal/ui/shape/variant/index.d.ts +7 -7
- package/dist/types/wcardinal/ui/shape/variant/to-sector-angle-centric.d.ts +4 -0
- package/dist/types/wcardinal/ui/shape/variant/to-sector-angle-eccentric.d.ts +5 -0
- package/dist/wcardinal/ui/shape/e-shape-renderer.js +1 -1
- package/dist/wcardinal/ui/shape/e-shape-renderer.js.map +1 -1
- package/dist/wcardinal/ui/shape/e-shape-type.js +1 -1
- package/dist/wcardinal/ui/shape/e-shape-type.js.map +1 -1
- package/dist/wcardinal/ui/shape/load/index.js +1 -1
- package/dist/wcardinal/ui/shape/load/index.js.map +1 -1
- package/dist/wcardinal/ui/shape/load/load-shape-all.js +2 -2
- package/dist/wcardinal/ui/shape/load/load-shape-all.js.map +1 -1
- package/dist/wcardinal/ui/shape/load/{load-shape-fan.js → load-shape-sector.js} +6 -6
- package/dist/wcardinal/ui/shape/load/load-shape-sector.js.map +1 -0
- package/dist/wcardinal/ui/shape/variant/{deserialize-fan.js → deserialize-sector.js} +4 -4
- package/dist/wcardinal/ui/shape/variant/deserialize-sector.js.map +1 -0
- package/dist/wcardinal/ui/shape/variant/{e-shape-fan-triangulated-impl.js → e-shape-sector-triangulated-impl.js} +103 -103
- package/dist/wcardinal/ui/shape/variant/e-shape-sector-triangulated-impl.js.map +1 -0
- package/dist/wcardinal/ui/shape/variant/{e-shape-fan-triangulated.js → e-shape-sector-triangulated.js} +1 -1
- package/dist/wcardinal/ui/shape/variant/e-shape-sector-triangulated.js.map +1 -0
- package/dist/wcardinal/ui/shape/variant/{e-shape-fan.js → e-shape-sector.js} +23 -23
- package/dist/wcardinal/ui/shape/variant/e-shape-sector.js.map +1 -0
- package/dist/wcardinal/ui/shape/variant/e-shape-semicircle.js +4 -4
- package/dist/wcardinal/ui/shape/variant/e-shape-semicircle.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/{hit-test-fan.js → hit-test-sector.js} +13 -13
- package/dist/wcardinal/ui/shape/variant/hit-test-sector.js.map +1 -0
- package/dist/wcardinal/ui/shape/variant/index.js +7 -7
- package/dist/wcardinal/ui/shape/variant/index.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/to-sector-angle-centric.js +11 -0
- package/dist/wcardinal/ui/shape/variant/to-sector-angle-centric.js.map +1 -0
- package/dist/wcardinal/ui/shape/variant/to-sector-angle-eccentric.js +12 -0
- package/dist/wcardinal/ui/shape/variant/to-sector-angle-eccentric.js.map +1 -0
- package/dist/wcardinal-ui-theme-dark-en-us.js +1 -1
- package/dist/wcardinal-ui-theme-dark-en-us.min.js +1 -1
- package/dist/wcardinal-ui-theme-dark-ja-jp.js +1 -1
- package/dist/wcardinal-ui-theme-dark-ja-jp.min.js +1 -1
- package/dist/wcardinal-ui-theme-dark.js +1 -1
- package/dist/wcardinal-ui-theme-dark.min.js +1 -1
- package/dist/wcardinal-ui-theme-white-en-us.js +1 -1
- package/dist/wcardinal-ui-theme-white-en-us.min.js +1 -1
- package/dist/wcardinal-ui-theme-white-ja-jp.js +1 -1
- package/dist/wcardinal-ui-theme-white-ja-jp.min.js +1 -1
- package/dist/wcardinal-ui-theme-white.js +1 -1
- package/dist/wcardinal-ui-theme-white.min.js +1 -1
- package/dist/wcardinal-ui.cjs.js +152 -152
- package/dist/wcardinal-ui.js +152 -152
- package/dist/wcardinal-ui.min.js +2 -2
- package/dist/wcardinal-ui.min.js.map +1 -1
- package/package.json +1 -1
- package/dist/types/wcardinal/ui/shape/load/load-shape-fan.d.ts +0 -1
- package/dist/types/wcardinal/ui/shape/variant/deserialize-fan.d.ts +0 -4
- package/dist/types/wcardinal/ui/shape/variant/hit-test-fan.d.ts +0 -2
- package/dist/types/wcardinal/ui/shape/variant/to-fan-angle-centric.d.ts +0 -4
- package/dist/types/wcardinal/ui/shape/variant/to-fan-angle-eccentric.d.ts +0 -5
- package/dist/wcardinal/ui/shape/load/load-shape-fan.js.map +0 -1
- package/dist/wcardinal/ui/shape/variant/deserialize-fan.js.map +0 -1
- package/dist/wcardinal/ui/shape/variant/e-shape-fan-triangulated-impl.js.map +0 -1
- package/dist/wcardinal/ui/shape/variant/e-shape-fan-triangulated.js.map +0 -1
- package/dist/wcardinal/ui/shape/variant/e-shape-fan.js.map +0 -1
- package/dist/wcardinal/ui/shape/variant/hit-test-fan.js.map +0 -1
- package/dist/wcardinal/ui/shape/variant/to-fan-angle-centric.js +0 -11
- package/dist/wcardinal/ui/shape/variant/to-fan-angle-centric.js.map +0 -1
- package/dist/wcardinal/ui/shape/variant/to-fan-angle-eccentric.js +0 -12
- package/dist/wcardinal/ui/shape/variant/to-fan-angle-eccentric.js.map +0 -1
package/dist/wcardinal-ui.cjs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
Winter Cardinal UI v0.
|
|
2
|
+
Winter Cardinal UI v0.470.0
|
|
3
3
|
Copyright (C) 2019-2026 Toshiba Corporation
|
|
4
4
|
SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
|
|
@@ -62,7 +62,7 @@ var EShapeType = {
|
|
|
62
62
|
TRIANGLE_LEGACY: 29,
|
|
63
63
|
RECTANGLE_ROUNDED_LEGACY: 30,
|
|
64
64
|
TRIANGLE_ROUNDED_LEGACY: 31,
|
|
65
|
-
|
|
65
|
+
SECTOR: 32,
|
|
66
66
|
SEMICIRCLE_LEGACY: 33,
|
|
67
67
|
EXTENSION: 1000
|
|
68
68
|
};
|
|
@@ -16844,7 +16844,7 @@ var EShapeRendererIterator = /** @class */ (function () {
|
|
|
16844
16844
|
* SPDX-License-Identifier: Apache-2.0
|
|
16845
16845
|
*/
|
|
16846
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}";
|
|
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\
|
|
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\treturn texture * (\n\t\tvColorStroke * (s1 - s0) +\n\t\tvColorFill * (1.0 - max(s1, s0)) * 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}";
|
|
16848
16848
|
var EShapeRenderer = /** @class */ (function (_super) {
|
|
16849
16849
|
__extends(EShapeRenderer, _super);
|
|
16850
16850
|
function EShapeRenderer(renderer) {
|
|
@@ -70078,9 +70078,9 @@ var loadShapeEmbedded = function () {
|
|
|
70078
70078
|
* SPDX-License-Identifier: Apache-2.0
|
|
70079
70079
|
*/
|
|
70080
70080
|
/**
|
|
70081
|
-
* Converts an angle ratio to the half central angle of a
|
|
70081
|
+
* Converts an angle ratio to the half central angle of a sector in [0, PI / 2].
|
|
70082
70082
|
*/
|
|
70083
|
-
var
|
|
70083
|
+
var toSectorAngleCentric = function (angle) {
|
|
70084
70084
|
return Math.PI * Math.max(0, Math.min(0.5, angle));
|
|
70085
70085
|
};
|
|
70086
70086
|
|
|
@@ -70089,10 +70089,10 @@ var toFanAngleCentric = function (angle) {
|
|
|
70089
70089
|
* SPDX-License-Identifier: Apache-2.0
|
|
70090
70090
|
*/
|
|
70091
70091
|
/**
|
|
70092
|
-
* Converts the half central angle of
|
|
70093
|
-
* of the
|
|
70092
|
+
* Converts the half central angle of sectors to the eccentric angle of the arc end points
|
|
70093
|
+
* of the sector whose arc is on the ellipse with the semi-axes (w, h).
|
|
70094
70094
|
*/
|
|
70095
|
-
var
|
|
70095
|
+
var toSectorAngleEccentric = function (w, h, theta) {
|
|
70096
70096
|
return Math.atan((h / w) * Math.tan(theta));
|
|
70097
70097
|
};
|
|
70098
70098
|
|
|
@@ -70101,16 +70101,16 @@ var toFanAngleEccentric = function (w, h, theta) {
|
|
|
70101
70101
|
* SPDX-License-Identifier: Apache-2.0
|
|
70102
70102
|
*/
|
|
70103
70103
|
/**
|
|
70104
|
-
* Triangulates a
|
|
70104
|
+
* Triangulates a sector whose arc is on the ellipse with the semi-axes (w, h) centered at the origin O.
|
|
70105
70105
|
* The vertices are computed in the frame where w and h are positive and flipped at the end.
|
|
70106
70106
|
*
|
|
70107
70107
|
* ## Points
|
|
70108
70108
|
*
|
|
70109
|
-
* - O: the apex of the
|
|
70109
|
+
* - O: the apex of the sector, the origin
|
|
70110
70110
|
* - A, B: the end points of the arc, (-w sin(ea), -h cos(ea)) and (+w sin(ea), -h cos(ea))
|
|
70111
|
-
* - C: the point where the area of the
|
|
70111
|
+
* - C: the point where the area of the sector becomes zero when the sector shrinks, (0, -h / (1 + sin(ca)))
|
|
70112
70112
|
* - P[k]: the points on the arc, k in [0, 2N] (P[0] = A, P[N] is the top, P[2N] = B)
|
|
70113
|
-
* - Q[k]: the points on the medial axis of the
|
|
70113
|
+
* - Q[k]: the points on the medial axis of the sector, which are on the normal of the arc at P[k]
|
|
70114
70114
|
* and equidistant from the arc and the straight sides (Q[0] = A, Q[N] = C, Q[2N] = B)
|
|
70115
70115
|
* - R[k]: the points P[k] shifted outward for the anti-aliasing
|
|
70116
70116
|
* - O': the point O shifted outward for the anti-aliasing
|
|
@@ -70123,18 +70123,18 @@ var toFanAngleEccentric = function (w, h, theta) {
|
|
|
70123
70123
|
* where the outline is the arc and/or the straight sides depending on the stroke side.
|
|
70124
70124
|
*
|
|
70125
70125
|
* - ARC and BOTTOM (and NONE): the stroke is at the arc and the straight sides.
|
|
70126
|
-
* The
|
|
70126
|
+
* The sector is triangulated into the strip P[k], P[k + 1], Q[k + 1], Q[k] and
|
|
70127
70127
|
* the two polygons O', A', Q[0], ..., Q[N] and O', B', Q[2N], ..., Q[N] at the bottom.
|
|
70128
70128
|
* - ARC: the stroke is only at the arc.
|
|
70129
|
-
* For a circle and a semi-ellipse, Q[k] are the points on the axis, which gives the exact
|
|
70129
|
+
* For a circle and a semi-ellipse, Q[k] are the points on the axis, which gives the exact sector with the strip only.
|
|
70130
70130
|
* For the other ellipses, Q[k] are on the medial axis as ARC and BOTTOM, and the two polygons
|
|
70131
70131
|
* O, Q[0], ..., Q[N] and O, Q[2N], ..., Q[N] are added at the bottom without the stroke and the anti-aliasing.
|
|
70132
70132
|
* - BOTTOM: the stroke is only at the straight sides.
|
|
70133
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,
|
|
70134
70134
|
* and two quads O', A', A, C and O', B', B, C cover the rest.
|
|
70135
70135
|
*/
|
|
70136
|
-
var
|
|
70137
|
-
function
|
|
70136
|
+
var EShapeSectorTriangulatedImpl = /** @class */ (function () {
|
|
70137
|
+
function EShapeSectorTriangulatedImpl(parent) {
|
|
70138
70138
|
this._id = 0;
|
|
70139
70139
|
this._parent = parent;
|
|
70140
70140
|
this._width = 0;
|
|
@@ -70156,7 +70156,7 @@ var EShapeFanTriangulatedImpl = /** @class */ (function () {
|
|
|
70156
70156
|
this._nindices = 0;
|
|
70157
70157
|
this._boundary = [0, 0, 0, 0];
|
|
70158
70158
|
}
|
|
70159
|
-
Object.defineProperty(
|
|
70159
|
+
Object.defineProperty(EShapeSectorTriangulatedImpl.prototype, "id", {
|
|
70160
70160
|
get: function () {
|
|
70161
70161
|
this.triangulate();
|
|
70162
70162
|
return this._id;
|
|
@@ -70164,7 +70164,7 @@ var EShapeFanTriangulatedImpl = /** @class */ (function () {
|
|
|
70164
70164
|
enumerable: false,
|
|
70165
70165
|
configurable: true
|
|
70166
70166
|
});
|
|
70167
|
-
Object.defineProperty(
|
|
70167
|
+
Object.defineProperty(EShapeSectorTriangulatedImpl.prototype, "vertices", {
|
|
70168
70168
|
get: function () {
|
|
70169
70169
|
this.triangulate();
|
|
70170
70170
|
return this._vertices;
|
|
@@ -70172,7 +70172,7 @@ var EShapeFanTriangulatedImpl = /** @class */ (function () {
|
|
|
70172
70172
|
enumerable: false,
|
|
70173
70173
|
configurable: true
|
|
70174
70174
|
});
|
|
70175
|
-
Object.defineProperty(
|
|
70175
|
+
Object.defineProperty(EShapeSectorTriangulatedImpl.prototype, "nvertices", {
|
|
70176
70176
|
get: function () {
|
|
70177
70177
|
this.triangulate();
|
|
70178
70178
|
return this._nvertices;
|
|
@@ -70180,7 +70180,7 @@ var EShapeFanTriangulatedImpl = /** @class */ (function () {
|
|
|
70180
70180
|
enumerable: false,
|
|
70181
70181
|
configurable: true
|
|
70182
70182
|
});
|
|
70183
|
-
Object.defineProperty(
|
|
70183
|
+
Object.defineProperty(EShapeSectorTriangulatedImpl.prototype, "distances", {
|
|
70184
70184
|
get: function () {
|
|
70185
70185
|
this.triangulate();
|
|
70186
70186
|
return this._distances;
|
|
@@ -70188,7 +70188,7 @@ var EShapeFanTriangulatedImpl = /** @class */ (function () {
|
|
|
70188
70188
|
enumerable: false,
|
|
70189
70189
|
configurable: true
|
|
70190
70190
|
});
|
|
70191
|
-
Object.defineProperty(
|
|
70191
|
+
Object.defineProperty(EShapeSectorTriangulatedImpl.prototype, "lengths", {
|
|
70192
70192
|
get: function () {
|
|
70193
70193
|
this.triangulate();
|
|
70194
70194
|
return this._lengths;
|
|
@@ -70196,7 +70196,7 @@ var EShapeFanTriangulatedImpl = /** @class */ (function () {
|
|
|
70196
70196
|
enumerable: false,
|
|
70197
70197
|
configurable: true
|
|
70198
70198
|
});
|
|
70199
|
-
Object.defineProperty(
|
|
70199
|
+
Object.defineProperty(EShapeSectorTriangulatedImpl.prototype, "clippings", {
|
|
70200
70200
|
get: function () {
|
|
70201
70201
|
this.triangulate();
|
|
70202
70202
|
return this._clippings;
|
|
@@ -70204,7 +70204,7 @@ var EShapeFanTriangulatedImpl = /** @class */ (function () {
|
|
|
70204
70204
|
enumerable: false,
|
|
70205
70205
|
configurable: true
|
|
70206
70206
|
});
|
|
70207
|
-
Object.defineProperty(
|
|
70207
|
+
Object.defineProperty(EShapeSectorTriangulatedImpl.prototype, "uvs", {
|
|
70208
70208
|
get: function () {
|
|
70209
70209
|
this.triangulate();
|
|
70210
70210
|
return this._uvs;
|
|
@@ -70212,7 +70212,7 @@ var EShapeFanTriangulatedImpl = /** @class */ (function () {
|
|
|
70212
70212
|
enumerable: false,
|
|
70213
70213
|
configurable: true
|
|
70214
70214
|
});
|
|
70215
|
-
Object.defineProperty(
|
|
70215
|
+
Object.defineProperty(EShapeSectorTriangulatedImpl.prototype, "indices", {
|
|
70216
70216
|
get: function () {
|
|
70217
70217
|
this.triangulate();
|
|
70218
70218
|
return this._indices;
|
|
@@ -70220,7 +70220,7 @@ var EShapeFanTriangulatedImpl = /** @class */ (function () {
|
|
|
70220
70220
|
enumerable: false,
|
|
70221
70221
|
configurable: true
|
|
70222
70222
|
});
|
|
70223
|
-
Object.defineProperty(
|
|
70223
|
+
Object.defineProperty(EShapeSectorTriangulatedImpl.prototype, "nindices", {
|
|
70224
70224
|
get: function () {
|
|
70225
70225
|
this.triangulate();
|
|
70226
70226
|
return this._nindices;
|
|
@@ -70228,7 +70228,7 @@ var EShapeFanTriangulatedImpl = /** @class */ (function () {
|
|
|
70228
70228
|
enumerable: false,
|
|
70229
70229
|
configurable: true
|
|
70230
70230
|
});
|
|
70231
|
-
Object.defineProperty(
|
|
70231
|
+
Object.defineProperty(EShapeSectorTriangulatedImpl.prototype, "boundary", {
|
|
70232
70232
|
get: function () {
|
|
70233
70233
|
this.triangulate();
|
|
70234
70234
|
return this._boundary;
|
|
@@ -70236,7 +70236,7 @@ var EShapeFanTriangulatedImpl = /** @class */ (function () {
|
|
|
70236
70236
|
enumerable: false,
|
|
70237
70237
|
configurable: true
|
|
70238
70238
|
});
|
|
70239
|
-
|
|
70239
|
+
EShapeSectorTriangulatedImpl.prototype.triangulate = function () {
|
|
70240
70240
|
var isNotInitialized = this._id === 0;
|
|
70241
70241
|
var parent = this._parent;
|
|
70242
70242
|
var size = parent.size;
|
|
@@ -70274,7 +70274,7 @@ var EShapeFanTriangulatedImpl = /** @class */ (function () {
|
|
|
70274
70274
|
this.update(sizeX, sizeY, angle, strokeSideArc, strokeSideBottom);
|
|
70275
70275
|
}
|
|
70276
70276
|
};
|
|
70277
|
-
|
|
70277
|
+
EShapeSectorTriangulatedImpl.prototype.update = function (sx, sy, angle, ssa, ssb) {
|
|
70278
70278
|
// The number of the arc segments is 2n and the number of the points on the arc is m.
|
|
70279
70279
|
var n = EShapeDefaults.CIRCLE_SEGMENT_COUNT >> 2;
|
|
70280
70280
|
var m = 2 * n + 1;
|
|
@@ -70290,8 +70290,8 @@ var EShapeFanTriangulatedImpl = /** @class */ (function () {
|
|
|
70290
70290
|
this.updateEmpty(ax, ay, nv, ni);
|
|
70291
70291
|
return;
|
|
70292
70292
|
}
|
|
70293
|
-
var ca =
|
|
70294
|
-
var ea =
|
|
70293
|
+
var ca = toSectorAngleCentric(angle);
|
|
70294
|
+
var ea = toSectorAngleEccentric(ax, ay, ca);
|
|
70295
70295
|
var sea = Math.sin(ea);
|
|
70296
70296
|
var cea = Math.cos(ea);
|
|
70297
70297
|
var bx = ax * sea;
|
|
@@ -70318,9 +70318,9 @@ var EShapeFanTriangulatedImpl = /** @class */ (function () {
|
|
|
70318
70318
|
}
|
|
70319
70319
|
};
|
|
70320
70320
|
/**
|
|
70321
|
-
* Fills the empty
|
|
70321
|
+
* Fills the empty sector, which has no vertices to draw.
|
|
70322
70322
|
*/
|
|
70323
|
-
|
|
70323
|
+
EShapeSectorTriangulatedImpl.prototype.updateEmpty = function (w, h, nv, ni) {
|
|
70324
70324
|
var boundary = this._boundary;
|
|
70325
70325
|
boundary[0] = -w;
|
|
70326
70326
|
boundary[1] = -h;
|
|
@@ -70328,12 +70328,12 @@ var EShapeFanTriangulatedImpl = /** @class */ (function () {
|
|
|
70328
70328
|
boundary[3] = +h;
|
|
70329
70329
|
this.pad(0, 0, nv, ni, 0);
|
|
70330
70330
|
};
|
|
70331
|
-
|
|
70331
|
+
EShapeSectorTriangulatedImpl.prototype.updateArc = function (w, h, n, ea, sea, cea, bx, oa, st, ct, fx, fy, gx, gy, ssa, ssb, nv, ni) {
|
|
70332
70332
|
var m = 2 * n + 1;
|
|
70333
70333
|
// sided: the straight sides are the outline, which has the stroke and the anti-aliasing
|
|
70334
70334
|
// capped: the polygons are added at the bottom to cover the sector with the hard straight sides
|
|
70335
70335
|
// chained: Q is on the medial axis. Otherwise, Q is on the axis x = 0 (w <= h) or y = 0 (h < w)
|
|
70336
|
-
// For a circle and a semi-ellipse, Q on the axis gives the exact
|
|
70336
|
+
// For a circle and a semi-ellipse, Q on the axis gives the exact sector.
|
|
70337
70337
|
var sided = !ssa || ssb;
|
|
70338
70338
|
var isExact = Math.abs(w - h) <= 1e-9 * w || Math.PI * 0.5 <= ea;
|
|
70339
70339
|
var capped = !sided && !isExact;
|
|
@@ -70356,7 +70356,7 @@ var EShapeFanTriangulatedImpl = /** @class */ (function () {
|
|
|
70356
70356
|
boundary[2] = +bx;
|
|
70357
70357
|
boundary[3] = 0;
|
|
70358
70358
|
var fd = 1 / dmax;
|
|
70359
|
-
var fs = (
|
|
70359
|
+
var fs = (EShapeSectorTriangulatedImpl.SCALE - 1) * dmax;
|
|
70360
70360
|
this.computeRimPoints(n, fs, st, ct, sided);
|
|
70361
70361
|
// Strip: 4 * (m - 1) vertices and 2 * 3 * (m - 1) indices
|
|
70362
70362
|
this.writeStrip(m, fd, fx, fy, gx, gy);
|
|
@@ -70387,10 +70387,10 @@ var EShapeFanTriangulatedImpl = /** @class */ (function () {
|
|
|
70387
70387
|
* The points are symmetric with respect to the axis x = 0, so only the left half is computed
|
|
70388
70388
|
* and the right half is mirrored from it.
|
|
70389
70389
|
*/
|
|
70390
|
-
|
|
70390
|
+
EShapeSectorTriangulatedImpl.prototype.computeArcPoints = function (w, h, n, ea, sea, cea) {
|
|
70391
70391
|
var m = 2 * n + 1;
|
|
70392
|
-
var px =
|
|
70393
|
-
var py =
|
|
70392
|
+
var px = EShapeSectorTriangulatedImpl.WORK_ARC_X;
|
|
70393
|
+
var py = EShapeSectorTriangulatedImpl.WORK_ARC_Y;
|
|
70394
70394
|
var da = ea / n;
|
|
70395
70395
|
var cda = Math.cos(da);
|
|
70396
70396
|
var sda = Math.sin(da);
|
|
@@ -70420,14 +70420,14 @@ var EShapeFanTriangulatedImpl = /** @class */ (function () {
|
|
|
70420
70420
|
* The normal at P is Np = (-h x / w, -w y / h), whose magnitude is the speed of the arc.
|
|
70421
70421
|
* The lengths are the ones of the polyline, which is the actual outline, so that they are exact at clipping = 1.
|
|
70422
70422
|
*/
|
|
70423
|
-
|
|
70423
|
+
EShapeSectorTriangulatedImpl.prototype.computeArcNormals = function (w, h, n) {
|
|
70424
70424
|
var m = 2 * n + 1;
|
|
70425
|
-
var px =
|
|
70426
|
-
var py =
|
|
70427
|
-
var nx =
|
|
70428
|
-
var ny =
|
|
70429
|
-
var speeds =
|
|
70430
|
-
var ls =
|
|
70425
|
+
var px = EShapeSectorTriangulatedImpl.WORK_ARC_X;
|
|
70426
|
+
var py = EShapeSectorTriangulatedImpl.WORK_ARC_Y;
|
|
70427
|
+
var nx = EShapeSectorTriangulatedImpl.WORK_NORMAL_X;
|
|
70428
|
+
var ny = EShapeSectorTriangulatedImpl.WORK_NORMAL_Y;
|
|
70429
|
+
var speeds = EShapeSectorTriangulatedImpl.WORK_SPEED;
|
|
70430
|
+
var ls = EShapeSectorTriangulatedImpl.WORK_ARC_L;
|
|
70431
70431
|
var hw = h / w;
|
|
70432
70432
|
var wh = w / h;
|
|
70433
70433
|
var l = 0;
|
|
@@ -70464,16 +70464,16 @@ var EShapeFanTriangulatedImpl = /** @class */ (function () {
|
|
|
70464
70464
|
*
|
|
70465
70465
|
* Otherwise, the normal is extended until it reaches x = 0 if w <= h, otherwise y = 0.
|
|
70466
70466
|
*/
|
|
70467
|
-
|
|
70467
|
+
EShapeSectorTriangulatedImpl.prototype.computeMedialPoints = function (w, h, n, st, ct, chained) {
|
|
70468
70468
|
var m = 2 * n + 1;
|
|
70469
|
-
var px =
|
|
70470
|
-
var py =
|
|
70471
|
-
var nx =
|
|
70472
|
-
var ny =
|
|
70473
|
-
var speeds =
|
|
70474
|
-
var qx =
|
|
70475
|
-
var qy =
|
|
70476
|
-
var qd =
|
|
70469
|
+
var px = EShapeSectorTriangulatedImpl.WORK_ARC_X;
|
|
70470
|
+
var py = EShapeSectorTriangulatedImpl.WORK_ARC_Y;
|
|
70471
|
+
var nx = EShapeSectorTriangulatedImpl.WORK_NORMAL_X;
|
|
70472
|
+
var ny = EShapeSectorTriangulatedImpl.WORK_NORMAL_Y;
|
|
70473
|
+
var speeds = EShapeSectorTriangulatedImpl.WORK_SPEED;
|
|
70474
|
+
var qx = EShapeSectorTriangulatedImpl.WORK_MEDIAL_X;
|
|
70475
|
+
var qy = EShapeSectorTriangulatedImpl.WORK_MEDIAL_Y;
|
|
70476
|
+
var qd = EShapeSectorTriangulatedImpl.WORK_MEDIAL_D;
|
|
70477
70477
|
var u = w <= h ? w / h : h / w;
|
|
70478
70478
|
var dmax = 0;
|
|
70479
70479
|
for (var k = 0; k <= n; ++k) {
|
|
@@ -70523,14 +70523,14 @@ var EShapeFanTriangulatedImpl = /** @class */ (function () {
|
|
|
70523
70523
|
* If the straight sides are the outline, the end points are shifted
|
|
70524
70524
|
* to the intersections of the shifted arc and the shifted straight sides.
|
|
70525
70525
|
*/
|
|
70526
|
-
|
|
70526
|
+
EShapeSectorTriangulatedImpl.prototype.computeRimPoints = function (n, fs, st, ct, sided) {
|
|
70527
70527
|
var m = 2 * n + 1;
|
|
70528
|
-
var px =
|
|
70529
|
-
var py =
|
|
70530
|
-
var nx =
|
|
70531
|
-
var ny =
|
|
70532
|
-
var rx =
|
|
70533
|
-
var ry =
|
|
70528
|
+
var px = EShapeSectorTriangulatedImpl.WORK_ARC_X;
|
|
70529
|
+
var py = EShapeSectorTriangulatedImpl.WORK_ARC_Y;
|
|
70530
|
+
var nx = EShapeSectorTriangulatedImpl.WORK_NORMAL_X;
|
|
70531
|
+
var ny = EShapeSectorTriangulatedImpl.WORK_NORMAL_Y;
|
|
70532
|
+
var rx = EShapeSectorTriangulatedImpl.WORK_RIM_X;
|
|
70533
|
+
var ry = EShapeSectorTriangulatedImpl.WORK_RIM_Y;
|
|
70534
70534
|
for (var k = 0; k < m; ++k) {
|
|
70535
70535
|
var x = px[k] - fs * nx[k];
|
|
70536
70536
|
var y = py[k] - fs * ny[k];
|
|
@@ -70555,16 +70555,16 @@ var EShapeFanTriangulatedImpl = /** @class */ (function () {
|
|
|
70555
70555
|
* Each quad owns its vertices. The length in a quad is the length at P[k] plus the projection
|
|
70556
70556
|
* to the chord P[k]P[k + 1], which is exact at clipping = 1 where the chord is the outline.
|
|
70557
70557
|
*/
|
|
70558
|
-
|
|
70559
|
-
var px =
|
|
70560
|
-
var py =
|
|
70561
|
-
var qx =
|
|
70562
|
-
var qy =
|
|
70563
|
-
var qd =
|
|
70564
|
-
var ls =
|
|
70565
|
-
var rx =
|
|
70566
|
-
var ry =
|
|
70567
|
-
var scale =
|
|
70558
|
+
EShapeSectorTriangulatedImpl.prototype.writeStrip = function (m, fd, fx, fy, gx, gy) {
|
|
70559
|
+
var px = EShapeSectorTriangulatedImpl.WORK_ARC_X;
|
|
70560
|
+
var py = EShapeSectorTriangulatedImpl.WORK_ARC_Y;
|
|
70561
|
+
var qx = EShapeSectorTriangulatedImpl.WORK_MEDIAL_X;
|
|
70562
|
+
var qy = EShapeSectorTriangulatedImpl.WORK_MEDIAL_Y;
|
|
70563
|
+
var qd = EShapeSectorTriangulatedImpl.WORK_MEDIAL_D;
|
|
70564
|
+
var ls = EShapeSectorTriangulatedImpl.WORK_ARC_L;
|
|
70565
|
+
var rx = EShapeSectorTriangulatedImpl.WORK_RIM_X;
|
|
70566
|
+
var ry = EShapeSectorTriangulatedImpl.WORK_RIM_Y;
|
|
70567
|
+
var scale = EShapeSectorTriangulatedImpl.SCALE;
|
|
70568
70568
|
var indices = this._indices;
|
|
70569
70569
|
var iv = 0;
|
|
70570
70570
|
var ii = 0;
|
|
@@ -70615,14 +70615,14 @@ var EShapeFanTriangulatedImpl = /** @class */ (function () {
|
|
|
70615
70615
|
* The clipping and the length are computed from the straight side:
|
|
70616
70616
|
* the outward unit normal is (sign * ct, st) and the length is oa + arc + (-st, sign * ct) . p.
|
|
70617
70617
|
*/
|
|
70618
|
-
|
|
70618
|
+
EShapeSectorTriangulatedImpl.prototype.writeSidePolygon = function (iv, ii, sign, n, w, oa, st, ct, fs, fd, fx, fy, gx, gy) {
|
|
70619
70619
|
var m = 2 * n + 1;
|
|
70620
|
-
var qx =
|
|
70621
|
-
var qy =
|
|
70622
|
-
var qd =
|
|
70623
|
-
var rx =
|
|
70624
|
-
var ry =
|
|
70625
|
-
var l0 = oa +
|
|
70620
|
+
var qx = EShapeSectorTriangulatedImpl.WORK_MEDIAL_X;
|
|
70621
|
+
var qy = EShapeSectorTriangulatedImpl.WORK_MEDIAL_Y;
|
|
70622
|
+
var qd = EShapeSectorTriangulatedImpl.WORK_MEDIAL_D;
|
|
70623
|
+
var rx = EShapeSectorTriangulatedImpl.WORK_RIM_X;
|
|
70624
|
+
var ry = EShapeSectorTriangulatedImpl.WORK_RIM_Y;
|
|
70625
|
+
var l0 = oa + EShapeSectorTriangulatedImpl.WORK_ARC_L[m - 1];
|
|
70626
70626
|
var nx = sign * ct;
|
|
70627
70627
|
var ly = sign * ct;
|
|
70628
70628
|
var eps = 1e-9 * w;
|
|
@@ -70663,12 +70663,12 @@ var EShapeFanTriangulatedImpl = /** @class */ (function () {
|
|
|
70663
70663
|
*
|
|
70664
70664
|
* The clipping of O is given by co, and the length of O is the one of the end point.
|
|
70665
70665
|
*/
|
|
70666
|
-
|
|
70666
|
+
EShapeSectorTriangulatedImpl.prototype.writeCapPolygon = function (iv, ii, sign, n, w, co, fd, fx, fy, gx, gy) {
|
|
70667
70667
|
var m = 2 * n + 1;
|
|
70668
|
-
var qx =
|
|
70669
|
-
var qy =
|
|
70670
|
-
var qd =
|
|
70671
|
-
var ls =
|
|
70668
|
+
var qx = EShapeSectorTriangulatedImpl.WORK_MEDIAL_X;
|
|
70669
|
+
var qy = EShapeSectorTriangulatedImpl.WORK_MEDIAL_Y;
|
|
70670
|
+
var qd = EShapeSectorTriangulatedImpl.WORK_MEDIAL_D;
|
|
70671
|
+
var ls = EShapeSectorTriangulatedImpl.WORK_ARC_L;
|
|
70672
70672
|
var eps = 1e-9 * w;
|
|
70673
70673
|
var end = sign < 0 ? 0 : m - 1;
|
|
70674
70674
|
this.writeVertex(iv, 0, 0, ls[end], co, fd, fx, fy, gx, gy);
|
|
@@ -70687,7 +70687,7 @@ var EShapeFanTriangulatedImpl = /** @class */ (function () {
|
|
|
70687
70687
|
/**
|
|
70688
70688
|
* The clipping is 1 - (the distance from the straight side) / d where d is the distance from C to OA (or OB).
|
|
70689
70689
|
*/
|
|
70690
|
-
|
|
70690
|
+
EShapeSectorTriangulatedImpl.prototype.updateBottom = function (w, h, n, ea, sea, cea, bx, by, st, ct, fx, fy, gx, gy, nv, ni) {
|
|
70691
70691
|
var boundary = this._boundary;
|
|
70692
70692
|
boundary[0] = -bx;
|
|
70693
70693
|
boundary[1] = -h;
|
|
@@ -70695,11 +70695,11 @@ var EShapeFanTriangulatedImpl = /** @class */ (function () {
|
|
|
70695
70695
|
boundary[3] = 0;
|
|
70696
70696
|
var yc = h / (1 + st);
|
|
70697
70697
|
var fd = (1 + st) / (h * st);
|
|
70698
|
-
var fs = (
|
|
70698
|
+
var fs = (EShapeSectorTriangulatedImpl.SCALE - 1) / fd;
|
|
70699
70699
|
this.computeArcPoints(w, h, n, ea, sea, cea);
|
|
70700
70700
|
this.computeArcNormals(w, h, n);
|
|
70701
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) +
|
|
70702
|
+
var l0 = Math.sqrt(bx * bx + by * by) + EShapeSectorTriangulatedImpl.WORK_ARC_L[2 * n];
|
|
70703
70703
|
// Triangle fans from C to the arc: left (sign = -1) and right (sign = +1)
|
|
70704
70704
|
var iv = 0;
|
|
70705
70705
|
var ii = 0;
|
|
@@ -70724,9 +70724,9 @@ var EShapeFanTriangulatedImpl = /** @class */ (function () {
|
|
|
70724
70724
|
* and the length is l0 + (-st, sign * ct) . p, which is the same as the one of writeSidePolygon
|
|
70725
70725
|
* so that the dashes of the straight sides do not depend on the stroke side.
|
|
70726
70726
|
*/
|
|
70727
|
-
|
|
70728
|
-
var px =
|
|
70729
|
-
var py =
|
|
70727
|
+
EShapeSectorTriangulatedImpl.prototype.writeBottomFan = function (iv, ii, sign, n, yc, l0, st, ct, fd, fx, fy, gx, gy) {
|
|
70728
|
+
var px = EShapeSectorTriangulatedImpl.WORK_ARC_X;
|
|
70729
|
+
var py = EShapeSectorTriangulatedImpl.WORK_ARC_Y;
|
|
70730
70730
|
var nx = sign * ct;
|
|
70731
70731
|
var ly = sign * ct;
|
|
70732
70732
|
var count = 0;
|
|
@@ -70743,7 +70743,7 @@ var EShapeFanTriangulatedImpl = /** @class */ (function () {
|
|
|
70743
70743
|
* O' is shifted outward by fs / st, and A' (B') is shifted outward by fs perpendicular to the straight side.
|
|
70744
70744
|
* Returns the number of the written vertices.
|
|
70745
70745
|
*/
|
|
70746
|
-
|
|
70746
|
+
EShapeSectorTriangulatedImpl.prototype.writeBottomQuad = function (iv, ii, sign, bx, by, yc, l0, fs, st, ct, fd, fx, fy, gx, gy) {
|
|
70747
70747
|
var nx = sign * ct;
|
|
70748
70748
|
var ly = sign * ct;
|
|
70749
70749
|
this.writeSideVertex(iv, 0, fs / st, 0, nx, st, l0, -st, ly, fd, fx, fy, gx, gy);
|
|
@@ -70761,7 +70761,7 @@ var EShapeFanTriangulatedImpl = /** @class */ (function () {
|
|
|
70761
70761
|
* The clipping is 1 + fd * (nx * x + ny * y), which is not less than the given floor,
|
|
70762
70762
|
* and the length is l0 + lx * x + ly * y.
|
|
70763
70763
|
*/
|
|
70764
|
-
|
|
70764
|
+
EShapeSectorTriangulatedImpl.prototype.writeSideVertex = function (vertex, x, y, floor, nx, ny, l0, lx, ly, fd, fx, fy, gx, gy) {
|
|
70765
70765
|
var clipping = Math.max(floor, 1 + fd * (nx * x + ny * y));
|
|
70766
70766
|
var length = l0 + lx * x + ly * y;
|
|
70767
70767
|
this.writeVertex(vertex, x, y, length, clipping, fd, fx, fy, gx, gy);
|
|
@@ -70770,7 +70770,7 @@ var EShapeFanTriangulatedImpl = /** @class */ (function () {
|
|
|
70770
70770
|
* Writes the indices of a triangle fan from the first vertex.
|
|
70771
70771
|
* The number of the written indices is 3 * (count - 2).
|
|
70772
70772
|
*/
|
|
70773
|
-
|
|
70773
|
+
EShapeSectorTriangulatedImpl.prototype.writeFan = function (ii, iv, count) {
|
|
70774
70774
|
var indices = this._indices;
|
|
70775
70775
|
for (var i = 1; i < count - 1; ++i) {
|
|
70776
70776
|
indices[ii++] = iv;
|
|
@@ -70789,7 +70789,7 @@ var EShapeFanTriangulatedImpl = /** @class */ (function () {
|
|
|
70789
70789
|
* @param gx - The sign of the X size, which flips the vertex
|
|
70790
70790
|
* @param gy - The sign of the Y size, which flips the vertex
|
|
70791
70791
|
*/
|
|
70792
|
-
|
|
70792
|
+
EShapeSectorTriangulatedImpl.prototype.writeVertex = function (vertex, x, y, length, clipping, fd, fx, fy, gx, gy) {
|
|
70793
70793
|
var vertex2 = vertex << 1;
|
|
70794
70794
|
this._vertices[vertex2] = gx * x;
|
|
70795
70795
|
this._vertices[vertex2 + 1] = gy * y;
|
|
@@ -70803,7 +70803,7 @@ var EShapeFanTriangulatedImpl = /** @class */ (function () {
|
|
|
70803
70803
|
* Fills the unused tail with degenerated triangles and trims the arrays
|
|
70804
70804
|
* so that the buffers always hold exactly `nv` vertices and `ni` triangles.
|
|
70805
70805
|
*/
|
|
70806
|
-
|
|
70806
|
+
EShapeSectorTriangulatedImpl.prototype.pad = function (iv, ii, nv, ni, distance) {
|
|
70807
70807
|
for (var i = iv; i < nv; ++i) {
|
|
70808
70808
|
var vertex2 = i << 1;
|
|
70809
70809
|
this._vertices[vertex2] = 0;
|
|
@@ -70825,28 +70825,28 @@ var EShapeFanTriangulatedImpl = /** @class */ (function () {
|
|
|
70825
70825
|
this._indices.length = ni * 3;
|
|
70826
70826
|
};
|
|
70827
70827
|
/** The ratio of the outer edge, where the clipping is 1, to the edge of the anti-aliasing */
|
|
70828
|
-
|
|
70828
|
+
EShapeSectorTriangulatedImpl.SCALE = 1.1;
|
|
70829
70829
|
// Work arrays shared by all the instances because they are used only in a single synchronous triangulation.
|
|
70830
70830
|
// All of them are indexed by k, which is in [0, 2N].
|
|
70831
70831
|
/** P: the points on the arc */
|
|
70832
|
-
|
|
70833
|
-
|
|
70832
|
+
EShapeSectorTriangulatedImpl.WORK_ARC_X = [];
|
|
70833
|
+
EShapeSectorTriangulatedImpl.WORK_ARC_Y = [];
|
|
70834
70834
|
/** The lengths of the polyline P[0], ..., P[k] */
|
|
70835
|
-
|
|
70835
|
+
EShapeSectorTriangulatedImpl.WORK_ARC_L = [];
|
|
70836
70836
|
/** The unit inward normals of the arc */
|
|
70837
|
-
|
|
70838
|
-
|
|
70837
|
+
EShapeSectorTriangulatedImpl.WORK_NORMAL_X = [];
|
|
70838
|
+
EShapeSectorTriangulatedImpl.WORK_NORMAL_Y = [];
|
|
70839
70839
|
/** The magnitudes of the tangents, that is, the speeds of the arc */
|
|
70840
|
-
|
|
70840
|
+
EShapeSectorTriangulatedImpl.WORK_SPEED = [];
|
|
70841
70841
|
/** Q: the points on the normals */
|
|
70842
|
-
|
|
70843
|
-
|
|
70842
|
+
EShapeSectorTriangulatedImpl.WORK_MEDIAL_X = [];
|
|
70843
|
+
EShapeSectorTriangulatedImpl.WORK_MEDIAL_Y = [];
|
|
70844
70844
|
/** The distances from P to Q */
|
|
70845
|
-
|
|
70845
|
+
EShapeSectorTriangulatedImpl.WORK_MEDIAL_D = [];
|
|
70846
70846
|
/** R: the points on the arc shifted outward */
|
|
70847
|
-
|
|
70848
|
-
|
|
70849
|
-
return
|
|
70847
|
+
EShapeSectorTriangulatedImpl.WORK_RIM_X = [];
|
|
70848
|
+
EShapeSectorTriangulatedImpl.WORK_RIM_Y = [];
|
|
70849
|
+
return EShapeSectorTriangulatedImpl;
|
|
70850
70850
|
}());
|
|
70851
70851
|
|
|
70852
70852
|
/*
|
|
@@ -70854,12 +70854,12 @@ var EShapeFanTriangulatedImpl = /** @class */ (function () {
|
|
|
70854
70854
|
* SPDX-License-Identifier: Apache-2.0
|
|
70855
70855
|
*/
|
|
70856
70856
|
/**
|
|
70857
|
-
* Tests whether the point is in the
|
|
70857
|
+
* Tests whether the point is in the sector shrunk by `sa` at the arc and by `ss` at the straight sides.
|
|
70858
70858
|
*
|
|
70859
70859
|
* @param st - The sine of the half central angle
|
|
70860
70860
|
* @param ct - The cosine of the half central angle
|
|
70861
70861
|
*/
|
|
70862
|
-
var
|
|
70862
|
+
var isInSector = function (x, y, ax, ay, st, ct, sa, ss) {
|
|
70863
70863
|
var wx = ax - sa;
|
|
70864
70864
|
var wy = ay - sa;
|
|
70865
70865
|
if (wx <= 0 || wy <= 0) {
|
|
@@ -70873,14 +70873,14 @@ var isInFan = function (x, y, ax, ay, st, ct, sa, ss) {
|
|
|
70873
70873
|
var ay1 = st * y;
|
|
70874
70874
|
return -ct * x + ay1 <= -ss && ct * x + ay1 <= -ss;
|
|
70875
70875
|
};
|
|
70876
|
-
var
|
|
70876
|
+
var hitTestSectorFill = function (shape, x, y, bx, by) {
|
|
70877
70877
|
var fill = shape.fill;
|
|
70878
70878
|
if (fill.enable) {
|
|
70879
70879
|
var percent = Math.max(0, Math.min(1, fill.percent));
|
|
70880
70880
|
if (1 <= percent) {
|
|
70881
70881
|
return true;
|
|
70882
70882
|
}
|
|
70883
|
-
// The fill is relative to the bounding box [-bx, +bx] x [-by, 0] of the
|
|
70883
|
+
// The fill is relative to the bounding box [-bx, +bx] x [-by, 0] of the sector.
|
|
70884
70884
|
switch (fill.direction) {
|
|
70885
70885
|
case EShapeFillDirection.TOP:
|
|
70886
70886
|
return y + by <= percent * by;
|
|
@@ -70894,12 +70894,12 @@ var hitTestFanFill = function (shape, x, y, bx, by) {
|
|
|
70894
70894
|
}
|
|
70895
70895
|
return false;
|
|
70896
70896
|
};
|
|
70897
|
-
var
|
|
70898
|
-
var ca =
|
|
70897
|
+
var hitTestSector = function (shape, x, y, ax, ay, sw, ss) {
|
|
70898
|
+
var ca = toSectorAngleCentric(shape.angle);
|
|
70899
70899
|
if (ca <= 0 || ax <= 0 || ay <= 0) {
|
|
70900
70900
|
return false;
|
|
70901
70901
|
}
|
|
70902
|
-
var ea =
|
|
70902
|
+
var ea = toSectorAngleEccentric(ax, ay, ca);
|
|
70903
70903
|
var bx = ax * Math.sin(ea);
|
|
70904
70904
|
var st = Math.sin(ca);
|
|
70905
70905
|
var ct = Math.cos(ca);
|
|
@@ -70908,15 +70908,15 @@ var hitTestFan = function (shape, x, y, ax, ay, sw, ss) {
|
|
|
70908
70908
|
var strokeSideArc = (strokeSide & EShapeStrokeSide.NOT_BOTTOM) !== 0;
|
|
70909
70909
|
var strokeSideBottom = (strokeSide & EShapeStrokeSide.BOTTOM) !== 0;
|
|
70910
70910
|
var strokeWidth = strokeSideArc || strokeSideBottom ? sw : 0;
|
|
70911
|
-
if ((fill.enable || 0 < strokeWidth) &&
|
|
70912
|
-
if (fill.enable &&
|
|
70911
|
+
if ((fill.enable || 0 < strokeWidth) && isInSector(x, y, ax, ay, st, ct, 0, 0)) {
|
|
70912
|
+
if (fill.enable && hitTestSectorFill(shape, x, y, bx, ay)) {
|
|
70913
70913
|
return true;
|
|
70914
70914
|
}
|
|
70915
70915
|
if (0 < strokeWidth) {
|
|
70916
70916
|
var s = strokeWidth * ss;
|
|
70917
70917
|
var arc = strokeSideArc ? s : 0;
|
|
70918
70918
|
var sides = strokeSideBottom ? s : 0;
|
|
70919
|
-
if (!
|
|
70919
|
+
if (!isInSector(x, y, ax, ay, st, ct, arc, sides)) {
|
|
70920
70920
|
return true;
|
|
70921
70921
|
}
|
|
70922
70922
|
}
|
|
@@ -70928,31 +70928,31 @@ var hitTestFan = function (shape, x, y, ax, ay, sw, ss) {
|
|
|
70928
70928
|
* Copyright (C) 2019-2026 Toshiba Corporation
|
|
70929
70929
|
* SPDX-License-Identifier: Apache-2.0
|
|
70930
70930
|
*/
|
|
70931
|
-
var
|
|
70932
|
-
__extends(
|
|
70933
|
-
function
|
|
70934
|
-
if (type === void 0) { type = EShapeType.
|
|
70931
|
+
var EShapeSector = /** @class */ (function (_super) {
|
|
70932
|
+
__extends(EShapeSector, _super);
|
|
70933
|
+
function EShapeSector(type) {
|
|
70934
|
+
if (type === void 0) { type = EShapeType.SECTOR; }
|
|
70935
70935
|
var _this = _super.call(this, type) || this;
|
|
70936
70936
|
_this._angle = _this.newAngle();
|
|
70937
70937
|
_this._triangulated = _this.newTriangulated();
|
|
70938
70938
|
return _this;
|
|
70939
70939
|
}
|
|
70940
|
-
|
|
70940
|
+
EShapeSector.prototype.newAngle = function () {
|
|
70941
70941
|
return EShapeDefaults.ANGLE;
|
|
70942
70942
|
};
|
|
70943
|
-
|
|
70944
|
-
return new
|
|
70943
|
+
EShapeSector.prototype.newTriangulated = function () {
|
|
70944
|
+
return new EShapeSectorTriangulatedImpl(this);
|
|
70945
70945
|
};
|
|
70946
|
-
Object.defineProperty(
|
|
70946
|
+
Object.defineProperty(EShapeSector.prototype, "triangulated", {
|
|
70947
70947
|
get: function () {
|
|
70948
70948
|
return this._triangulated;
|
|
70949
70949
|
},
|
|
70950
70950
|
enumerable: false,
|
|
70951
70951
|
configurable: true
|
|
70952
70952
|
});
|
|
70953
|
-
Object.defineProperty(
|
|
70953
|
+
Object.defineProperty(EShapeSector.prototype, "angle", {
|
|
70954
70954
|
/**
|
|
70955
|
-
* The ratio of the half central angle of the
|
|
70955
|
+
* The ratio of the half central angle of the sector to PI. Must be in [0, 0.5].
|
|
70956
70956
|
* 0.5 results in a semicircle.
|
|
70957
70957
|
*/
|
|
70958
70958
|
get: function () {
|
|
@@ -70967,44 +70967,44 @@ var EShapeFan = /** @class */ (function (_super) {
|
|
|
70967
70967
|
enumerable: false,
|
|
70968
70968
|
configurable: true
|
|
70969
70969
|
});
|
|
70970
|
-
|
|
70970
|
+
EShapeSector.prototype.toHitTestStrokeShift = function (strokeWidth, strokeScale, strokeAlign) {
|
|
70971
70971
|
if (this.stroke.side !== EShapeStrokeSide.NONE) {
|
|
70972
70972
|
return _super.prototype.toHitTestStrokeShift.call(this, strokeWidth, strokeScale, strokeAlign);
|
|
70973
70973
|
}
|
|
70974
70974
|
return 0;
|
|
70975
70975
|
};
|
|
70976
|
-
|
|
70976
|
+
EShapeSector.prototype.copy = function (source, part) {
|
|
70977
70977
|
this.lock(EShapeLockPart.ALL);
|
|
70978
70978
|
_super.prototype.copy.call(this, source, part);
|
|
70979
|
-
if ((part == null || part & EShapeCopyPart.STYLE) && source instanceof
|
|
70979
|
+
if ((part == null || part & EShapeCopyPart.STYLE) && source instanceof EShapeSector) {
|
|
70980
70980
|
this._angle = source._angle;
|
|
70981
70981
|
}
|
|
70982
70982
|
this.unlock(EShapeLockPart.ALL, true);
|
|
70983
70983
|
return this;
|
|
70984
70984
|
};
|
|
70985
|
-
|
|
70986
|
-
return new
|
|
70985
|
+
EShapeSector.prototype.clone = function () {
|
|
70986
|
+
return new EShapeSector(this.type).copy(this);
|
|
70987
70987
|
};
|
|
70988
|
-
|
|
70988
|
+
EShapeSector.prototype.containsAbs = function (x, y, ax, ay, sw, ss, sa) {
|
|
70989
70989
|
if (_super.prototype.containsAbsBBox.call(this, x, y, ax, ay)) {
|
|
70990
|
-
return
|
|
70990
|
+
return hitTestSector(this, x, y, ax, ay, sw, ss);
|
|
70991
70991
|
}
|
|
70992
70992
|
return false;
|
|
70993
70993
|
};
|
|
70994
|
-
|
|
70994
|
+
EShapeSector.prototype.serialize = function (manager) {
|
|
70995
70995
|
var result = _super.prototype.serialize.call(this, manager);
|
|
70996
70996
|
result[15] = this._angle;
|
|
70997
70997
|
return result;
|
|
70998
70998
|
};
|
|
70999
|
-
return
|
|
70999
|
+
return EShapeSector;
|
|
71000
71000
|
}(EShapePrimitive));
|
|
71001
71001
|
|
|
71002
71002
|
/*
|
|
71003
71003
|
* Copyright (C) 2019-2026 Toshiba Corporation
|
|
71004
71004
|
* SPDX-License-Identifier: Apache-2.0
|
|
71005
71005
|
*/
|
|
71006
|
-
var
|
|
71007
|
-
shape = shape || new
|
|
71006
|
+
var deserializeSector = function (item, manager, shape) {
|
|
71007
|
+
shape = shape || new EShapeSector();
|
|
71008
71008
|
shape.angle = item[15];
|
|
71009
71009
|
return deserializeBase(item, manager, shape);
|
|
71010
71010
|
};
|
|
@@ -71013,10 +71013,10 @@ var deserializeFan = function (item, manager, shape) {
|
|
|
71013
71013
|
* Copyright (C) 2019-2026 Toshiba Corporation
|
|
71014
71014
|
* SPDX-License-Identifier: Apache-2.0
|
|
71015
71015
|
*/
|
|
71016
|
-
var
|
|
71017
|
-
EShapeUploadeds[EShapeType.
|
|
71018
|
-
EShapeDeserializers[EShapeType.
|
|
71019
|
-
EShapeCapabilities.set(EShapeType.
|
|
71016
|
+
var loadShapeSector = function () {
|
|
71017
|
+
EShapeUploadeds[EShapeType.SECTOR] = createPolygonUploaded;
|
|
71018
|
+
EShapeDeserializers[EShapeType.SECTOR] = deserializeSector;
|
|
71019
|
+
EShapeCapabilities.set(EShapeType.SECTOR, EShapeCapability.PRIMITIVE | EShapeCapability.STROKE_SIDE | EShapeCapability.ANGLE);
|
|
71020
71020
|
};
|
|
71021
71021
|
|
|
71022
71022
|
/*
|
|
@@ -78900,7 +78900,7 @@ var EShapeSemicircle = /** @class */ (function (_super) {
|
|
|
78900
78900
|
return new EShapeStrokeImpl(this, true, EShapeDefaults.STROKE_COLOR, EShapeDefaults.STROKE_ALPHA, EShapeDefaults.STROKE_WIDTH, EShapeDefaults.STROKE_ALIGN, EShapeDefaults.STROKE_SIDE & ~EShapeStrokeSide.BOTTOM, EShapeDefaults.STROKE_STYLE);
|
|
78901
78901
|
};
|
|
78902
78902
|
EShapeSemicircle.prototype.newTriangulated = function () {
|
|
78903
|
-
return new
|
|
78903
|
+
return new EShapeSectorTriangulatedImpl(this);
|
|
78904
78904
|
};
|
|
78905
78905
|
Object.defineProperty(EShapeSemicircle.prototype, "triangulated", {
|
|
78906
78906
|
get: function () {
|
|
@@ -78930,7 +78930,7 @@ var EShapeSemicircle = /** @class */ (function (_super) {
|
|
|
78930
78930
|
};
|
|
78931
78931
|
EShapeSemicircle.prototype.containsAbs = function (x, y, ax, ay, sw, ss, sa) {
|
|
78932
78932
|
if (_super.prototype.containsAbsBBox.call(this, x, y, ax, ay)) {
|
|
78933
|
-
return
|
|
78933
|
+
return hitTestSector(this, x, y, ax, ay, sw, ss);
|
|
78934
78934
|
}
|
|
78935
78935
|
return false;
|
|
78936
78936
|
};
|
|
@@ -79986,7 +79986,7 @@ var loadShapeAll = function () {
|
|
|
79986
79986
|
loadShapeConnectorElbow();
|
|
79987
79987
|
loadShapeConnectorLine();
|
|
79988
79988
|
loadShapeEmbedded();
|
|
79989
|
-
|
|
79989
|
+
loadShapeSector();
|
|
79990
79990
|
loadShapeGroupShadowed();
|
|
79991
79991
|
loadShapeGroup();
|
|
79992
79992
|
loadShapeImage();
|
|
@@ -112416,8 +112416,6 @@ exports.EShapeEmbeddedDatum = EShapeEmbeddedDatum;
|
|
|
112416
112416
|
exports.EShapeEmbeddedLayer = EShapeEmbeddedLayer;
|
|
112417
112417
|
exports.EShapeEmbeddedLayerContainer = EShapeEmbeddedLayerContainer;
|
|
112418
112418
|
exports.EShapeEmbeddeds = EShapeEmbeddeds;
|
|
112419
|
-
exports.EShapeFan = EShapeFan;
|
|
112420
|
-
exports.EShapeFanTriangulatedImpl = EShapeFanTriangulatedImpl;
|
|
112421
112419
|
exports.EShapeFillDirection = EShapeFillDirection;
|
|
112422
112420
|
exports.EShapeFillImpl = EShapeFillImpl;
|
|
112423
112421
|
exports.EShapeGroup = EShapeGroup;
|
|
@@ -112484,6 +112482,8 @@ exports.EShapeRuntimeDragStates = EShapeRuntimeDragStates;
|
|
|
112484
112482
|
exports.EShapeRuntimeImpl = EShapeRuntimeImpl;
|
|
112485
112483
|
exports.EShapeRuntimeReset = EShapeRuntimeReset;
|
|
112486
112484
|
exports.EShapeRuntimes = EShapeRuntimes;
|
|
112485
|
+
exports.EShapeSector = EShapeSector;
|
|
112486
|
+
exports.EShapeSectorTriangulatedImpl = EShapeSectorTriangulatedImpl;
|
|
112487
112487
|
exports.EShapeSemicircle = EShapeSemicircle;
|
|
112488
112488
|
exports.EShapeSemicircleLegacy = EShapeSemicircleLegacy;
|
|
112489
112489
|
exports.EShapeState = EShapeState;
|
|
@@ -112773,7 +112773,6 @@ exports.deserializeConnectorLine = deserializeConnectorLine;
|
|
|
112773
112773
|
exports.deserializeEmbedded = deserializeEmbedded;
|
|
112774
112774
|
exports.deserializeEmbeddedAcceptorEdge = deserializeEmbeddedAcceptorEdge;
|
|
112775
112775
|
exports.deserializeEmbeddedLayer = deserializeEmbeddedLayer;
|
|
112776
|
-
exports.deserializeFan = deserializeFan;
|
|
112777
112776
|
exports.deserializeGradient = deserializeGradient;
|
|
112778
112777
|
exports.deserializeGroup = deserializeGroup;
|
|
112779
112778
|
exports.deserializeGroupShadowed = deserializeGroupShadowed;
|
|
@@ -112793,6 +112792,7 @@ exports.deserializeRectangleLegacy = deserializeRectangleLegacy;
|
|
|
112793
112792
|
exports.deserializeRectanglePivoted = deserializeRectanglePivoted;
|
|
112794
112793
|
exports.deserializeRectangleRounded = deserializeRectangleRounded;
|
|
112795
112794
|
exports.deserializeRectangleRoundedLegacy = deserializeRectangleRoundedLegacy;
|
|
112795
|
+
exports.deserializeSector = deserializeSector;
|
|
112796
112796
|
exports.deserializeSemicircle = deserializeSemicircle;
|
|
112797
112797
|
exports.deserializeSemicircleLegacy = deserializeSemicircleLegacy;
|
|
112798
112798
|
exports.deserializeTriangle = deserializeTriangle;
|
|
@@ -112804,11 +112804,11 @@ exports.eShapePointsFormatterCurveBezierQuadratic = eShapePointsFormatterCurveBe
|
|
|
112804
112804
|
exports.hitTestBBox = hitTestBBox;
|
|
112805
112805
|
exports.hitTestCircle = hitTestCircle;
|
|
112806
112806
|
exports.hitTestCircleLegacy = hitTestCircleLegacy;
|
|
112807
|
-
exports.hitTestFan = hitTestFan;
|
|
112808
112807
|
exports.hitTestRectangle = hitTestRectangle;
|
|
112809
112808
|
exports.hitTestRectangleLegacy = hitTestRectangleLegacy;
|
|
112810
112809
|
exports.hitTestRectangleRounded = hitTestRectangleRounded;
|
|
112811
112810
|
exports.hitTestRectangleRoundedLegacy = hitTestRectangleRoundedLegacy;
|
|
112811
|
+
exports.hitTestSector = hitTestSector;
|
|
112812
112812
|
exports.hitTestSemicircle = hitTestSemicircle;
|
|
112813
112813
|
exports.hitTestTriangle = hitTestTriangle;
|
|
112814
112814
|
exports.hitTestTriangleFilled = hitTestTriangleFilled;
|
|
@@ -112839,7 +112839,6 @@ exports.loadShapeClipperEx = loadShapeClipperEx;
|
|
|
112839
112839
|
exports.loadShapeConnectorElbow = loadShapeConnectorElbow;
|
|
112840
112840
|
exports.loadShapeConnectorLine = loadShapeConnectorLine;
|
|
112841
112841
|
exports.loadShapeEmbedded = loadShapeEmbedded;
|
|
112842
|
-
exports.loadShapeFan = loadShapeFan;
|
|
112843
112842
|
exports.loadShapeGroup = loadShapeGroup;
|
|
112844
112843
|
exports.loadShapeGroupShadowed = loadShapeGroupShadowed;
|
|
112845
112844
|
exports.loadShapeImage = loadShapeImage;
|
|
@@ -112857,6 +112856,7 @@ exports.loadShapeRectangleLegacy = loadShapeRectangleLegacy;
|
|
|
112857
112856
|
exports.loadShapeRectanglePivoted = loadShapeRectanglePivoted;
|
|
112858
112857
|
exports.loadShapeRectangleRounded = loadShapeRectangleRounded;
|
|
112859
112858
|
exports.loadShapeRectangleRoundedLegacy = loadShapeRectangleRoundedLegacy;
|
|
112859
|
+
exports.loadShapeSector = loadShapeSector;
|
|
112860
112860
|
exports.loadShapeSemicircle = loadShapeSemicircle;
|
|
112861
112861
|
exports.loadShapeSemicircleLegacy = loadShapeSemicircleLegacy;
|
|
112862
112862
|
exports.loadShapeTriangle = loadShapeTriangle;
|
|
@@ -113112,8 +113112,6 @@ exports.toCloned = toCloned;
|
|
|
113112
113112
|
exports.toComputed = toComputed;
|
|
113113
113113
|
exports.toDash = toDash;
|
|
113114
113114
|
exports.toEnum = toEnum;
|
|
113115
|
-
exports.toFanAngleCentric = toFanAngleCentric;
|
|
113116
|
-
exports.toFanAngleEccentric = toFanAngleEccentric;
|
|
113117
113115
|
exports.toGradientImageUrl = toGradientImageUrl;
|
|
113118
113116
|
exports.toGradientSerialized = toGradientSerialized;
|
|
113119
113117
|
exports.toId = toId;
|
|
@@ -113132,6 +113130,8 @@ exports.toPointCount = toPointCount;
|
|
|
113132
113130
|
exports.toPointsBoundary = toPointsBoundary;
|
|
113133
113131
|
exports.toResized = toResized;
|
|
113134
113132
|
exports.toScaleInvariant = toScaleInvariant;
|
|
113133
|
+
exports.toSectorAngleCentric = toSectorAngleCentric;
|
|
113134
|
+
exports.toSectorAngleEccentric = toSectorAngleEccentric;
|
|
113135
113135
|
exports.toSizeNormalized = toSizeNormalized;
|
|
113136
113136
|
exports.toSizeRounded = toSizeRounded;
|
|
113137
113137
|
exports.toString = toString;
|