@wcardinal/wcardinal-ui 0.461.0 → 0.463.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/d-diagram-base.d.ts +6 -1
- package/dist/types/wcardinal/ui/d-diagram-canvas-base.d.ts +6 -0
- package/dist/types/wcardinal/ui/d-diagram-layer-container.d.ts +2 -1
- package/dist/types/wcardinal/ui/d-diagram-layer.d.ts +2 -2
- package/dist/types/wcardinal/ui/shape/e-shape-container.d.ts +3 -1
- package/dist/types/wcardinal/ui/shape/e-shape-runtime-drag-state.d.ts +5 -0
- package/dist/types/wcardinal/ui/shape/index.d.ts +1 -0
- package/dist/types/wcardinal/ui/shape/variant/build-line.d.ts +1 -1
- package/dist/types/wcardinal/ui/shape/variant/builder-line.d.ts +1 -1
- package/dist/types/wcardinal/ui/shape/variant/builder.d.ts +1 -0
- package/dist/types/wcardinal/ui/theme/dark/d-theme-dark-diagram-canvas-base.d.ts +2 -0
- package/dist/types/wcardinal/ui/theme/white/d-theme-white-diagram-canvas-base.d.ts +2 -0
- package/dist/wcardinal/ui/d-diagram-base.js +17 -5
- package/dist/wcardinal/ui/d-diagram-base.js.map +1 -1
- package/dist/wcardinal/ui/d-diagram-canvas-base.js +6 -6
- package/dist/wcardinal/ui/d-diagram-canvas-base.js.map +1 -1
- package/dist/wcardinal/ui/d-diagram-layer-container.js +4 -3
- package/dist/wcardinal/ui/d-diagram-layer-container.js.map +1 -1
- package/dist/wcardinal/ui/d-diagram-layer.js +4 -3
- package/dist/wcardinal/ui/d-diagram-layer.js.map +1 -1
- package/dist/wcardinal/ui/shape/e-shape-container.js +6 -3
- package/dist/wcardinal/ui/shape/e-shape-container.js.map +1 -1
- package/dist/wcardinal/ui/shape/e-shape-renderer.js +2 -2
- package/dist/wcardinal/ui/shape/e-shape-renderer.js.map +1 -1
- package/dist/wcardinal/ui/shape/e-shape-runtime-drag-state.js +19 -0
- package/dist/wcardinal/ui/shape/e-shape-runtime-drag-state.js.map +1 -0
- package/dist/wcardinal/ui/shape/e-shape-runtime-impl.js +5 -3
- package/dist/wcardinal/ui/shape/e-shape-runtime-impl.js.map +1 -1
- package/dist/wcardinal/ui/shape/index.js +1 -0
- package/dist/wcardinal/ui/shape/index.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/build-line.js +82 -17
- package/dist/wcardinal/ui/shape/variant/build-line.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/builder-line.js +8 -12
- package/dist/wcardinal/ui/shape/variant/builder-line.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/builder.js +2 -0
- package/dist/wcardinal/ui/shape/variant/builder.js.map +1 -1
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-diagram-canvas-base.js +6 -0
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-diagram-canvas-base.js.map +1 -1
- package/dist/wcardinal/ui/theme/white/d-theme-white-diagram-canvas-base.js +6 -0
- package/dist/wcardinal/ui/theme/white/d-theme-white-diagram-canvas-base.js.map +1 -1
- package/dist/wcardinal-ui-theme-dark-en-us.js +7 -1
- package/dist/wcardinal-ui-theme-dark-en-us.min.js +2 -2
- package/dist/wcardinal-ui-theme-dark-en-us.min.js.map +1 -1
- package/dist/wcardinal-ui-theme-dark-ja-jp.js +7 -1
- package/dist/wcardinal-ui-theme-dark-ja-jp.min.js +2 -2
- package/dist/wcardinal-ui-theme-dark-ja-jp.min.js.map +1 -1
- package/dist/wcardinal-ui-theme-dark.js +7 -1
- package/dist/wcardinal-ui-theme-dark.min.js +2 -2
- package/dist/wcardinal-ui-theme-white-en-us.js +7 -1
- package/dist/wcardinal-ui-theme-white-en-us.min.js +2 -2
- package/dist/wcardinal-ui-theme-white-en-us.min.js.map +1 -1
- package/dist/wcardinal-ui-theme-white-ja-jp.js +7 -1
- package/dist/wcardinal-ui-theme-white-ja-jp.min.js +2 -2
- package/dist/wcardinal-ui-theme-white-ja-jp.min.js.map +1 -1
- package/dist/wcardinal-ui-theme-white.js +7 -1
- package/dist/wcardinal-ui-theme-white.min.js +2 -2
- package/dist/wcardinal-ui.cjs.js +166 -55
- package/dist/wcardinal-ui.js +154 -55
- package/dist/wcardinal-ui.min.js +2 -2
- package/dist/wcardinal-ui.min.js.map +1 -1
- package/package.json +1 -1
package/dist/wcardinal-ui.cjs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Winter Cardinal UI v0.
|
|
2
|
+
Winter Cardinal UI v0.462.0
|
|
3
3
|
Copyright (C) 2019 Toshiba Corporation
|
|
4
4
|
SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
|
|
@@ -1419,6 +1419,7 @@ var UV = 8;
|
|
|
1419
1419
|
var INDEX = 16;
|
|
1420
1420
|
var VERTEX_AND_STEP = VERTEX | STEP;
|
|
1421
1421
|
var VERTEX_STEP_AND_UV = VERTEX_AND_STEP | UV;
|
|
1422
|
+
var VERTEX_STEP_AND_INDEX = VERTEX | STEP | INDEX;
|
|
1422
1423
|
var VERTEX_STEP_UV_AND_INDEX = VERTEX_STEP_AND_UV | INDEX;
|
|
1423
1424
|
var ALL$1 = VERTEX | STEP | COLOR | UV | INDEX;
|
|
1424
1425
|
var BuilderFlag = {
|
|
@@ -1430,6 +1431,7 @@ var BuilderFlag = {
|
|
|
1430
1431
|
INDEX: INDEX,
|
|
1431
1432
|
VERTEX_AND_STEP: VERTEX_AND_STEP,
|
|
1432
1433
|
VERTEX_STEP_AND_UV: VERTEX_STEP_AND_UV,
|
|
1434
|
+
VERTEX_STEP_AND_INDEX: VERTEX_STEP_AND_INDEX,
|
|
1433
1435
|
VERTEX_STEP_UV_AND_INDEX: VERTEX_STEP_UV_AND_INDEX,
|
|
1434
1436
|
ALL: ALL$1
|
|
1435
1437
|
};
|
|
@@ -16676,7 +16678,7 @@ var EShapeRendererIterator = /** @class */ (function () {
|
|
|
16676
16678
|
* SPDX-License-Identifier: Apache-2.0
|
|
16677
16679
|
*/
|
|
16678
16680
|
var VERTEX_SHADER$1 = "\nattribute highp vec2 aPosition;\nattribute highp vec2 aStepA;\nattribute highp vec4 aStepB;\nattribute highp vec3 aColor;\nattribute highp vec2 aUv;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform mediump float shapeScale;\nuniform mediump float antialiasWeight;\n\nvarying mediump float vType;\nvarying mediump vec2 vStepA;\nvarying mediump vec4 vStepB;\nvarying mediump vec4 vLength;\nvarying mediump vec4 vColorFill;\nvarying mediump vec4 vColorStroke;\nvarying mediump vec2 vUv;\n\nvec2 toInverse(in vec2 v) {\n\treturn vec2(-v.y, v.x);\n}\n\nvec4 toGeneral(in float v) {\n\tvec4 c = vec4(1.0, 1.0/64.0, 1.0/64.0/64.0, 1.0/64.0/64.0/64.0) * v;\n\tc -= fract(c);\n\tc -= c.yzwx * vec4(64.0, 64.0, 64.0, 0.0);\n\treturn c;\n}\n\nfloat toStrokeWidthScale(in float scale) {\n\treturn (\n\t\tscale == 3.0 || scale == 7.0 ?\n\t\tshapeScale : (\n\t\t\tscale == 1.0 || scale == 5.0 ?\n\t\t\tmin(1.0, shapeScale) : (\n\t\t\t\tscale == 2.0 || scale == 6.0 ?\n\t\t\t\tmax(1.0, shapeScale) : 1.0\n\t\t\t)\n\t\t)\n\t);\n}\n\nvec2 toUnpackedF2x1024(in float v) {\n\tvec2 c = vec2(1.0, 1.0/1024.0) * v;\n\tc -= fract(c);\n\tc -= c.yx * vec2(1024.0, 0.0);\n\tc /= vec2(1023.0, 1023.0);\n\treturn c;\n}\n\nvec3 toUnpackedF3x256(in float v) {\n\tvec3 c = vec3(1.0, 1.0/256.0, 1.0/256.0/256.0) * v;\n\tc -= fract(c);\n\tc -= c.yzx * vec3(256.0, 256.0, 0.0);\n\tc /= 255.0;\n\treturn c;\n}\n\nvec2 toPosition012(in vec2 v) {\n\treturn (projectionMatrix * translationMatrix * vec3(v, 1.0)).xy;\n}\n\nvec4 toStepB01(in vec4 sb) {\n\treturn vec4(sb.xy, toUnpackedF2x1024(sb.z));\n}\n\nvec4 toStepB2(in vec4 sb, in float strokeWidth) {\n\tfloat x = min(0.4, 0.4 / 12.0 * sb.x * antialiasWeight);\n\tfloat w = clamp(strokeWidth, 0.0, 1.0) * 0.4;\n\tfloat p = w * sb.y + sb.z;\n\tfloat y = 0.5 - p;\n\tfloat z = 0.5 - p - w;\n\treturn vec4(y, z, y - max(0.01, y - x), z - max(0.01, z - x));\n}\n\nvec2 toPosition3(in float type, in vec2 p, in float npacked, in float length, in float strokeWidth, out float shift) {\n\tvec3 t = vec3(1.0, 1.0/1024.0, 1.0/1024.0/1024.0) * npacked;\n\tt -= fract(t);\n\tt -= t.yzx * vec3(1024.0, 1024.0, 0.0);\n\tt *= vec3(1.0/511.5, 1.0/511.5, 1.0);\n\tt -= vec3(1.0, 1.0, 0.0);\n\tvec2 n0 = vec2(t.x, ((0.5 < t.z && t.z < 1.5) || 2.5 < t.z ? +1.0 : -1.0) * sqrt(max(0.0, 1.0 - t.x * t.x)));\n\tvec2 n1 = vec2(t.y, (1.5 < t.z ? +1.0 : -1.0) * sqrt(max(0.0, 1.0 - t.y * t.y)));\n\n\tvec2 n0i = toInverse(n0);\n\tvec2 n1i = toInverse(n1);\n\tfloat direction = sign(4.5 - type);\n\n\t// Offset\n\tfloat cross = dot(n0i, n1);\n\tbool bcross = 0.00001 < abs(cross);\n\tfloat crossi = (bcross ? 1.0 / cross : 0.0);\n\tfloat b = dot(n1 - n0, n0) * crossi;\n\tfloat offsetSize = direction * strokeWidth * 0.5;\n\tvec2 offset = n1 + n1i * b;\n\n\t// Miter\n\tvec2 pmiter = p + offsetSize * offset;\n\tfloat miterAngle0 = dot( n0i, offsetSize * offset - length * n0i );\n\tfloat miterAngle1 = dot( n1i, offsetSize * offset + length * n1i );\n\tfloat miterLength = dot( offset, offset );\n\tfloat miterSide = direction * cross;\n\n\t// Bevel\n\tvec2 n = (type == 4.0 || type == 6.0 ? n1 : n0);\n\tvec2 pbevel = p + offsetSize * n;\n\n\t//\n\tvec2 presult = (\n\t\t0.0 <= miterSide ?\n\t\t(miterAngle0 < 0.0 && 0.0 <= miterAngle1 && bcross ? pmiter : pbevel) :\n\t\t(miterLength < 6.0 && bcross ? pmiter : pbevel)\n\t);\n\tvec2 ni = (type == 4.0 || type == 6.0 ? n1i : n0i);\n\tshift = dot(ni, p - presult);\n\treturn toPosition012(presult);\n}\n\nvec2 toStepA3(in float type, in float strokeWidth) {\n\treturn vec2(type < 4.5 ? 1.0 : 0.0, strokeWidth);\n}\n\nfloat toDotWidth(in float strokeScaling, in float strokeWidthScale) {\n\treturn aStepA.x * (\n\t\tstrokeScaling == 4.0 || strokeScaling == 5.0 ||\n\t\tstrokeScaling == 6.0 || strokeScaling == 7.0 ?\n\t\tstrokeWidthScale : 1.0\n\t);\n}\n\nvec2 toDotPattern(in float dash) {\n\treturn (dash < 0.5 ?\n\t\tvec2(1.0, 0.0) :\n\t\t(dash < 3.5 ?\n\t\t\t(dash < 1.5 ?\n\t\t\t\tvec2(1.0, 1.0) :\n\t\t\t\t(2.5 < dash ?\n\t\t\t\t\tvec2(1.0, 2.0) :\n\t\t\t\t\tvec2(1.0, 0.5)\n\t\t\t\t)\n\t\t\t) :\n\t\t\t(dash < 4.5 ?\n\t\t\t\tvec2(2.0, 1.0) :\n\t\t\t\t(5.5 < dash ?\n\t\t\t\t\tvec2(2.0, 2.0) :\n\t\t\t\t\tvec2(2.0, 0.5)\n\t\t\t\t)\n\t\t\t)\n\t\t)\n\t);\n}\n\nvec4 toLength3(in float shift, in float dash, in float strokeScaling, in float strokeWidthScale) {\n\tfloat width = toDotWidth(strokeScaling, strokeWidthScale);\n\tvec2 pattern = toDotPattern(dash);\n\treturn vec4(aStepB.y + shift, pattern.x * width, pattern.y * width, aStepB.z);\n}\n\nvec4 toLength7(in float type, in float strokeScaling, in float strokeWidthScale) {\n\tfloat width = toDotWidth(strokeScaling, strokeWidthScale);\n\tvec2 pattern = toDotPattern(type - 7.0);\n\treturn vec4(aStepB.w, pattern.x * width, pattern.y * width, -1.0);\n}\n\nvoid toColors(in vec3 source, out vec4 fillColor, out vec4 strokeColor) {\n\tvec2 a = toUnpackedF2x1024(source.z);\n\tfillColor.xyz = toUnpackedF3x256(source.x).zyx * a.x;\n\tfillColor.w = a.x;\n\tstrokeColor.xyz = toUnpackedF3x256(source.y).zyx * a.y;\n\tstrokeColor.w = a.y;\n}\n\nvoid main(void) {\n\tvec4 general = toGeneral(aStepA.y);\n\tfloat type = general.x;\n\tfloat strokeScaling = general.y;\n\tfloat strokeWidthScale = toStrokeWidthScale(strokeScaling);\n\tfloat strokeWidth = strokeWidthScale * aStepA.x;\n\n\tvType = type;\n\tif (type < 2.5 || 6.5 < type) {\n\t\tgl_Position = vec4(toPosition012(aPosition), 0.0, 1.0);\n\t\tvStepA = strokeWidth * general.zw;\n\t\tif (type < 1.5) {\n\t\t\tvStepB = toStepB01(aStepB);\n\t\t\tvLength = vec4(-1.0, 0.0, 0.0, -1.0);\n\t\t} else if (type < 2.5) {\n\t\t\tvStepB = toStepB2(aStepB, strokeWidth);\n\t\t\tvLength = vec4(-1.0, 0.0, 0.0, -1.0);\n\t\t} else {\n\t\t\tvStepB = toStepB01(aStepB);\n\t\t\tvLength = toLength7(type, strokeScaling, strokeWidthScale);\n\t\t}\n\t} else {\n\t\tfloat shift3 = 0.0;\n\t\tgl_Position = vec4(toPosition3(type, aPosition, aStepB.x, aStepB.w, strokeWidth, shift3), 0.0, 1.0);\n\t\tvStepA = toStepA3(type, strokeWidth);\n\t\tvStepB = vec4(0.0);\n\t\tvLength = toLength3(shift3, general.z, strokeScaling, strokeWidthScale);\n\t}\n\ttoColors(aColor, vColorFill, vColorStroke);\n\tvUv = aUv;\n}";
|
|
16679
|
-
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 = antialiasWeight * f;\n\tvec2 swd = vStepA * f;\n\tvec2 one = vec2(1.0);\n\tvec2
|
|
16681
|
+
var FRAGMENT_SHADER$1 = "\nvarying mediump float vType;\nvarying mediump vec2 vStepA;\nvarying mediump vec4 vStepB;\nvarying mediump vec4 vLength;\nvarying mediump vec4 vColorFill;\nvarying mediump vec4 vColorStroke;\nvarying mediump vec2 vUv;\n\nuniform sampler2D sampler;\nuniform mediump float antialiasWeight;\n\nvec4 toColor0(in vec4 texture) {\n\tvec2 f = vec2(1.0) / vStepB.xy;\n\tvec2 c = vStepB.zw;\n\tvec2 awd = 0.5 * antialiasWeight * f;\n\tvec2 swd = vStepA * f;\n\tvec2 one = vec2(1.0);\n\tvec2 s0 = smoothstep(one - awd, one + awd, c);\n\tvec2 s1 = smoothstep(one - swd - awd, one - swd + awd, c);\n\tfloat s2 = max(s0.x, s0.y);\n\tfloat s3 = max(s1.x, s1.y);\n\n\treturn texture * (\n\t\tvColorStroke * (s3 - s2) +\n\t\tvColorFill * (1.0 - s3)\n\t);\n}\n\nvec4 toColor1(in vec4 texture) {\n\tvec2 d = vStepB.xy;\n\tvec2 c = vStepB.zw;\n\tvec2 awd = 0.5 * antialiasWeight / d;\n\tvec2 swd = vStepA / d;\n\tvec2 one = vec2(1.0);\n\tfloat s0 = smoothstep(length(c/(one + awd)), length(c/(one - awd)), 1.0);\n\tfloat s1 = smoothstep(length(c/(one - swd + awd)), length(c/(one - swd - awd)), 1.0);\n\treturn texture * (\n\t\tvColorStroke * (s0 - s1) +\n\t\tvColorFill * s1\n\t);\n}\n\nvec4 toColor2(in vec4 texture) {\n\tvec2 p0 = vStepB.xy;\n\tvec2 p1 = vStepB.zw;\n\tvec2 d = vec2(dot(texture, vec4(1.0, 1.0/255.0, 1.0/255.0/255.0, 0.0)));\n\tvec2 s = smoothstep(p0 - p1, p0 + p1, d);\n\treturn vColorStroke * (s.y - s.x) + vColorFill * s.x;\n}\n\nfloat toLineStep(in vec4 parameters) {\n\tfloat l = parameters.x;\n\tfloat lp0 = parameters.y;\n\tfloat lp1 = parameters.z;\n\tfloat lt = parameters.w;\n\tfloat ld = 0.5 * antialiasWeight;\n\tfloat lm = mod(l, lp0 + lp1);\n\tfloat s0 = (0.0 < lp1 ? smoothstep(-ld, ld, lm) - smoothstep(lp0 - ld, lp0 + ld, lm) : 1.0);\n\tfloat s1 = (0.0 <= lt ? smoothstep(-ld, ld, l) - smoothstep(lt - ld, lt + ld, l) : 1.0);\n\treturn s0 * s1;\n}\n\nvec4 toColor3(in vec4 texture) {\n\tfloat c = vStepA.x;\n\tfloat awd = 0.5 * antialiasWeight / vStepA.y;\n\tfloat s0 = smoothstep(-awd, awd, c);\n\tfloat s1 = smoothstep(1.0 - awd, 1.0 + awd, c);\n\treturn texture * vColorStroke * (s0 - s1) * toLineStep(vLength);\n}\n\nvec4 toColor7(in vec4 texture) {\n\tfloat aw = 0.5 * antialiasWeight;\n\tfloat awd = aw * vStepB.x;\n\tfloat swd = vStepA.x * vStepB.x;\n\tfloat s0 = smoothstep(1.0 - awd, 1.0 + awd, vStepB.z);\n\tfloat s1 = smoothstep(1.0 - swd - awd, 1.0 - swd + awd, vStepB.z) * toLineStep(vLength);\n\tfloat s2 = smoothstep(-aw, +aw, vStepB.y);\n\treturn texture * (\n\t\tvColorStroke * (s1 - s0) +\n\t\tvColorFill * (1.0 - s1) * s2\n\t);\n}\n\nvoid main(void) {\n\tvec4 texture = texture2D(sampler, vUv);\n\tif (vType < 0.5) {\n\t\tgl_FragColor = toColor0(texture);\n\t} else if (vType < 1.5) {\n\t\tgl_FragColor = toColor1(texture);\n\t} else if (vType < 2.5) {\n\t\tgl_FragColor = toColor2(texture);\n\t} else if (vType < 6.5) {\n\t\tgl_FragColor = toColor3(texture);\n\t} else {\n\t\tgl_FragColor = toColor7(texture);\n\t}\n}";
|
|
16680
16682
|
var EShapeRenderer = /** @class */ (function (_super) {
|
|
16681
16683
|
__extends(EShapeRenderer, _super);
|
|
16682
16684
|
function EShapeRenderer(renderer) {
|
|
@@ -16771,7 +16773,7 @@ var EShapeRenderer = /** @class */ (function (_super) {
|
|
|
16771
16773
|
if (shader != null && (shape != null || 0 < shapes.length)) {
|
|
16772
16774
|
var resolution = renderer.resolution;
|
|
16773
16775
|
var buffers = container.getBuffers();
|
|
16774
|
-
var antialiasWeight = container.
|
|
16776
|
+
var antialiasWeight = container.getAntialiasWeight();
|
|
16775
16777
|
// Update textures
|
|
16776
16778
|
if (isDirty) {
|
|
16777
16779
|
// Atlases
|
|
@@ -16875,8 +16877,10 @@ var EShapeContainer = /** @class */ (function (_super) {
|
|
|
16875
16877
|
_this._fontAtlases = new DynamicSDFFontAtlases();
|
|
16876
16878
|
_this._pixelScale = 1;
|
|
16877
16879
|
_this._pixelScaleId = -2; // Since this._shapeScaleId starts from -1.
|
|
16880
|
+
_this._pixelScaleResolution = 1;
|
|
16878
16881
|
_this._shapeScale = 1;
|
|
16879
16882
|
_this._shapeScaleId = -1; // Since Transform._worldID starts from zero.
|
|
16883
|
+
_this._antialiasWeight = 1;
|
|
16880
16884
|
_this._work = new pixi_js.Point();
|
|
16881
16885
|
_this._buffers = [];
|
|
16882
16886
|
return _this;
|
|
@@ -16954,8 +16958,9 @@ var EShapeContainer = /** @class */ (function (_super) {
|
|
|
16954
16958
|
EShapeContainer.prototype.toPixelScale = function (resolution) {
|
|
16955
16959
|
var shapeScale = this.toShapeScale();
|
|
16956
16960
|
var shapeScaleId = this._shapeScaleId;
|
|
16957
|
-
if (this._pixelScaleId !== shapeScaleId) {
|
|
16961
|
+
if (this._pixelScaleId !== shapeScaleId || this._pixelScaleResolution !== resolution) {
|
|
16958
16962
|
this._pixelScaleId = shapeScaleId;
|
|
16963
|
+
this._pixelScaleResolution = resolution;
|
|
16959
16964
|
this._pixelScale = (1 / resolution) * shapeScale;
|
|
16960
16965
|
}
|
|
16961
16966
|
return this._pixelScale;
|
|
@@ -16963,8 +16968,8 @@ var EShapeContainer = /** @class */ (function (_super) {
|
|
|
16963
16968
|
EShapeContainer.prototype.getPixelScale = function () {
|
|
16964
16969
|
return this._pixelScale;
|
|
16965
16970
|
};
|
|
16966
|
-
EShapeContainer.prototype.
|
|
16967
|
-
return
|
|
16971
|
+
EShapeContainer.prototype.getAntialiasWeight = function () {
|
|
16972
|
+
return this._antialiasWeight;
|
|
16968
16973
|
};
|
|
16969
16974
|
EShapeContainer.prototype.hitTest = function (global, onHit) {
|
|
16970
16975
|
var local = this._work;
|
|
@@ -24535,10 +24540,21 @@ var DDiagramBase = /** @class */ (function (_super) {
|
|
|
24535
24540
|
var _a;
|
|
24536
24541
|
var _this = _super.call(this, options) || this;
|
|
24537
24542
|
_this._serialized = null;
|
|
24538
|
-
|
|
24539
|
-
|
|
24540
|
-
|
|
24541
|
-
|
|
24543
|
+
var theme = _this.theme;
|
|
24544
|
+
if (options != null) {
|
|
24545
|
+
_this._tileFactory = options.tile;
|
|
24546
|
+
_this._controller = options.controller;
|
|
24547
|
+
_this._isAmbient = (_a = options.ambient) !== null && _a !== void 0 ? _a : theme.isAmbient();
|
|
24548
|
+
_this._antialias = options.antialias;
|
|
24549
|
+
_this._snapshot = new DDiagramSnapshot(_this, options.snapshot);
|
|
24550
|
+
}
|
|
24551
|
+
else {
|
|
24552
|
+
_this._tileFactory = undefined;
|
|
24553
|
+
_this._controller = undefined;
|
|
24554
|
+
_this._isAmbient = theme.isAmbient();
|
|
24555
|
+
_this._antialias = undefined;
|
|
24556
|
+
_this._snapshot = new DDiagramSnapshot(_this);
|
|
24557
|
+
}
|
|
24542
24558
|
_this._mode = _this.toMode(options);
|
|
24543
24559
|
return _this;
|
|
24544
24560
|
}
|
|
@@ -24631,7 +24647,8 @@ var DDiagramBase = /** @class */ (function (_super) {
|
|
|
24631
24647
|
factory: this._tileFactory,
|
|
24632
24648
|
mapping: (_a = serialized.tile) === null || _a === void 0 ? void 0 : _a.mapping
|
|
24633
24649
|
},
|
|
24634
|
-
ambient: isAmbient
|
|
24650
|
+
ambient: isAmbient,
|
|
24651
|
+
antialias: this._antialias
|
|
24635
24652
|
};
|
|
24636
24653
|
};
|
|
24637
24654
|
DDiagramBase.prototype.toCanvasBaseBackgroundOptions = function (serialized, theme, isAmbient) {
|
|
@@ -24922,6 +24939,23 @@ var DDiagramCanvasTile = /** @class */ (function () {
|
|
|
24922
24939
|
return DDiagramCanvasTile;
|
|
24923
24940
|
}());
|
|
24924
24941
|
|
|
24942
|
+
/*
|
|
24943
|
+
* Copyright (C) 2026 Toshiba Corporation
|
|
24944
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
24945
|
+
*/
|
|
24946
|
+
var EShapeRuntimeDragStates = /** @class */ (function () {
|
|
24947
|
+
function EShapeRuntimeDragStates() {
|
|
24948
|
+
}
|
|
24949
|
+
EShapeRuntimeDragStates.get = function () {
|
|
24950
|
+
return this._STATE;
|
|
24951
|
+
};
|
|
24952
|
+
EShapeRuntimeDragStates.set = function (state) {
|
|
24953
|
+
this._STATE = state;
|
|
24954
|
+
};
|
|
24955
|
+
EShapeRuntimeDragStates._STATE = EShapeState.DRAGGED;
|
|
24956
|
+
return EShapeRuntimeDragStates;
|
|
24957
|
+
}());
|
|
24958
|
+
|
|
24925
24959
|
/*
|
|
24926
24960
|
* Copyright (C) 2019 Toshiba Corporation
|
|
24927
24961
|
* SPDX-License-Identifier: Apache-2.0
|
|
@@ -24993,11 +25027,12 @@ var EShapeRuntimeImpl = /** @class */ (function () {
|
|
|
24993
25027
|
};
|
|
24994
25028
|
EShapeRuntimeImpl.prototype.isDraggable = function (shape, e) {
|
|
24995
25029
|
var state = shape.state;
|
|
24996
|
-
var
|
|
25030
|
+
var dragState = EShapeRuntimeDragStates.get();
|
|
25031
|
+
var wasDragged = state.is(dragState);
|
|
24997
25032
|
try {
|
|
24998
25033
|
// State
|
|
24999
25034
|
if (state.isActionable) {
|
|
25000
|
-
state.
|
|
25035
|
+
state.add(dragState);
|
|
25001
25036
|
}
|
|
25002
25037
|
// Actions
|
|
25003
25038
|
var actions = this.actions;
|
|
@@ -25010,7 +25045,7 @@ var EShapeRuntimeImpl = /** @class */ (function () {
|
|
|
25010
25045
|
return false;
|
|
25011
25046
|
}
|
|
25012
25047
|
finally {
|
|
25013
|
-
state.
|
|
25048
|
+
state.set(dragState, wasDragged);
|
|
25014
25049
|
}
|
|
25015
25050
|
};
|
|
25016
25051
|
EShapeRuntimeImpl.prototype.onDragStart = function (shape, e, interactionManager) {
|
|
@@ -25450,7 +25485,7 @@ var EShapeRectanglePivoted = /** @class */ (function (_super) {
|
|
|
25450
25485
|
*/
|
|
25451
25486
|
var DDiagramLayer = /** @class */ (function (_super) {
|
|
25452
25487
|
__extends(DDiagramLayer, _super);
|
|
25453
|
-
function DDiagramLayer(name) {
|
|
25488
|
+
function DDiagramLayer(name, antialiasWeight) {
|
|
25454
25489
|
var _this = _super.call(this) || this;
|
|
25455
25490
|
_this.name = name;
|
|
25456
25491
|
_this.interactive = false;
|
|
@@ -25459,6 +25494,7 @@ var DDiagramLayer = /** @class */ (function (_super) {
|
|
|
25459
25494
|
shape.parent = _this;
|
|
25460
25495
|
_this._shape = shape;
|
|
25461
25496
|
_this.interactives = [];
|
|
25497
|
+
_this._antialiasWeight = antialiasWeight;
|
|
25462
25498
|
return _this;
|
|
25463
25499
|
}
|
|
25464
25500
|
Object.defineProperty(DDiagramLayer.prototype, "width", {
|
|
@@ -25630,9 +25666,9 @@ var DDiagramLayer = /** @class */ (function (_super) {
|
|
|
25630
25666
|
isInteractive | isDraggable | isPinchable
|
|
25631
25667
|
];
|
|
25632
25668
|
};
|
|
25633
|
-
DDiagramLayer.deserialize = function (serialized, manager, width, height) {
|
|
25669
|
+
DDiagramLayer.deserialize = function (serialized, manager, width, height, antialiasWeight) {
|
|
25634
25670
|
var _a, _b, _c;
|
|
25635
|
-
var result = new DDiagramLayer(this.deserializeName(serialized[0], manager));
|
|
25671
|
+
var result = new DDiagramLayer(this.deserializeName(serialized[0], manager), antialiasWeight);
|
|
25636
25672
|
var shape = result._shape;
|
|
25637
25673
|
var visibility = serialized[1];
|
|
25638
25674
|
if (visibility != null) {
|
|
@@ -25684,11 +25720,12 @@ var DDiagramLayer = /** @class */ (function (_super) {
|
|
|
25684
25720
|
*/
|
|
25685
25721
|
var DDiagramLayerContainer = /** @class */ (function (_super) {
|
|
25686
25722
|
__extends(DDiagramLayerContainer, _super);
|
|
25687
|
-
function DDiagramLayerContainer(width, height) {
|
|
25723
|
+
function DDiagramLayerContainer(width, height, antialiasWeight) {
|
|
25688
25724
|
var _this = _super.call(this) || this;
|
|
25689
25725
|
_this._active = null;
|
|
25690
25726
|
_this._width = width;
|
|
25691
25727
|
_this._height = height;
|
|
25728
|
+
_this._antialiasWeight = antialiasWeight;
|
|
25692
25729
|
_this.interactive = false;
|
|
25693
25730
|
_this.interactiveChildren = false;
|
|
25694
25731
|
return _this;
|
|
@@ -25716,7 +25753,7 @@ var DDiagramLayerContainer = /** @class */ (function (_super) {
|
|
|
25716
25753
|
configurable: true
|
|
25717
25754
|
});
|
|
25718
25755
|
DDiagramLayerContainer.prototype.create = function (name, activate) {
|
|
25719
|
-
var result = new DDiagramLayer(name);
|
|
25756
|
+
var result = new DDiagramLayer(name, this._antialiasWeight);
|
|
25720
25757
|
this.attach(result, activate);
|
|
25721
25758
|
return result;
|
|
25722
25759
|
};
|
|
@@ -25845,7 +25882,7 @@ var DDiagramLayerContainer = /** @class */ (function (_super) {
|
|
|
25845
25882
|
var width = this._width;
|
|
25846
25883
|
var height = this._height;
|
|
25847
25884
|
for (var i = 0; i < serializedLayersLength; ++i) {
|
|
25848
|
-
this.addChild(DDiagramLayer.deserialize(serializedLayers[i], manager, width, height));
|
|
25885
|
+
this.addChild(DDiagramLayer.deserialize(serializedLayers[i], manager, width, height, this._antialiasWeight));
|
|
25849
25886
|
}
|
|
25850
25887
|
this.onLayerChange();
|
|
25851
25888
|
DApplications.update(this);
|
|
@@ -25861,7 +25898,7 @@ var DDiagramLayerContainer = /** @class */ (function (_super) {
|
|
|
25861
25898
|
var DDiagramCanvasBase = /** @class */ (function (_super) {
|
|
25862
25899
|
__extends(DDiagramCanvasBase, _super);
|
|
25863
25900
|
function DDiagramCanvasBase(options) {
|
|
25864
|
-
var _a, _b, _c, _d;
|
|
25901
|
+
var _a, _b, _c, _d, _e, _f;
|
|
25865
25902
|
var _this = _super.call(this, options) || this;
|
|
25866
25903
|
// Background
|
|
25867
25904
|
var theme = _this.theme;
|
|
@@ -25869,15 +25906,15 @@ var DDiagramCanvasBase = /** @class */ (function (_super) {
|
|
|
25869
25906
|
_this._background = new DDiagramCanvasEditorBackground(_this._background, _this.toBackgroundBase(theme, options));
|
|
25870
25907
|
}
|
|
25871
25908
|
// Layer
|
|
25872
|
-
var layer = new DDiagramLayerContainer(_this.width, _this.height);
|
|
25909
|
+
var layer = new DDiagramLayerContainer(_this.width, _this.height, Math.max(theme.getAntialiasWeightLowerBound(), (_b = (_a = options === null || options === void 0 ? void 0 : options.antialias) === null || _a === void 0 ? void 0 : _a.weight) !== null && _b !== void 0 ? _b : theme.getAntialiasWeight()));
|
|
25873
25910
|
_this._layer = layer;
|
|
25874
25911
|
_this.addChild(layer);
|
|
25875
25912
|
// Label, Category, Summary and Description
|
|
25876
25913
|
if (options != null) {
|
|
25877
|
-
_this._label = (
|
|
25878
|
-
_this._category = (
|
|
25879
|
-
_this._summary = (
|
|
25880
|
-
_this._description = (
|
|
25914
|
+
_this._label = (_c = options.label) !== null && _c !== void 0 ? _c : "";
|
|
25915
|
+
_this._category = (_d = options.category) !== null && _d !== void 0 ? _d : null;
|
|
25916
|
+
_this._summary = (_e = options.summary) !== null && _e !== void 0 ? _e : "";
|
|
25917
|
+
_this._description = (_f = options.description) !== null && _f !== void 0 ? _f : "";
|
|
25881
25918
|
}
|
|
25882
25919
|
else {
|
|
25883
25920
|
_this._label = "";
|
|
@@ -38735,6 +38772,12 @@ var DThemeWhiteDiagramCanvasBase = /** @class */ (function (_super) {
|
|
|
38735
38772
|
DThemeWhiteDiagramCanvasBase.prototype.getLocalBoundsLimit = function () {
|
|
38736
38773
|
return 0;
|
|
38737
38774
|
};
|
|
38775
|
+
DThemeWhiteDiagramCanvasBase.prototype.getAntialiasWeight = function () {
|
|
38776
|
+
return 1;
|
|
38777
|
+
};
|
|
38778
|
+
DThemeWhiteDiagramCanvasBase.prototype.getAntialiasWeightLowerBound = function () {
|
|
38779
|
+
return 1e-5;
|
|
38780
|
+
};
|
|
38738
38781
|
return DThemeWhiteDiagramCanvasBase;
|
|
38739
38782
|
}(DThemeWhiteCanvas));
|
|
38740
38783
|
|
|
@@ -49357,6 +49400,12 @@ var DThemeDarkDiagramCanvasBase = /** @class */ (function (_super) {
|
|
|
49357
49400
|
DThemeDarkDiagramCanvasBase.prototype.getLocalBoundsLimit = function () {
|
|
49358
49401
|
return 0;
|
|
49359
49402
|
};
|
|
49403
|
+
DThemeDarkDiagramCanvasBase.prototype.getAntialiasWeight = function () {
|
|
49404
|
+
return 1;
|
|
49405
|
+
};
|
|
49406
|
+
DThemeDarkDiagramCanvasBase.prototype.getAntialiasWeightLowerBound = function () {
|
|
49407
|
+
return 1e-5;
|
|
49408
|
+
};
|
|
49360
49409
|
return DThemeDarkDiagramCanvasBase;
|
|
49361
49410
|
}(DThemeDarkCanvas));
|
|
49362
49411
|
|
|
@@ -64261,6 +64310,11 @@ var toVectorLength = function (v) {
|
|
|
64261
64310
|
var LINE_FMIN = 0.00001;
|
|
64262
64311
|
var LINE_NPREV = [0, 1];
|
|
64263
64312
|
var LINE_NNEXT = [0, 1];
|
|
64313
|
+
/**
|
|
64314
|
+
* Extends line segments at the start and the end a little bit
|
|
64315
|
+
* to apply the antialiasing at the start and the end.
|
|
64316
|
+
*/
|
|
64317
|
+
var LINE_EXTRA_LENGTH = 5;
|
|
64264
64318
|
var toPointCount = function (points) {
|
|
64265
64319
|
if (points) {
|
|
64266
64320
|
return points.formatted.plength;
|
|
@@ -64287,7 +64341,7 @@ var buildLineIndex = function (indices, voffset, ioffset, icount) {
|
|
|
64287
64341
|
var iimax = (ioffset + icount) * 3 - 1;
|
|
64288
64342
|
var io = voffset;
|
|
64289
64343
|
for (; ii < iimax;) {
|
|
64290
|
-
indices[++ii] = io
|
|
64344
|
+
indices[++ii] = io;
|
|
64291
64345
|
indices[++ii] = io + 2;
|
|
64292
64346
|
indices[++ii] = io + 1;
|
|
64293
64347
|
indices[++ii] = io + 1;
|
|
@@ -64296,6 +64350,40 @@ var buildLineIndex = function (indices, voffset, ioffset, icount) {
|
|
|
64296
64350
|
io += 2;
|
|
64297
64351
|
}
|
|
64298
64352
|
};
|
|
64353
|
+
/**
|
|
64354
|
+
* Builds normal (non-degenerate) triangle indices for a contiguous vertex range.
|
|
64355
|
+
* vcount is the number of vertices in the segment.
|
|
64356
|
+
* Returns the updated index write position.
|
|
64357
|
+
*/
|
|
64358
|
+
var buildLineSegmentIndex = function (indices, ii, vstart, vcount) {
|
|
64359
|
+
var io = vstart;
|
|
64360
|
+
var iomax = vstart + vcount - 2;
|
|
64361
|
+
for (; io < iomax; io += 2) {
|
|
64362
|
+
indices[++ii] = io;
|
|
64363
|
+
indices[++ii] = io + 2;
|
|
64364
|
+
indices[++ii] = io + 1;
|
|
64365
|
+
indices[++ii] = io + 1;
|
|
64366
|
+
indices[++ii] = io + 2;
|
|
64367
|
+
indices[++ii] = io + 3;
|
|
64368
|
+
}
|
|
64369
|
+
return ii;
|
|
64370
|
+
};
|
|
64371
|
+
/**
|
|
64372
|
+
* Fills degenerate triangles for a given number of index pairs.
|
|
64373
|
+
* qcount is the number of quads (each produces 2 triangles = 6 indices).
|
|
64374
|
+
* Returns the updated index write position.
|
|
64375
|
+
*/
|
|
64376
|
+
var buildLineDegenerateIndex = function (indices, ii, vertex, qcount) {
|
|
64377
|
+
for (var i = 0; i < qcount; ++i) {
|
|
64378
|
+
indices[++ii] = vertex;
|
|
64379
|
+
indices[++ii] = vertex;
|
|
64380
|
+
indices[++ii] = vertex;
|
|
64381
|
+
indices[++ii] = vertex;
|
|
64382
|
+
indices[++ii] = vertex;
|
|
64383
|
+
indices[++ii] = vertex;
|
|
64384
|
+
}
|
|
64385
|
+
return ii;
|
|
64386
|
+
};
|
|
64299
64387
|
var buildLineUv = function (uvs, steps, voffset, vcount, textureUvs, length) {
|
|
64300
64388
|
var lengthInverse = 1 / Math.max(LINE_FMIN, length);
|
|
64301
64389
|
var x0 = textureUvs.x0;
|
|
@@ -64322,7 +64410,7 @@ var buildLineUv = function (uvs, steps, voffset, vcount, textureUvs, length) {
|
|
|
64322
64410
|
}
|
|
64323
64411
|
};
|
|
64324
64412
|
var TRANSFORMED_POINT_VALUES;
|
|
64325
|
-
var
|
|
64413
|
+
var buildLineVertexStepAndIndex = function (vertices, steps, indices, ioffset, icount, voffset, vcount, pointCount, pointsClosed, pointValues, pointSegments, strokeWidth, strokeStyle, internalTransform) {
|
|
64326
64414
|
var transformedPointValues = TRANSFORMED_POINT_VALUES;
|
|
64327
64415
|
if (transformedPointValues == null) {
|
|
64328
64416
|
transformedPointValues = [];
|
|
@@ -64341,7 +64429,7 @@ var buildLineVertexStep = function (vertices, steps, voffset, vcount, pointCount
|
|
|
64341
64429
|
transformedPointValues[iv] = a * x + c * y + tx;
|
|
64342
64430
|
transformedPointValues[iv + 1] = b * x + d * y + ty;
|
|
64343
64431
|
}
|
|
64344
|
-
return
|
|
64432
|
+
return buildTransformedLineVertexStepAndIndex(vertices, steps, indices, ioffset, icount, voffset, vcount, pointCount, pointsClosed, transformedPointValues, pointSegments, strokeWidth, strokeStyle);
|
|
64345
64433
|
};
|
|
64346
64434
|
var fillTransformedLineVertexStep = function (iv, vertices, is, steps, px, py, strokeWidth, nprev, nnext, lprev, lnext, llo, e0, e1) {
|
|
64347
64435
|
var d = toNormalPacked(nprev, nnext);
|
|
@@ -64363,13 +64451,14 @@ var fillTransformedLineVertexStep = function (iv, vertices, is, steps, px, py, s
|
|
|
64363
64451
|
steps[++is] = llo;
|
|
64364
64452
|
steps[++is] = l;
|
|
64365
64453
|
};
|
|
64366
|
-
var
|
|
64454
|
+
var buildTransformedLineVertexStepAndIndex = function (vertices, steps, indices, ioffset, icount, voffset, vcount, lineVertexCount, lineIsClosed, lineVertices, lineSegments, strokeWidth, strokeStyle) {
|
|
64367
64455
|
var lineSegmentsLength = lineSegments.length;
|
|
64368
64456
|
if (0 < lineSegmentsLength) {
|
|
64369
64457
|
if (lineIsClosed) {
|
|
64370
64458
|
var lmax = 0;
|
|
64371
64459
|
var lprev = 0;
|
|
64372
64460
|
var ivoffset = voffset;
|
|
64461
|
+
var ii = ioffset * 3 - 1;
|
|
64373
64462
|
var iseg = 0;
|
|
64374
64463
|
var iprevseg = lineSegments[0];
|
|
64375
64464
|
for (var i = 1; i < lineSegmentsLength; ++i) {
|
|
@@ -64377,7 +64466,9 @@ var buildTransformedLineVertexStep = function (vertices, steps, voffset, vcount,
|
|
|
64377
64466
|
if (2 <= iseg - iprevseg) {
|
|
64378
64467
|
lprev = buildTransformedLineOpenSegmentVertexStep(vertices, steps, ivoffset, -1, lineVertices, iprevseg, iseg, lineVertexCount, strokeWidth, strokeStyle, lprev);
|
|
64379
64468
|
lmax = Math.max(lmax, lprev);
|
|
64380
|
-
|
|
64469
|
+
var lvcount = toLineVertexCount(iseg - iprevseg, false);
|
|
64470
|
+
ii = buildLineSegmentIndex(indices, ii, ivoffset, lvcount);
|
|
64471
|
+
ivoffset += lvcount;
|
|
64381
64472
|
}
|
|
64382
64473
|
iprevseg = iseg;
|
|
64383
64474
|
}
|
|
@@ -64386,23 +64477,33 @@ var buildTransformedLineVertexStep = function (vertices, steps, voffset, vcount,
|
|
|
64386
64477
|
if (2 <= iseg - iprevseg) {
|
|
64387
64478
|
lprev = buildTransformedLineOpenSegmentVertexStep(vertices, steps, ivoffset, voffset + vcount - ivoffset, lineVertices, iprevseg, iseg, lineVertexCount, strokeWidth, strokeStyle, lprev);
|
|
64388
64479
|
lmax = Math.max(lmax, lprev);
|
|
64389
|
-
|
|
64480
|
+
var lvcount = toLineVertexCount(iseg - iprevseg, false);
|
|
64481
|
+
ii = buildLineSegmentIndex(indices, ii, ivoffset, lvcount);
|
|
64482
|
+
ivoffset += lvcount;
|
|
64390
64483
|
}
|
|
64391
64484
|
else {
|
|
64392
64485
|
buildTransformedLineEmptyVertexStep(vertices, steps, ivoffset, voffset + vcount - ivoffset, lineVertices, iprevseg, iseg, lineVertexCount, strokeWidth, strokeStyle, lprev);
|
|
64393
64486
|
}
|
|
64487
|
+
// Fill remaining indices with degenerate triangles
|
|
64488
|
+
var rvcount = ((ioffset + icount) * 3 - 1 - ii) / 6;
|
|
64489
|
+
if (0 < rvcount) {
|
|
64490
|
+
ii = buildLineDegenerateIndex(indices, ii, Math.max(ivoffset - 1, voffset), rvcount);
|
|
64491
|
+
}
|
|
64394
64492
|
return lmax;
|
|
64395
64493
|
}
|
|
64396
64494
|
else {
|
|
64397
64495
|
var lmax = 0;
|
|
64398
64496
|
var lprev = 0;
|
|
64399
64497
|
var ivoffset = voffset;
|
|
64498
|
+
var ii = ioffset * 3 - 1;
|
|
64400
64499
|
// First
|
|
64401
64500
|
var iseg = lineSegments[0];
|
|
64402
64501
|
if (2 <= iseg) {
|
|
64403
64502
|
lprev = buildTransformedLineOpenSegmentVertexStep(vertices, steps, ivoffset, -1, lineVertices, 0, iseg, lineVertexCount, strokeWidth, strokeStyle, lprev);
|
|
64404
64503
|
lmax = Math.max(lmax, lprev);
|
|
64405
|
-
|
|
64504
|
+
var lvcount = toLineVertexCount(iseg, false);
|
|
64505
|
+
ii = buildLineSegmentIndex(indices, ii, ivoffset, lvcount);
|
|
64506
|
+
ivoffset += lvcount;
|
|
64406
64507
|
}
|
|
64407
64508
|
// Middle
|
|
64408
64509
|
var iprevseg = iseg;
|
|
@@ -64411,7 +64512,9 @@ var buildTransformedLineVertexStep = function (vertices, steps, voffset, vcount,
|
|
|
64411
64512
|
if (2 <= iseg - iprevseg) {
|
|
64412
64513
|
lprev = buildTransformedLineOpenSegmentVertexStep(vertices, steps, ivoffset, -1, lineVertices, iprevseg, iseg, lineVertexCount, strokeWidth, strokeStyle, lprev);
|
|
64413
64514
|
lmax = Math.max(lmax, lprev);
|
|
64414
|
-
|
|
64515
|
+
var lvcount = toLineVertexCount(iseg - iprevseg, false);
|
|
64516
|
+
ii = buildLineSegmentIndex(indices, ii, ivoffset, lvcount);
|
|
64517
|
+
ivoffset += lvcount;
|
|
64415
64518
|
}
|
|
64416
64519
|
iprevseg = iseg;
|
|
64417
64520
|
}
|
|
@@ -64420,15 +64523,23 @@ var buildTransformedLineVertexStep = function (vertices, steps, voffset, vcount,
|
|
|
64420
64523
|
if (2 <= iseg - iprevseg) {
|
|
64421
64524
|
lprev = buildTransformedLineOpenSegmentVertexStep(vertices, steps, ivoffset, voffset + vcount - ivoffset, lineVertices, iprevseg, iseg, lineVertexCount, strokeWidth, strokeStyle, lprev);
|
|
64422
64525
|
lmax = Math.max(lmax, lprev);
|
|
64423
|
-
|
|
64526
|
+
var lvcount = toLineVertexCount(iseg - iprevseg, false);
|
|
64527
|
+
ii = buildLineSegmentIndex(indices, ii, ivoffset, lvcount);
|
|
64528
|
+
ivoffset += lvcount;
|
|
64424
64529
|
}
|
|
64425
64530
|
else {
|
|
64426
64531
|
buildTransformedLineEmptyVertexStep(vertices, steps, ivoffset, voffset + vcount - ivoffset, lineVertices, iprevseg, iseg, lineVertexCount, strokeWidth, strokeStyle, lprev);
|
|
64427
64532
|
}
|
|
64533
|
+
// Fill remaining indices with degenerate triangles
|
|
64534
|
+
var rvcount = ((ioffset + icount) * 3 - 1 - ii) / 6;
|
|
64535
|
+
if (0 < rvcount) {
|
|
64536
|
+
ii = buildLineDegenerateIndex(indices, ii, Math.max(ivoffset - 1, voffset), rvcount);
|
|
64537
|
+
}
|
|
64428
64538
|
return lmax;
|
|
64429
64539
|
}
|
|
64430
64540
|
}
|
|
64431
64541
|
else {
|
|
64542
|
+
buildLineIndex(indices, voffset, ioffset, icount);
|
|
64432
64543
|
if (lineIsClosed) {
|
|
64433
64544
|
return buildTransformedLineClosedSegmentVertexStep(vertices, steps, voffset, vcount, lineVertices, 0, lineVertexCount, lineVertexCount, strokeWidth, strokeStyle);
|
|
64434
64545
|
}
|
|
@@ -64497,10 +64608,13 @@ var buildTransformedLineOpenSegmentVertexStep = function (vertices, steps, voffs
|
|
|
64497
64608
|
var iv = (voffset << 1) - 1;
|
|
64498
64609
|
var is = voffset * 6 - 1;
|
|
64499
64610
|
var l = 0;
|
|
64500
|
-
|
|
64611
|
+
var headx = px - nprev[1] * LINE_EXTRA_LENGTH;
|
|
64612
|
+
var heady = py + nprev[0] * LINE_EXTRA_LENGTH;
|
|
64613
|
+
var lhead = -LINE_EXTRA_LENGTH;
|
|
64614
|
+
fillTransformedLineVertexStep(iv, vertices, is, steps, headx, heady, strokeWidth, nprev, nnext, lprev, lnext, lhead, e3, e5);
|
|
64501
64615
|
iv += 4;
|
|
64502
64616
|
is += 12;
|
|
64503
|
-
fillTransformedLineVertexStep(iv, vertices, is, steps,
|
|
64617
|
+
fillTransformedLineVertexStep(iv, vertices, is, steps, headx, heady, strokeWidth, nprev, nnext, lprev, lnext, lhead, e4, e6);
|
|
64504
64618
|
iv += 4;
|
|
64505
64619
|
is += 12;
|
|
64506
64620
|
// Middle segments
|
|
@@ -64539,18 +64653,18 @@ var buildTransformedLineOpenSegmentVertexStep = function (vertices, steps, voffs
|
|
|
64539
64653
|
toVector(px, py, pnextx, pnexty, nnext);
|
|
64540
64654
|
toNormal(nnext, lnext);
|
|
64541
64655
|
l += lprev;
|
|
64542
|
-
|
|
64656
|
+
var tailx = px + nnext[1] * LINE_EXTRA_LENGTH;
|
|
64657
|
+
var taily = py - nnext[0] * LINE_EXTRA_LENGTH;
|
|
64658
|
+
var ltrail = l + LINE_EXTRA_LENGTH;
|
|
64659
|
+
fillTransformedLineVertexStep(iv, vertices, is, steps, tailx, taily, strokeWidth, nprev, nnext, lprev, lnext, ltrail, e3, e5);
|
|
64543
64660
|
iv += 4;
|
|
64544
64661
|
is += 12;
|
|
64545
|
-
fillTransformedLineVertexStep(iv, vertices, is, steps,
|
|
64662
|
+
fillTransformedLineVertexStep(iv, vertices, is, steps, tailx, taily, strokeWidth, nprev, nnext, lprev, lnext, ltrail, e4, e6);
|
|
64546
64663
|
iv += 4;
|
|
64547
64664
|
is += 12;
|
|
64548
64665
|
// Total length
|
|
64549
64666
|
var is0 = voffset * 6 - 1;
|
|
64550
|
-
for (var i = is0
|
|
64551
|
-
steps[i + 5] = length;
|
|
64552
|
-
}
|
|
64553
|
-
for (var i = is0 + 12; i < is; i += 6) {
|
|
64667
|
+
for (var i = is0; i < is; i += 6) {
|
|
64554
64668
|
steps[i + 5] = l;
|
|
64555
64669
|
}
|
|
64556
64670
|
// Fill the rest
|
|
@@ -64688,12 +64802,7 @@ var BuilderLine = /** @class */ (function (_super) {
|
|
|
64688
64802
|
_this.length = 1;
|
|
64689
64803
|
return _this;
|
|
64690
64804
|
}
|
|
64691
|
-
BuilderLine.prototype.init = function () {
|
|
64692
|
-
var buffer = this.buffer;
|
|
64693
|
-
buffer.updateIndices();
|
|
64694
|
-
buildLineIndex(buffer.indices, this.vertexOffset, this.indexOffset, this.indexCount);
|
|
64695
|
-
this.inited |= BuilderFlag.INDEX;
|
|
64696
|
-
};
|
|
64805
|
+
BuilderLine.prototype.init = function () { };
|
|
64697
64806
|
BuilderLine.prototype.reinit = function (buffer, shape, vertexOffset, indexOffset) {
|
|
64698
64807
|
var pointCount = toLinePointCount(shape.points);
|
|
64699
64808
|
var vertexCount = toLineVertexCount(pointCount, true);
|
|
@@ -64727,11 +64836,11 @@ var BuilderLine = /** @class */ (function (_super) {
|
|
|
64727
64836
|
};
|
|
64728
64837
|
BuilderLine.prototype.update = function (shape) {
|
|
64729
64838
|
var buffer = this.buffer;
|
|
64730
|
-
this.
|
|
64839
|
+
this.updateLineVertexStepAndIndex(buffer, shape);
|
|
64731
64840
|
this.updateColor(buffer, shape);
|
|
64732
64841
|
this.updateLineUv(buffer, shape);
|
|
64733
64842
|
};
|
|
64734
|
-
BuilderLine.prototype.
|
|
64843
|
+
BuilderLine.prototype.updateLineVertexStepAndIndex = function (buffer, shape) {
|
|
64735
64844
|
var points = shape.points;
|
|
64736
64845
|
if (points) {
|
|
64737
64846
|
var pointId = points.id;
|
|
@@ -64747,9 +64856,9 @@ var BuilderLine = /** @class */ (function (_super) {
|
|
|
64747
64856
|
var isStrokeWidthChanged = this.strokeWidth !== strokeWidth || this.strokeStyle !== strokeStyle;
|
|
64748
64857
|
var transformLocalId = toTransformLocalId(shape);
|
|
64749
64858
|
var isTransformChanged = this.transformLocalId !== transformLocalId;
|
|
64750
|
-
var isNotInited = !(this.inited & BuilderFlag.
|
|
64859
|
+
var isNotInited = !(this.inited & BuilderFlag.VERTEX_STEP_AND_INDEX);
|
|
64751
64860
|
if (isNotInited || isPointChanged || isTransformChanged || isStrokeWidthChanged) {
|
|
64752
|
-
this.inited |= BuilderFlag.
|
|
64861
|
+
this.inited |= BuilderFlag.VERTEX_STEP_AND_INDEX;
|
|
64753
64862
|
this.pointId = pointId;
|
|
64754
64863
|
this.pointCount = pointCount;
|
|
64755
64864
|
this.pointsClosed = pointsClosed;
|
|
@@ -64762,7 +64871,8 @@ var BuilderLine = /** @class */ (function (_super) {
|
|
|
64762
64871
|
}
|
|
64763
64872
|
buffer.updateVertices();
|
|
64764
64873
|
buffer.updateSteps();
|
|
64765
|
-
|
|
64874
|
+
buffer.updateIndices();
|
|
64875
|
+
this.length = buildLineVertexStepAndIndex(buffer.vertices, buffer.steps, buffer.indices, this.indexOffset, this.indexCount, this.vertexOffset, this.vertexCount, this.pointCount, this.pointsClosed, formatted.values, formatted.segments, strokeWidth, strokeStyle, shape.transform.internalTransform);
|
|
64766
64876
|
}
|
|
64767
64877
|
}
|
|
64768
64878
|
};
|
|
@@ -106074,6 +106184,7 @@ exports.EShapeRendererIteratorDatum = EShapeRendererIteratorDatum;
|
|
|
106074
106184
|
exports.EShapeResourceManagerDeserialization = EShapeResourceManagerDeserialization;
|
|
106075
106185
|
exports.EShapeResourceManagerDeserializationMode = EShapeResourceManagerDeserializationMode;
|
|
106076
106186
|
exports.EShapeResourceManagerSerialization = EShapeResourceManagerSerialization;
|
|
106187
|
+
exports.EShapeRuntimeDragStates = EShapeRuntimeDragStates;
|
|
106077
106188
|
exports.EShapeRuntimeImpl = EShapeRuntimeImpl;
|
|
106078
106189
|
exports.EShapeRuntimeReset = EShapeRuntimeReset;
|
|
106079
106190
|
exports.EShapeRuntimes = EShapeRuntimes;
|
|
@@ -106236,7 +106347,7 @@ exports.buildImageSdfVertex = buildImageSdfVertex;
|
|
|
106236
106347
|
exports.buildLineIndex = buildLineIndex;
|
|
106237
106348
|
exports.buildLineOfAnyColor = buildLineOfAnyColor;
|
|
106238
106349
|
exports.buildLineUv = buildLineUv;
|
|
106239
|
-
exports.
|
|
106350
|
+
exports.buildLineVertexStepAndIndex = buildLineVertexStepAndIndex;
|
|
106240
106351
|
exports.buildNullIndex = buildNullIndex;
|
|
106241
106352
|
exports.buildNullStep = buildNullStep;
|
|
106242
106353
|
exports.buildNullUv = buildNullUv;
|