modern-canvas 0.10.3 → 0.12.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/index.cjs +797 -1309
- package/dist/index.d.cts +70 -215
- package/dist/index.d.mts +70 -215
- package/dist/index.d.ts +70 -215
- package/dist/index.js +125 -62
- package/dist/index.mjs +798 -1310
- package/package.json +7 -7
package/dist/index.cjs
CHANGED
|
@@ -1137,6 +1137,9 @@ class Vector extends modernIdoc.Observable {
|
|
|
1137
1137
|
toArray() {
|
|
1138
1138
|
return this._array.slice();
|
|
1139
1139
|
}
|
|
1140
|
+
toFloat32Array() {
|
|
1141
|
+
return new Float32Array(this._array);
|
|
1142
|
+
}
|
|
1140
1143
|
toJSON() {
|
|
1141
1144
|
return this.toArray();
|
|
1142
1145
|
}
|
|
@@ -1274,6 +1277,9 @@ class Matrix extends modernIdoc.Observable {
|
|
|
1274
1277
|
}
|
|
1275
1278
|
return array.slice();
|
|
1276
1279
|
}
|
|
1280
|
+
toFloat32Array(transpose) {
|
|
1281
|
+
return new Float32Array(this.toArray(transpose));
|
|
1282
|
+
}
|
|
1277
1283
|
toName() {
|
|
1278
1284
|
return `Matrix${this.rows}(${this.rows}x${this.cols})`;
|
|
1279
1285
|
}
|
|
@@ -2097,13 +2103,13 @@ class Vector3 extends Vector {
|
|
|
2097
2103
|
}
|
|
2098
2104
|
}
|
|
2099
2105
|
|
|
2100
|
-
var __defProp$
|
|
2101
|
-
var __decorateClass
|
|
2106
|
+
var __defProp$Q = Object.defineProperty;
|
|
2107
|
+
var __decorateClass$U = (decorators, target, key, kind) => {
|
|
2102
2108
|
var result = void 0 ;
|
|
2103
2109
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
2104
2110
|
if (decorator = decorators[i])
|
|
2105
2111
|
result = (decorator(target, key, result) ) || result;
|
|
2106
|
-
if (result) __defProp$
|
|
2112
|
+
if (result) __defProp$Q(target, key, result);
|
|
2107
2113
|
return result;
|
|
2108
2114
|
};
|
|
2109
2115
|
class MainLoop extends CoreObject {
|
|
@@ -2151,20 +2157,20 @@ class MainLoop extends CoreObject {
|
|
|
2151
2157
|
super.destroy();
|
|
2152
2158
|
}
|
|
2153
2159
|
}
|
|
2154
|
-
__decorateClass
|
|
2160
|
+
__decorateClass$U([
|
|
2155
2161
|
modernIdoc.property({ fallback: 60 })
|
|
2156
2162
|
], MainLoop.prototype, "fps");
|
|
2157
|
-
__decorateClass
|
|
2163
|
+
__decorateClass$U([
|
|
2158
2164
|
modernIdoc.property({ fallback: 1 })
|
|
2159
2165
|
], MainLoop.prototype, "speed");
|
|
2160
2166
|
|
|
2161
|
-
var __defProp$
|
|
2162
|
-
var __decorateClass$
|
|
2167
|
+
var __defProp$P = Object.defineProperty;
|
|
2168
|
+
var __decorateClass$T = (decorators, target, key, kind) => {
|
|
2163
2169
|
var result = void 0 ;
|
|
2164
2170
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
2165
2171
|
if (decorator = decorators[i])
|
|
2166
2172
|
result = (decorator(target, key, result) ) || result;
|
|
2167
|
-
if (result) __defProp$
|
|
2173
|
+
if (result) __defProp$P(target, key, result);
|
|
2168
2174
|
return result;
|
|
2169
2175
|
};
|
|
2170
2176
|
class Renderer extends modernIdoc.Reactivable {
|
|
@@ -2208,10 +2214,10 @@ class Renderer extends modernIdoc.Reactivable {
|
|
|
2208
2214
|
super.destroy();
|
|
2209
2215
|
}
|
|
2210
2216
|
}
|
|
2211
|
-
__decorateClass$
|
|
2217
|
+
__decorateClass$T([
|
|
2212
2218
|
modernIdoc.property({ fallback: DEVICE_PIXEL_RATIO })
|
|
2213
2219
|
], Renderer.prototype, "pixelRatio");
|
|
2214
|
-
__decorateClass$
|
|
2220
|
+
__decorateClass$T([
|
|
2215
2221
|
modernIdoc.property({ internal: true })
|
|
2216
2222
|
], Renderer.prototype, "view");
|
|
2217
2223
|
|
|
@@ -2443,6 +2449,8 @@ class WebGLBatch2DModule extends WebGLModule {
|
|
|
2443
2449
|
// 1
|
|
2444
2450
|
aPosition: { size: 2, normalized: false, type: "float" },
|
|
2445
2451
|
// 2
|
|
2452
|
+
aDimension: { size: 2, normalized: false, type: "float" },
|
|
2453
|
+
// 2
|
|
2446
2454
|
aUv: { size: 2, normalized: false, type: "float" },
|
|
2447
2455
|
// 2
|
|
2448
2456
|
aModulate: { size: 4, normalized: true, type: "unsigned_byte" },
|
|
@@ -2452,7 +2460,7 @@ class WebGLBatch2DModule extends WebGLModule {
|
|
|
2452
2460
|
aDisableWrapMode: { size: 1, normalized: true, type: "float" }
|
|
2453
2461
|
// 1
|
|
2454
2462
|
};
|
|
2455
|
-
_vertexSize = 1 + 2 + 2 + 1 + 1 + 1;
|
|
2463
|
+
_vertexSize = 1 + 2 + 2 + 2 + 1 + 1 + 1;
|
|
2456
2464
|
_getShader(maxTextureUnits) {
|
|
2457
2465
|
let shader = this._shaders.get(maxTextureUnits);
|
|
2458
2466
|
if (!shader) {
|
|
@@ -2466,6 +2474,7 @@ class WebGLBatch2DModule extends WebGLModule {
|
|
|
2466
2474
|
vert: `precision highp float;
|
|
2467
2475
|
attribute float aTextureId;
|
|
2468
2476
|
attribute vec2 aPosition;
|
|
2477
|
+
attribute vec2 aDimension;
|
|
2469
2478
|
attribute vec2 aUv;
|
|
2470
2479
|
attribute vec4 aModulate;
|
|
2471
2480
|
attribute vec4 aBackgroundColor;
|
|
@@ -2474,30 +2483,20 @@ attribute float aDisableWrapMode;
|
|
|
2474
2483
|
uniform mat3 projectionMatrix;
|
|
2475
2484
|
uniform mat3 viewMatrix;
|
|
2476
2485
|
uniform vec4 modulate;
|
|
2477
|
-
uniform float canvasWidth;
|
|
2478
|
-
uniform float canvasHeight;
|
|
2479
2486
|
|
|
2480
2487
|
varying float vTextureId;
|
|
2488
|
+
varying vec2 vDimension;
|
|
2481
2489
|
varying vec2 vUv;
|
|
2482
2490
|
varying vec4 vModulate;
|
|
2483
2491
|
varying vec4 vBackgroundColor;
|
|
2484
2492
|
varying float vDisableWrapMode;
|
|
2485
2493
|
|
|
2486
|
-
vec2 roundPixels(vec2 position, vec2 targetSize) {
|
|
2487
|
-
return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0;
|
|
2488
|
-
}
|
|
2489
|
-
|
|
2490
2494
|
void main(void) {
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
0.0, 1.0, 0.0,
|
|
2494
|
-
0.0, 0.0, 1.0
|
|
2495
|
-
);
|
|
2496
|
-
vTextureId = aTextureId;
|
|
2497
|
-
vec3 pos = projectionMatrix * viewMatrix * modelMatrix * vec3(aPosition, 1.0);
|
|
2498
|
-
gl_Position = vec4(roundPixels(pos.xy, vec2(canvasWidth, canvasHeight)), 0.0, 1.0);
|
|
2499
|
-
// gl_Position = vec4(pos.xy, 0.0, 1.0);
|
|
2495
|
+
vec3 pos3 = projectionMatrix * viewMatrix * vec3(aPosition.xy, 1.0);
|
|
2496
|
+
gl_Position = vec4(pos3.xy, 0.0, 1.0);
|
|
2500
2497
|
|
|
2498
|
+
vTextureId = aTextureId;
|
|
2499
|
+
vDimension = aDimension;
|
|
2501
2500
|
vUv = aUv;
|
|
2502
2501
|
vModulate = aModulate * modulate;
|
|
2503
2502
|
vBackgroundColor = aBackgroundColor;
|
|
@@ -2505,16 +2504,27 @@ void main(void) {
|
|
|
2505
2504
|
}`,
|
|
2506
2505
|
frag: `precision highp float;
|
|
2507
2506
|
varying float vTextureId;
|
|
2507
|
+
varying vec2 vDimension;
|
|
2508
2508
|
varying vec2 vUv;
|
|
2509
2509
|
varying vec4 vModulate;
|
|
2510
2510
|
varying vec4 vBackgroundColor;
|
|
2511
2511
|
varying float vDisableWrapMode;
|
|
2512
2512
|
|
|
2513
|
+
uniform mat3 viewMatrix;
|
|
2513
2514
|
uniform sampler2D samplers[${maxTextureUnits}];
|
|
2515
|
+
uniform vec2 zoom;
|
|
2516
|
+
uniform vec2 translate;
|
|
2514
2517
|
|
|
2515
2518
|
void main(void) {
|
|
2519
|
+
vec2 uv = vUv;
|
|
2520
|
+
|
|
2521
|
+
if (vDimension.x > 0.0 && vDimension.y > 0.0) {
|
|
2522
|
+
uv = floor(uv * vDimension);
|
|
2523
|
+
uv = uv / vDimension;
|
|
2524
|
+
}
|
|
2525
|
+
|
|
2516
2526
|
vec4 color = vec4(0.0, 0.0, 0.0, 0.0);
|
|
2517
|
-
if (vDisableWrapMode > 0.0 && (
|
|
2527
|
+
if (vDisableWrapMode > 0.0 && (uv.x < 0.0 || uv.y < 0.0 || uv.x > 1.0 || uv.y > 1.0))
|
|
2518
2528
|
{
|
|
2519
2529
|
//
|
|
2520
2530
|
}
|
|
@@ -2533,7 +2543,7 @@ void main(void) {
|
|
|
2533
2543
|
}
|
|
2534
2544
|
return `${text}
|
|
2535
2545
|
{
|
|
2536
|
-
color = texture2D(samplers[${i}],
|
|
2546
|
+
color = texture2D(samplers[${i}], uv);
|
|
2537
2547
|
}`;
|
|
2538
2548
|
}).join("")}
|
|
2539
2549
|
|
|
@@ -2579,11 +2589,12 @@ void main(void) {
|
|
|
2579
2589
|
draw: (options) => {
|
|
2580
2590
|
const renderer2 = this._renderer;
|
|
2581
2591
|
renderer2.program.bind(program);
|
|
2592
|
+
const viewMatrix = renderer2.program.uniforms.viewMatrix;
|
|
2582
2593
|
renderer2.program.updateUniforms(program, {
|
|
2583
2594
|
samplers,
|
|
2584
2595
|
modulate: [1, 1, 1, 1],
|
|
2585
|
-
|
|
2586
|
-
|
|
2596
|
+
zoom: [viewMatrix[0], viewMatrix[4]],
|
|
2597
|
+
translate: [viewMatrix[6], viewMatrix[7]],
|
|
2587
2598
|
...renderer2.program.uniforms
|
|
2588
2599
|
});
|
|
2589
2600
|
renderer2.vertexArray.bind(vao ?? vertexArray);
|
|
@@ -2640,7 +2651,8 @@ void main(void) {
|
|
|
2640
2651
|
const {
|
|
2641
2652
|
indices,
|
|
2642
2653
|
vertices,
|
|
2643
|
-
uvs =
|
|
2654
|
+
uvs = new Float32Array(0),
|
|
2655
|
+
dimension = new Float32Array(0),
|
|
2644
2656
|
texture: texture2,
|
|
2645
2657
|
modulate = this._defaultModulate,
|
|
2646
2658
|
backgroundColor = this._defaultBackgroundColor,
|
|
@@ -2662,6 +2674,8 @@ void main(void) {
|
|
|
2662
2674
|
float32View[aIndex++] = textureLocation;
|
|
2663
2675
|
float32View[aIndex++] = vertices[i2];
|
|
2664
2676
|
float32View[aIndex++] = vertices[i2 + 1];
|
|
2677
|
+
float32View[aIndex++] = dimension[0];
|
|
2678
|
+
float32View[aIndex++] = dimension[1];
|
|
2665
2679
|
float32View[aIndex++] = uvs[i2];
|
|
2666
2680
|
float32View[aIndex++] = uvs[i2 + 1];
|
|
2667
2681
|
if (modulate) {
|
|
@@ -2719,11 +2733,6 @@ void main(void) {
|
|
|
2719
2733
|
});
|
|
2720
2734
|
}
|
|
2721
2735
|
}
|
|
2722
|
-
/**
|
|
2723
|
-
* Fetches an attribute buffer from `this._attributeBuffer` that can hold atleast `size` floats.
|
|
2724
|
-
* @param size - minimum capacity required
|
|
2725
|
-
* @returns - buffer than can hold atleast `size` floats
|
|
2726
|
-
*/
|
|
2727
2736
|
_getAttributeBuffer(size) {
|
|
2728
2737
|
const roundedP2 = nextPow2(Math.ceil(size / 8));
|
|
2729
2738
|
const roundedSizeIndex = log2(roundedP2);
|
|
@@ -2737,12 +2746,6 @@ void main(void) {
|
|
|
2737
2746
|
}
|
|
2738
2747
|
return buffer;
|
|
2739
2748
|
}
|
|
2740
|
-
/**
|
|
2741
|
-
* Fetches an index buffer from `this._indexBuffers` that can
|
|
2742
|
-
* have at least `size` capacity.
|
|
2743
|
-
* @param size - minimum required capacity
|
|
2744
|
-
* @returns - buffer that can fit `size` indices.
|
|
2745
|
-
*/
|
|
2746
2749
|
_getIndexBuffer(size) {
|
|
2747
2750
|
const roundedP2 = nextPow2(Math.ceil(size / 12));
|
|
2748
2751
|
const roundedSizeIndex = log2(roundedP2);
|
|
@@ -4411,13 +4414,13 @@ class Geometry extends Resource {
|
|
|
4411
4414
|
}
|
|
4412
4415
|
}
|
|
4413
4416
|
|
|
4414
|
-
var __defProp$
|
|
4415
|
-
var __decorateClass$
|
|
4417
|
+
var __defProp$O = Object.defineProperty;
|
|
4418
|
+
var __decorateClass$S = (decorators, target, key, kind) => {
|
|
4416
4419
|
var result = void 0 ;
|
|
4417
4420
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
4418
4421
|
if (decorator = decorators[i])
|
|
4419
4422
|
result = (decorator(target, key, result) ) || result;
|
|
4420
|
-
if (result) __defProp$
|
|
4423
|
+
if (result) __defProp$O(target, key, result);
|
|
4421
4424
|
return result;
|
|
4422
4425
|
};
|
|
4423
4426
|
class IndexBuffer extends Resource {
|
|
@@ -4461,20 +4464,20 @@ class IndexBuffer extends Resource {
|
|
|
4461
4464
|
return result;
|
|
4462
4465
|
}
|
|
4463
4466
|
}
|
|
4464
|
-
__decorateClass$
|
|
4467
|
+
__decorateClass$S([
|
|
4465
4468
|
modernIdoc.property({ internal: true, fallback: null })
|
|
4466
4469
|
], IndexBuffer.prototype, "data");
|
|
4467
|
-
__decorateClass$
|
|
4470
|
+
__decorateClass$S([
|
|
4468
4471
|
modernIdoc.property({ internal: true, fallback: false })
|
|
4469
4472
|
], IndexBuffer.prototype, "dynamic");
|
|
4470
4473
|
|
|
4471
|
-
var __defProp$
|
|
4472
|
-
var __decorateClass$
|
|
4474
|
+
var __defProp$N = Object.defineProperty;
|
|
4475
|
+
var __decorateClass$R = (decorators, target, key, kind) => {
|
|
4473
4476
|
var result = void 0 ;
|
|
4474
4477
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
4475
4478
|
if (decorator = decorators[i])
|
|
4476
4479
|
result = (decorator(target, key, result) ) || result;
|
|
4477
|
-
if (result) __defProp$
|
|
4480
|
+
if (result) __defProp$N(target, key, result);
|
|
4478
4481
|
return result;
|
|
4479
4482
|
};
|
|
4480
4483
|
class VertexBuffer extends Resource {
|
|
@@ -4518,20 +4521,20 @@ class VertexBuffer extends Resource {
|
|
|
4518
4521
|
return result;
|
|
4519
4522
|
}
|
|
4520
4523
|
}
|
|
4521
|
-
__decorateClass$
|
|
4524
|
+
__decorateClass$R([
|
|
4522
4525
|
modernIdoc.property({ internal: true, default: null })
|
|
4523
4526
|
], VertexBuffer.prototype, "data");
|
|
4524
|
-
__decorateClass$
|
|
4527
|
+
__decorateClass$R([
|
|
4525
4528
|
modernIdoc.property({ internal: true, fallback: false })
|
|
4526
4529
|
], VertexBuffer.prototype, "dynamic");
|
|
4527
4530
|
|
|
4528
|
-
var __defProp$
|
|
4529
|
-
var __decorateClass$
|
|
4531
|
+
var __defProp$M = Object.defineProperty;
|
|
4532
|
+
var __decorateClass$Q = (decorators, target, key, kind) => {
|
|
4530
4533
|
var result = void 0 ;
|
|
4531
4534
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
4532
4535
|
if (decorator = decorators[i])
|
|
4533
4536
|
result = (decorator(target, key, result) ) || result;
|
|
4534
|
-
if (result) __defProp$
|
|
4537
|
+
if (result) __defProp$M(target, key, result);
|
|
4535
4538
|
return result;
|
|
4536
4539
|
};
|
|
4537
4540
|
class VertexAttribute extends Resource {
|
|
@@ -4565,25 +4568,25 @@ class VertexAttribute extends Resource {
|
|
|
4565
4568
|
return result;
|
|
4566
4569
|
}
|
|
4567
4570
|
}
|
|
4568
|
-
__decorateClass$
|
|
4571
|
+
__decorateClass$Q([
|
|
4569
4572
|
modernIdoc.property({ internal: true })
|
|
4570
4573
|
], VertexAttribute.prototype, "buffer");
|
|
4571
|
-
__decorateClass$
|
|
4574
|
+
__decorateClass$Q([
|
|
4572
4575
|
modernIdoc.property({ fallback: 0 })
|
|
4573
4576
|
], VertexAttribute.prototype, "size");
|
|
4574
|
-
__decorateClass$
|
|
4577
|
+
__decorateClass$Q([
|
|
4575
4578
|
modernIdoc.property({ fallback: false })
|
|
4576
4579
|
], VertexAttribute.prototype, "normalized");
|
|
4577
|
-
__decorateClass$
|
|
4580
|
+
__decorateClass$Q([
|
|
4578
4581
|
modernIdoc.property({ fallback: "float" })
|
|
4579
4582
|
], VertexAttribute.prototype, "type");
|
|
4580
|
-
__decorateClass$
|
|
4583
|
+
__decorateClass$Q([
|
|
4581
4584
|
modernIdoc.property()
|
|
4582
4585
|
], VertexAttribute.prototype, "stride");
|
|
4583
|
-
__decorateClass$
|
|
4586
|
+
__decorateClass$Q([
|
|
4584
4587
|
modernIdoc.property()
|
|
4585
4588
|
], VertexAttribute.prototype, "offset");
|
|
4586
|
-
__decorateClass$
|
|
4589
|
+
__decorateClass$Q([
|
|
4587
4590
|
modernIdoc.property()
|
|
4588
4591
|
], VertexAttribute.prototype, "divisor");
|
|
4589
4592
|
|
|
@@ -4827,13 +4830,13 @@ class UvGeometry extends Geometry {
|
|
|
4827
4830
|
}
|
|
4828
4831
|
}
|
|
4829
4832
|
|
|
4830
|
-
var __defProp$
|
|
4831
|
-
var __decorateClass$
|
|
4833
|
+
var __defProp$L = Object.defineProperty;
|
|
4834
|
+
var __decorateClass$P = (decorators, target, key, kind) => {
|
|
4832
4835
|
var result = void 0 ;
|
|
4833
4836
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
4834
4837
|
if (decorator = decorators[i])
|
|
4835
4838
|
result = (decorator(target, key, result) ) || result;
|
|
4836
|
-
if (result) __defProp$
|
|
4839
|
+
if (result) __defProp$L(target, key, result);
|
|
4837
4840
|
return result;
|
|
4838
4841
|
};
|
|
4839
4842
|
class Texture2D extends Resource {
|
|
@@ -4857,9 +4860,6 @@ class Texture2D extends Resource {
|
|
|
4857
4860
|
}
|
|
4858
4861
|
_isPowerOfTwo = false;
|
|
4859
4862
|
_needsUpload = false;
|
|
4860
|
-
get valid() {
|
|
4861
|
-
return Boolean(this.width && this.height);
|
|
4862
|
-
}
|
|
4863
4863
|
get realWidth() {
|
|
4864
4864
|
return Math.round(this.width * this.pixelRatio);
|
|
4865
4865
|
}
|
|
@@ -4871,6 +4871,9 @@ class Texture2D extends Resource {
|
|
|
4871
4871
|
this.source = source;
|
|
4872
4872
|
this._updateSize();
|
|
4873
4873
|
}
|
|
4874
|
+
isValid() {
|
|
4875
|
+
return Boolean(this.width && this.height);
|
|
4876
|
+
}
|
|
4874
4877
|
/** @internal */
|
|
4875
4878
|
_glTextureOptions(renderer, options) {
|
|
4876
4879
|
let wrapMode = this.wrapMode;
|
|
@@ -4930,7 +4933,7 @@ class Texture2D extends Resource {
|
|
|
4930
4933
|
this._needsUpload = true;
|
|
4931
4934
|
}
|
|
4932
4935
|
upload(renderer, options) {
|
|
4933
|
-
if (this._needsUpload && this.
|
|
4936
|
+
if (this._needsUpload && this.isValid()) {
|
|
4934
4937
|
this._needsUpload = false;
|
|
4935
4938
|
renderer.texture.update(
|
|
4936
4939
|
this._glTexture(renderer, options),
|
|
@@ -4941,7 +4944,7 @@ class Texture2D extends Resource {
|
|
|
4941
4944
|
return false;
|
|
4942
4945
|
}
|
|
4943
4946
|
activate(renderer, location = 0) {
|
|
4944
|
-
if (this.
|
|
4947
|
+
if (this.isValid()) {
|
|
4945
4948
|
renderer.texture.bind({
|
|
4946
4949
|
target: "texture_2d",
|
|
4947
4950
|
value: this._glTexture(renderer, { location }),
|
|
@@ -4961,22 +4964,22 @@ class Texture2D extends Resource {
|
|
|
4961
4964
|
}
|
|
4962
4965
|
}
|
|
4963
4966
|
}
|
|
4964
|
-
__decorateClass$
|
|
4967
|
+
__decorateClass$P([
|
|
4965
4968
|
modernIdoc.property({ internal: true })
|
|
4966
4969
|
], Texture2D.prototype, "source");
|
|
4967
|
-
__decorateClass$
|
|
4970
|
+
__decorateClass$P([
|
|
4968
4971
|
modernIdoc.property({ fallback: 0 })
|
|
4969
4972
|
], Texture2D.prototype, "width");
|
|
4970
|
-
__decorateClass$
|
|
4973
|
+
__decorateClass$P([
|
|
4971
4974
|
modernIdoc.property({ fallback: 0 })
|
|
4972
4975
|
], Texture2D.prototype, "height");
|
|
4973
|
-
__decorateClass$
|
|
4976
|
+
__decorateClass$P([
|
|
4974
4977
|
modernIdoc.property({ fallback: "linear" })
|
|
4975
4978
|
], Texture2D.prototype, "filterMode");
|
|
4976
|
-
__decorateClass$
|
|
4979
|
+
__decorateClass$P([
|
|
4977
4980
|
modernIdoc.property({ fallback: "clamp_to_edge" })
|
|
4978
4981
|
], Texture2D.prototype, "wrapMode");
|
|
4979
|
-
__decorateClass$
|
|
4982
|
+
__decorateClass$P([
|
|
4980
4983
|
modernIdoc.property({ fallback: 1 })
|
|
4981
4984
|
], Texture2D.prototype, "pixelRatio");
|
|
4982
4985
|
|
|
@@ -5010,13 +5013,13 @@ class AnimatedTexture extends Resource {
|
|
|
5010
5013
|
}
|
|
5011
5014
|
}
|
|
5012
5015
|
|
|
5013
|
-
var __defProp$
|
|
5014
|
-
var __decorateClass$
|
|
5016
|
+
var __defProp$K = Object.defineProperty;
|
|
5017
|
+
var __decorateClass$O = (decorators, target, key, kind) => {
|
|
5015
5018
|
var result = void 0 ;
|
|
5016
5019
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
5017
5020
|
if (decorator = decorators[i])
|
|
5018
5021
|
result = (decorator(target, key, result) ) || result;
|
|
5019
|
-
if (result) __defProp$
|
|
5022
|
+
if (result) __defProp$K(target, key, result);
|
|
5020
5023
|
return result;
|
|
5021
5024
|
};
|
|
5022
5025
|
class CanvasTexture extends Texture2D {
|
|
@@ -5035,7 +5038,7 @@ class CanvasTexture extends Texture2D {
|
|
|
5035
5038
|
super._updateProperty(key, value, oldValue);
|
|
5036
5039
|
}
|
|
5037
5040
|
}
|
|
5038
|
-
__decorateClass$
|
|
5041
|
+
__decorateClass$O([
|
|
5039
5042
|
modernIdoc.property({ fallback: 2 })
|
|
5040
5043
|
], CanvasTexture.prototype, "pixelRatio");
|
|
5041
5044
|
|
|
@@ -5257,13 +5260,13 @@ class PixelsTexture extends Texture2D {
|
|
|
5257
5260
|
}
|
|
5258
5261
|
}
|
|
5259
5262
|
|
|
5260
|
-
var __defProp$
|
|
5261
|
-
var __decorateClass$
|
|
5263
|
+
var __defProp$J = Object.defineProperty;
|
|
5264
|
+
var __decorateClass$N = (decorators, target, key, kind) => {
|
|
5262
5265
|
var result = void 0 ;
|
|
5263
5266
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
5264
5267
|
if (decorator = decorators[i])
|
|
5265
5268
|
result = (decorator(target, key, result) ) || result;
|
|
5266
|
-
if (result) __defProp$
|
|
5269
|
+
if (result) __defProp$J(target, key, result);
|
|
5267
5270
|
return result;
|
|
5268
5271
|
};
|
|
5269
5272
|
function resolveOptions(options) {
|
|
@@ -5368,7 +5371,7 @@ const _VideoTexture = class _VideoTexture extends Texture2D {
|
|
|
5368
5371
|
}
|
|
5369
5372
|
}
|
|
5370
5373
|
_onPlayStart = () => {
|
|
5371
|
-
if (!this.
|
|
5374
|
+
if (!this.isValid()) {
|
|
5372
5375
|
this._onCanPlay();
|
|
5373
5376
|
}
|
|
5374
5377
|
this._setupAutoUpdate();
|
|
@@ -5380,7 +5383,7 @@ const _VideoTexture = class _VideoTexture extends Texture2D {
|
|
|
5380
5383
|
const source = this.source;
|
|
5381
5384
|
source.removeEventListener("canplay", this._onCanPlay);
|
|
5382
5385
|
source.removeEventListener("canplaythrough", this._onCanPlay);
|
|
5383
|
-
const valid = this.
|
|
5386
|
+
const valid = this.isValid();
|
|
5384
5387
|
this._nextTime = 0;
|
|
5385
5388
|
this._updateSize();
|
|
5386
5389
|
this.requestUpload();
|
|
@@ -5479,7 +5482,7 @@ const _VideoTexture = class _VideoTexture extends Texture2D {
|
|
|
5479
5482
|
this._onCanPlay();
|
|
5480
5483
|
}
|
|
5481
5484
|
this._sourceLoad = new Promise((resolve, reject) => {
|
|
5482
|
-
if (this.
|
|
5485
|
+
if (this.isValid()) {
|
|
5483
5486
|
this._sourceLoad = void 0;
|
|
5484
5487
|
resolve(this);
|
|
5485
5488
|
} else {
|
|
@@ -5507,10 +5510,10 @@ const _VideoTexture = class _VideoTexture extends Texture2D {
|
|
|
5507
5510
|
}
|
|
5508
5511
|
}
|
|
5509
5512
|
};
|
|
5510
|
-
__decorateClass$
|
|
5513
|
+
__decorateClass$N([
|
|
5511
5514
|
modernIdoc.property({ internal: true, fallback: true })
|
|
5512
5515
|
], _VideoTexture.prototype, "autoUpdate");
|
|
5513
|
-
__decorateClass$
|
|
5516
|
+
__decorateClass$N([
|
|
5514
5517
|
modernIdoc.property({ internal: true, fallback: 0 })
|
|
5515
5518
|
], _VideoTexture.prototype, "fps");
|
|
5516
5519
|
let VideoTexture = _VideoTexture;
|
|
@@ -5645,7 +5648,6 @@ class CanvasContext extends modernPath2d.Path2D {
|
|
|
5645
5648
|
}
|
|
5646
5649
|
buildUvs(start, vertices, uvs, texture, uvTransform) {
|
|
5647
5650
|
if (texture) {
|
|
5648
|
-
const _uvTransform = uvTransform ? typeof uvTransform === "function" ? uvTransform : (x, y) => uvTransform.apply({ x, y }).toArray() : uvTransform;
|
|
5649
5651
|
const w = texture.width;
|
|
5650
5652
|
const h = texture.height;
|
|
5651
5653
|
for (let len = vertices.length, i = start; i < len; i += 2) {
|
|
@@ -5653,8 +5655,8 @@ class CanvasContext extends modernPath2d.Path2D {
|
|
|
5653
5655
|
const y = vertices[i + 1];
|
|
5654
5656
|
let uvX;
|
|
5655
5657
|
let uvY;
|
|
5656
|
-
if (
|
|
5657
|
-
[uvX, uvY] =
|
|
5658
|
+
if (uvTransform) {
|
|
5659
|
+
[uvX, uvY] = uvTransform.apply({ x, y }).toArray();
|
|
5658
5660
|
} else {
|
|
5659
5661
|
[uvX, uvY] = [x / w, y / h];
|
|
5660
5662
|
}
|
|
@@ -5690,6 +5692,7 @@ class CanvasContext extends modernPath2d.Path2D {
|
|
|
5690
5692
|
if (current.texture) {
|
|
5691
5693
|
this.buildUvs(0, vertices, uvs, current.texture, current.uvTransform);
|
|
5692
5694
|
}
|
|
5695
|
+
const box = current.path.getBoundingBox();
|
|
5693
5696
|
batchables.push({
|
|
5694
5697
|
vertices: new Float32Array(vertices),
|
|
5695
5698
|
indices: new Float32Array(indices),
|
|
@@ -5698,7 +5701,9 @@ class CanvasContext extends modernPath2d.Path2D {
|
|
|
5698
5701
|
backgroundColor: current.backgroundColor,
|
|
5699
5702
|
type: current.type,
|
|
5700
5703
|
disableWrapMode: current.disableWrapMode,
|
|
5701
|
-
|
|
5704
|
+
uvTransform: current.uvTransform,
|
|
5705
|
+
vertTransform: current.vertTransform,
|
|
5706
|
+
dimension: new Float32Array([box.width, box.height])
|
|
5702
5707
|
});
|
|
5703
5708
|
}
|
|
5704
5709
|
return batchables;
|
|
@@ -5800,14 +5805,14 @@ class Meta extends CoreObject {
|
|
|
5800
5805
|
}
|
|
5801
5806
|
}
|
|
5802
5807
|
|
|
5803
|
-
var __defProp$
|
|
5804
|
-
var __getOwnPropDesc$
|
|
5805
|
-
var __decorateClass$
|
|
5806
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
5808
|
+
var __defProp$I = Object.defineProperty;
|
|
5809
|
+
var __getOwnPropDesc$C = Object.getOwnPropertyDescriptor;
|
|
5810
|
+
var __decorateClass$M = (decorators, target, key, kind) => {
|
|
5811
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$C(target, key) : target;
|
|
5807
5812
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
5808
5813
|
if (decorator = decorators[i])
|
|
5809
5814
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
5810
|
-
if (kind && result) __defProp$
|
|
5815
|
+
if (kind && result) __defProp$I(target, key, result);
|
|
5811
5816
|
return result;
|
|
5812
5817
|
};
|
|
5813
5818
|
const iidMap = {};
|
|
@@ -5908,9 +5913,6 @@ exports.Node = class Node extends CoreObject {
|
|
|
5908
5913
|
}
|
|
5909
5914
|
return this;
|
|
5910
5915
|
}
|
|
5911
|
-
log(...args) {
|
|
5912
|
-
this._tree?.log(...args);
|
|
5913
|
-
}
|
|
5914
5916
|
/** Parent */
|
|
5915
5917
|
_parent;
|
|
5916
5918
|
get parent() {
|
|
@@ -6246,24 +6248,35 @@ exports.Node = class Node extends CoreObject {
|
|
|
6246
6248
|
remove() {
|
|
6247
6249
|
this._parent?.removeChild(this);
|
|
6248
6250
|
}
|
|
6249
|
-
|
|
6250
|
-
this.
|
|
6251
|
-
|
|
6251
|
+
findOne(callbackfn) {
|
|
6252
|
+
for (const child of this._children.default) {
|
|
6253
|
+
const value = callbackfn(child) || child.findOne(callbackfn);
|
|
6254
|
+
if (value) {
|
|
6255
|
+
return value;
|
|
6256
|
+
}
|
|
6257
|
+
}
|
|
6258
|
+
return void 0;
|
|
6252
6259
|
}
|
|
6253
|
-
|
|
6254
|
-
|
|
6255
|
-
|
|
6256
|
-
child
|
|
6257
|
-
|
|
6258
|
-
|
|
6260
|
+
findAll(callbackfn) {
|
|
6261
|
+
const items = [];
|
|
6262
|
+
for (const child of this._children.default) {
|
|
6263
|
+
const value = callbackfn(child);
|
|
6264
|
+
if (value) {
|
|
6265
|
+
items.push(value);
|
|
6266
|
+
}
|
|
6267
|
+
items.push(...child.findAll(callbackfn));
|
|
6268
|
+
}
|
|
6269
|
+
return items;
|
|
6259
6270
|
}
|
|
6260
|
-
|
|
6261
|
-
const parent = this.
|
|
6271
|
+
findAncestor(callbackfn) {
|
|
6272
|
+
const parent = this._parent;
|
|
6262
6273
|
if (parent) {
|
|
6263
|
-
callbackfn(parent);
|
|
6264
|
-
|
|
6274
|
+
const value = callbackfn(parent) ?? parent.findAncestor(callbackfn);
|
|
6275
|
+
if (value) {
|
|
6276
|
+
return value;
|
|
6277
|
+
}
|
|
6265
6278
|
}
|
|
6266
|
-
return
|
|
6279
|
+
return void 0;
|
|
6267
6280
|
}
|
|
6268
6281
|
/** override */
|
|
6269
6282
|
_ready() {
|
|
@@ -6321,42 +6334,42 @@ exports.Node = class Node extends CoreObject {
|
|
|
6321
6334
|
return node;
|
|
6322
6335
|
}
|
|
6323
6336
|
};
|
|
6324
|
-
__decorateClass$
|
|
6337
|
+
__decorateClass$M([
|
|
6325
6338
|
modernIdoc.property({ fallback: modernIdoc.idGenerator() })
|
|
6326
6339
|
], exports.Node.prototype, "id", 2);
|
|
6327
|
-
__decorateClass$
|
|
6340
|
+
__decorateClass$M([
|
|
6328
6341
|
modernIdoc.property({ fallback: modernIdoc.idGenerator() })
|
|
6329
6342
|
], exports.Node.prototype, "name", 2);
|
|
6330
|
-
__decorateClass$
|
|
6343
|
+
__decorateClass$M([
|
|
6331
6344
|
modernIdoc.property({ internal: true, fallback: "inherit" })
|
|
6332
6345
|
], exports.Node.prototype, "processMode", 2);
|
|
6333
|
-
__decorateClass$
|
|
6346
|
+
__decorateClass$M([
|
|
6334
6347
|
modernIdoc.property({ internal: true, fallback: "default" })
|
|
6335
6348
|
], exports.Node.prototype, "processSortMode", 2);
|
|
6336
|
-
__decorateClass$
|
|
6349
|
+
__decorateClass$M([
|
|
6337
6350
|
modernIdoc.property({ internal: true, fallback: "inherit" })
|
|
6338
6351
|
], exports.Node.prototype, "renderMode", 2);
|
|
6339
|
-
__decorateClass$
|
|
6352
|
+
__decorateClass$M([
|
|
6340
6353
|
modernIdoc.property({ internal: true, fallback: "inherit" })
|
|
6341
6354
|
], exports.Node.prototype, "inputMode", 2);
|
|
6342
|
-
__decorateClass$
|
|
6355
|
+
__decorateClass$M([
|
|
6343
6356
|
modernIdoc.property({ internal: true, fallback: "default" })
|
|
6344
6357
|
], exports.Node.prototype, "internalMode", 2);
|
|
6345
|
-
__decorateClass$
|
|
6358
|
+
__decorateClass$M([
|
|
6346
6359
|
modernIdoc.property({ internal: true })
|
|
6347
6360
|
], exports.Node.prototype, "mask", 2);
|
|
6348
|
-
exports.Node = __decorateClass$
|
|
6361
|
+
exports.Node = __decorateClass$M([
|
|
6349
6362
|
customNode("Node")
|
|
6350
6363
|
], exports.Node);
|
|
6351
6364
|
|
|
6352
|
-
var __defProp$
|
|
6353
|
-
var __getOwnPropDesc$
|
|
6354
|
-
var __decorateClass$
|
|
6355
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
6365
|
+
var __defProp$H = Object.defineProperty;
|
|
6366
|
+
var __getOwnPropDesc$B = Object.getOwnPropertyDescriptor;
|
|
6367
|
+
var __decorateClass$L = (decorators, target, key, kind) => {
|
|
6368
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$B(target, key) : target;
|
|
6356
6369
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
6357
6370
|
if (decorator = decorators[i])
|
|
6358
6371
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
6359
|
-
if (kind && result) __defProp$
|
|
6372
|
+
if (kind && result) __defProp$H(target, key, result);
|
|
6360
6373
|
return result;
|
|
6361
6374
|
};
|
|
6362
6375
|
exports.TimelineNode = class TimelineNode extends exports.Node {
|
|
@@ -6404,9 +6417,15 @@ exports.TimelineNode = class TimelineNode extends exports.Node {
|
|
|
6404
6417
|
_updateCurrentTime(force = false) {
|
|
6405
6418
|
if (force || !this.paused) {
|
|
6406
6419
|
const parent = this._parent;
|
|
6407
|
-
|
|
6408
|
-
|
|
6409
|
-
|
|
6420
|
+
const startTime = this.delay + this.parentStartTime;
|
|
6421
|
+
const endTime = parent?.computedDuration ? Math.min(startTime + this.duration, parent.endTime) - startTime : this.duration;
|
|
6422
|
+
let currentTime = this.timelineCurrentTime - startTime;
|
|
6423
|
+
if (this.loop) {
|
|
6424
|
+
currentTime = currentTime % endTime;
|
|
6425
|
+
}
|
|
6426
|
+
this._startTime = startTime;
|
|
6427
|
+
this._currentTime = currentTime;
|
|
6428
|
+
this.computedDuration = endTime;
|
|
6410
6429
|
this.emit("updateCurrentTime", this._currentTime);
|
|
6411
6430
|
this.insideTimeRange = this.isInsideTimeRange();
|
|
6412
6431
|
}
|
|
@@ -6416,30 +6435,33 @@ exports.TimelineNode = class TimelineNode extends exports.Node {
|
|
|
6416
6435
|
this._updateCurrentTime();
|
|
6417
6436
|
}
|
|
6418
6437
|
};
|
|
6419
|
-
__decorateClass$
|
|
6438
|
+
__decorateClass$L([
|
|
6439
|
+
modernIdoc.property({ fallback: false })
|
|
6440
|
+
], exports.TimelineNode.prototype, "loop", 2);
|
|
6441
|
+
__decorateClass$L([
|
|
6420
6442
|
modernIdoc.property({ fallback: 0 })
|
|
6421
6443
|
], exports.TimelineNode.prototype, "delay", 2);
|
|
6422
|
-
__decorateClass$
|
|
6444
|
+
__decorateClass$L([
|
|
6423
6445
|
modernIdoc.property({ fallback: 0 })
|
|
6424
6446
|
], exports.TimelineNode.prototype, "duration", 2);
|
|
6425
|
-
__decorateClass$
|
|
6447
|
+
__decorateClass$L([
|
|
6426
6448
|
modernIdoc.property({ fallback: false })
|
|
6427
6449
|
], exports.TimelineNode.prototype, "paused", 2);
|
|
6428
|
-
__decorateClass$
|
|
6450
|
+
__decorateClass$L([
|
|
6429
6451
|
modernIdoc.property({ internal: true, fallback: false })
|
|
6430
6452
|
], exports.TimelineNode.prototype, "insideTimeRange", 2);
|
|
6431
|
-
exports.TimelineNode = __decorateClass$
|
|
6453
|
+
exports.TimelineNode = __decorateClass$L([
|
|
6432
6454
|
customNode("TimelineNode")
|
|
6433
6455
|
], exports.TimelineNode);
|
|
6434
6456
|
|
|
6435
|
-
var __defProp$
|
|
6436
|
-
var __getOwnPropDesc$
|
|
6437
|
-
var __decorateClass$
|
|
6438
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
6457
|
+
var __defProp$G = Object.defineProperty;
|
|
6458
|
+
var __getOwnPropDesc$A = Object.getOwnPropertyDescriptor;
|
|
6459
|
+
var __decorateClass$K = (decorators, target, key, kind) => {
|
|
6460
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$A(target, key) : target;
|
|
6439
6461
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
6440
6462
|
if (decorator = decorators[i])
|
|
6441
6463
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
6442
|
-
if (kind && result) __defProp$
|
|
6464
|
+
if (kind && result) __defProp$G(target, key, result);
|
|
6443
6465
|
return result;
|
|
6444
6466
|
};
|
|
6445
6467
|
exports.CanvasItem = class CanvasItem extends exports.TimelineNode {
|
|
@@ -6523,16 +6545,16 @@ exports.CanvasItem = class CanvasItem extends exports.TimelineNode {
|
|
|
6523
6545
|
this.emit("draw");
|
|
6524
6546
|
}
|
|
6525
6547
|
_redraw() {
|
|
6526
|
-
this.log(this.name, "drawing");
|
|
6548
|
+
this._tree?.log(this.name, "drawing");
|
|
6527
6549
|
this._draw();
|
|
6528
6550
|
return this.context.toBatchables();
|
|
6529
6551
|
}
|
|
6530
6552
|
_relayout(batchables) {
|
|
6531
|
-
this.log(this.name, "layouting");
|
|
6553
|
+
this._tree?.log(this.name, "layouting");
|
|
6532
6554
|
return batchables;
|
|
6533
6555
|
}
|
|
6534
6556
|
_repaint(batchables) {
|
|
6535
|
-
this.log(this.name, "painting");
|
|
6557
|
+
this._tree?.log(this.name, "painting");
|
|
6536
6558
|
const globalOpacity = this.globalOpacity;
|
|
6537
6559
|
return batchables.map((batchable) => {
|
|
6538
6560
|
return {
|
|
@@ -6592,30 +6614,30 @@ exports.CanvasItem = class CanvasItem extends exports.TimelineNode {
|
|
|
6592
6614
|
super._render(renderer);
|
|
6593
6615
|
}
|
|
6594
6616
|
};
|
|
6595
|
-
__decorateClass$
|
|
6617
|
+
__decorateClass$K([
|
|
6596
6618
|
modernIdoc.property()
|
|
6597
6619
|
], exports.CanvasItem.prototype, "modulate", 2);
|
|
6598
|
-
__decorateClass$
|
|
6620
|
+
__decorateClass$K([
|
|
6599
6621
|
modernIdoc.property()
|
|
6600
6622
|
], exports.CanvasItem.prototype, "blendMode", 2);
|
|
6601
|
-
__decorateClass$
|
|
6623
|
+
__decorateClass$K([
|
|
6602
6624
|
modernIdoc.property({ internal: true, fallback: true })
|
|
6603
6625
|
], exports.CanvasItem.prototype, "visible", 2);
|
|
6604
|
-
__decorateClass$
|
|
6626
|
+
__decorateClass$K([
|
|
6605
6627
|
modernIdoc.property({ internal: true, fallback: 1 })
|
|
6606
6628
|
], exports.CanvasItem.prototype, "opacity", 2);
|
|
6607
|
-
exports.CanvasItem = __decorateClass$
|
|
6629
|
+
exports.CanvasItem = __decorateClass$K([
|
|
6608
6630
|
customNode("CanvasItem")
|
|
6609
6631
|
], exports.CanvasItem);
|
|
6610
6632
|
|
|
6611
|
-
var __defProp$
|
|
6612
|
-
var __getOwnPropDesc$
|
|
6613
|
-
var __decorateClass$
|
|
6614
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
6633
|
+
var __defProp$F = Object.defineProperty;
|
|
6634
|
+
var __getOwnPropDesc$z = Object.getOwnPropertyDescriptor;
|
|
6635
|
+
var __decorateClass$J = (decorators, target, key, kind) => {
|
|
6636
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$z(target, key) : target;
|
|
6615
6637
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
6616
6638
|
if (decorator = decorators[i])
|
|
6617
6639
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
6618
|
-
if (kind && result) __defProp$
|
|
6640
|
+
if (kind && result) __defProp$F(target, key, result);
|
|
6619
6641
|
return result;
|
|
6620
6642
|
};
|
|
6621
6643
|
exports.Viewport = class Viewport extends exports.Node {
|
|
@@ -6766,33 +6788,33 @@ exports.Viewport = class Viewport extends exports.Node {
|
|
|
6766
6788
|
return this.canvasTransform.apply(globalPos, newPos);
|
|
6767
6789
|
}
|
|
6768
6790
|
};
|
|
6769
|
-
__decorateClass$
|
|
6791
|
+
__decorateClass$J([
|
|
6770
6792
|
modernIdoc.property({ fallback: 0 })
|
|
6771
6793
|
], exports.Viewport.prototype, "x", 2);
|
|
6772
|
-
__decorateClass$
|
|
6794
|
+
__decorateClass$J([
|
|
6773
6795
|
modernIdoc.property({ fallback: 0 })
|
|
6774
6796
|
], exports.Viewport.prototype, "y", 2);
|
|
6775
|
-
__decorateClass$
|
|
6797
|
+
__decorateClass$J([
|
|
6776
6798
|
modernIdoc.property({ fallback: 0 })
|
|
6777
6799
|
], exports.Viewport.prototype, "width", 2);
|
|
6778
|
-
__decorateClass$
|
|
6800
|
+
__decorateClass$J([
|
|
6779
6801
|
modernIdoc.property({ fallback: 0 })
|
|
6780
6802
|
], exports.Viewport.prototype, "height", 2);
|
|
6781
|
-
__decorateClass$
|
|
6803
|
+
__decorateClass$J([
|
|
6782
6804
|
modernIdoc.property({ internal: true, fallback: false })
|
|
6783
6805
|
], exports.Viewport.prototype, "msaa", 2);
|
|
6784
|
-
exports.Viewport = __decorateClass$
|
|
6806
|
+
exports.Viewport = __decorateClass$J([
|
|
6785
6807
|
customNode("Viewport")
|
|
6786
6808
|
], exports.Viewport);
|
|
6787
6809
|
|
|
6788
|
-
var __defProp$
|
|
6789
|
-
var __getOwnPropDesc$
|
|
6790
|
-
var __decorateClass$
|
|
6791
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
6810
|
+
var __defProp$E = Object.defineProperty;
|
|
6811
|
+
var __getOwnPropDesc$y = Object.getOwnPropertyDescriptor;
|
|
6812
|
+
var __decorateClass$I = (decorators, target, key, kind) => {
|
|
6813
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$y(target, key) : target;
|
|
6792
6814
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
6793
6815
|
if (decorator = decorators[i])
|
|
6794
6816
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
6795
|
-
if (kind && result) __defProp$
|
|
6817
|
+
if (kind && result) __defProp$E(target, key, result);
|
|
6796
6818
|
return result;
|
|
6797
6819
|
};
|
|
6798
6820
|
exports.Effect = class Effect extends exports.TimelineNode {
|
|
@@ -7034,19 +7056,19 @@ exports.Effect = class Effect extends exports.TimelineNode {
|
|
|
7034
7056
|
}
|
|
7035
7057
|
}
|
|
7036
7058
|
};
|
|
7037
|
-
__decorateClass$
|
|
7059
|
+
__decorateClass$I([
|
|
7038
7060
|
modernIdoc.property({ internal: true })
|
|
7039
7061
|
], exports.Effect.prototype, "material", 2);
|
|
7040
|
-
__decorateClass$
|
|
7062
|
+
__decorateClass$I([
|
|
7041
7063
|
modernIdoc.property()
|
|
7042
7064
|
], exports.Effect.prototype, "effectMode", 2);
|
|
7043
|
-
__decorateClass$
|
|
7044
|
-
modernIdoc.property(
|
|
7065
|
+
__decorateClass$I([
|
|
7066
|
+
modernIdoc.property()
|
|
7045
7067
|
], exports.Effect.prototype, "glsl", 2);
|
|
7046
|
-
__decorateClass$
|
|
7047
|
-
modernIdoc.property(
|
|
7068
|
+
__decorateClass$I([
|
|
7069
|
+
modernIdoc.property()
|
|
7048
7070
|
], exports.Effect.prototype, "glslSrc", 2);
|
|
7049
|
-
exports.Effect = __decorateClass$
|
|
7071
|
+
exports.Effect = __decorateClass$I([
|
|
7050
7072
|
customNode("Effect")
|
|
7051
7073
|
], exports.Effect);
|
|
7052
7074
|
|
|
@@ -7076,14 +7098,14 @@ class RenderStack {
|
|
|
7076
7098
|
}
|
|
7077
7099
|
}
|
|
7078
7100
|
|
|
7079
|
-
var __defProp$
|
|
7080
|
-
var __getOwnPropDesc$
|
|
7081
|
-
var __decorateClass$
|
|
7082
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
7101
|
+
var __defProp$D = Object.defineProperty;
|
|
7102
|
+
var __getOwnPropDesc$x = Object.getOwnPropertyDescriptor;
|
|
7103
|
+
var __decorateClass$H = (decorators, target, key, kind) => {
|
|
7104
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$x(target, key) : target;
|
|
7083
7105
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
7084
7106
|
if (decorator = decorators[i])
|
|
7085
7107
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
7086
|
-
if (kind && result) __defProp$
|
|
7108
|
+
if (kind && result) __defProp$D(target, key, result);
|
|
7087
7109
|
return result;
|
|
7088
7110
|
};
|
|
7089
7111
|
exports.Timeline = class Timeline extends exports.Node {
|
|
@@ -7128,48 +7150,48 @@ exports.Timeline = class Timeline extends exports.Node {
|
|
|
7128
7150
|
this.addTime(delta);
|
|
7129
7151
|
}
|
|
7130
7152
|
};
|
|
7131
|
-
__decorateClass$
|
|
7153
|
+
__decorateClass$H([
|
|
7132
7154
|
modernIdoc.property({ fallback: 0 })
|
|
7133
7155
|
], exports.Timeline.prototype, "startTime", 2);
|
|
7134
|
-
__decorateClass$
|
|
7156
|
+
__decorateClass$H([
|
|
7135
7157
|
modernIdoc.property({ fallback: 0 })
|
|
7136
7158
|
], exports.Timeline.prototype, "currentTime", 2);
|
|
7137
|
-
__decorateClass$
|
|
7159
|
+
__decorateClass$H([
|
|
7138
7160
|
modernIdoc.property({ fallback: Number.MAX_SAFE_INTEGER })
|
|
7139
7161
|
], exports.Timeline.prototype, "endTime", 2);
|
|
7140
|
-
__decorateClass$
|
|
7162
|
+
__decorateClass$H([
|
|
7141
7163
|
modernIdoc.property({ fallback: false })
|
|
7142
7164
|
], exports.Timeline.prototype, "loop", 2);
|
|
7143
|
-
exports.Timeline = __decorateClass$
|
|
7165
|
+
exports.Timeline = __decorateClass$H([
|
|
7144
7166
|
customNode("Timeline")
|
|
7145
7167
|
], exports.Timeline);
|
|
7146
7168
|
|
|
7147
|
-
var __defProp$
|
|
7148
|
-
var __getOwnPropDesc$
|
|
7149
|
-
var __decorateClass$
|
|
7150
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
7169
|
+
var __defProp$C = Object.defineProperty;
|
|
7170
|
+
var __getOwnPropDesc$w = Object.getOwnPropertyDescriptor;
|
|
7171
|
+
var __decorateClass$G = (decorators, target, key, kind) => {
|
|
7172
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$w(target, key) : target;
|
|
7151
7173
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
7152
7174
|
if (decorator = decorators[i])
|
|
7153
7175
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
7154
|
-
if (kind && result) __defProp$
|
|
7176
|
+
if (kind && result) __defProp$C(target, key, result);
|
|
7155
7177
|
return result;
|
|
7156
7178
|
};
|
|
7157
7179
|
exports.Window = class Window extends exports.Viewport {
|
|
7158
7180
|
};
|
|
7159
|
-
__decorateClass$
|
|
7181
|
+
__decorateClass$G([
|
|
7160
7182
|
modernIdoc.property({ fallback: false })
|
|
7161
7183
|
], exports.Window.prototype, "msaa", 2);
|
|
7162
|
-
exports.Window = __decorateClass$
|
|
7184
|
+
exports.Window = __decorateClass$G([
|
|
7163
7185
|
customNode("Window")
|
|
7164
7186
|
], exports.Window);
|
|
7165
7187
|
|
|
7166
|
-
var __defProp$
|
|
7167
|
-
var __decorateClass$
|
|
7188
|
+
var __defProp$B = Object.defineProperty;
|
|
7189
|
+
var __decorateClass$F = (decorators, target, key, kind) => {
|
|
7168
7190
|
var result = void 0 ;
|
|
7169
7191
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
7170
7192
|
if (decorator = decorators[i])
|
|
7171
7193
|
result = (decorator(target, key, result) ) || result;
|
|
7172
|
-
if (result) __defProp$
|
|
7194
|
+
if (result) __defProp$B(target, key, result);
|
|
7173
7195
|
return result;
|
|
7174
7196
|
};
|
|
7175
7197
|
class SceneTree extends MainLoop {
|
|
@@ -7249,25 +7271,25 @@ class SceneTree extends MainLoop {
|
|
|
7249
7271
|
super.destroy();
|
|
7250
7272
|
}
|
|
7251
7273
|
}
|
|
7252
|
-
__decorateClass$
|
|
7274
|
+
__decorateClass$F([
|
|
7253
7275
|
modernIdoc.property()
|
|
7254
7276
|
], SceneTree.prototype, "backgroundColor");
|
|
7255
|
-
__decorateClass$
|
|
7277
|
+
__decorateClass$F([
|
|
7256
7278
|
modernIdoc.property({ internal: true, fallback: false })
|
|
7257
7279
|
], SceneTree.prototype, "debug");
|
|
7258
|
-
__decorateClass$
|
|
7280
|
+
__decorateClass$F([
|
|
7259
7281
|
modernIdoc.property({ internal: true, fallback: false })
|
|
7260
7282
|
], SceneTree.prototype, "processPaused");
|
|
7261
|
-
__decorateClass$
|
|
7283
|
+
__decorateClass$F([
|
|
7262
7284
|
modernIdoc.property({ internal: true, default: () => modernFont.fonts })
|
|
7263
7285
|
], SceneTree.prototype, "fonts");
|
|
7264
|
-
__decorateClass$
|
|
7286
|
+
__decorateClass$F([
|
|
7265
7287
|
modernIdoc.property({ internal: true, default: () => new exports.Timeline() })
|
|
7266
7288
|
], SceneTree.prototype, "timeline");
|
|
7267
7289
|
|
|
7268
|
-
var __getOwnPropDesc$
|
|
7269
|
-
var __decorateClass$
|
|
7270
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
7290
|
+
var __getOwnPropDesc$v = Object.getOwnPropertyDescriptor;
|
|
7291
|
+
var __decorateClass$E = (decorators, target, key, kind) => {
|
|
7292
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$v(target, key) : target;
|
|
7271
7293
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
7272
7294
|
if (decorator = decorators[i])
|
|
7273
7295
|
result = (decorator(result)) || result;
|
|
@@ -7279,7 +7301,7 @@ exports.Transition = class Transition extends exports.Effect {
|
|
|
7279
7301
|
this.setProperties(properties).append(children);
|
|
7280
7302
|
}
|
|
7281
7303
|
};
|
|
7282
|
-
exports.Transition = __decorateClass$
|
|
7304
|
+
exports.Transition = __decorateClass$E([
|
|
7283
7305
|
customNode("Transition", {
|
|
7284
7306
|
effectMode: "transition",
|
|
7285
7307
|
processMode: "pausable",
|
|
@@ -7287,14 +7309,14 @@ exports.Transition = __decorateClass$L([
|
|
|
7287
7309
|
})
|
|
7288
7310
|
], exports.Transition);
|
|
7289
7311
|
|
|
7290
|
-
var __defProp$
|
|
7291
|
-
var __getOwnPropDesc$
|
|
7292
|
-
var __decorateClass$
|
|
7293
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
7312
|
+
var __defProp$A = Object.defineProperty;
|
|
7313
|
+
var __getOwnPropDesc$u = Object.getOwnPropertyDescriptor;
|
|
7314
|
+
var __decorateClass$D = (decorators, target, key, kind) => {
|
|
7315
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$u(target, key) : target;
|
|
7294
7316
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
7295
7317
|
if (decorator = decorators[i])
|
|
7296
7318
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
7297
|
-
if (kind && result) __defProp$
|
|
7319
|
+
if (kind && result) __defProp$A(target, key, result);
|
|
7298
7320
|
return result;
|
|
7299
7321
|
};
|
|
7300
7322
|
exports.Node2D = class Node2D extends exports.CanvasItem {
|
|
@@ -7358,9 +7380,7 @@ exports.Node2D = class Node2D extends exports.CanvasItem {
|
|
|
7358
7380
|
let a, c, tx, b, d, ty;
|
|
7359
7381
|
if (vertTransform) {
|
|
7360
7382
|
const globalTransform = this.globalTransform.clone();
|
|
7361
|
-
globalTransform.multiply(
|
|
7362
|
-
typeof vertTransform === "function" ? vertTransform?.() : vertTransform
|
|
7363
|
-
);
|
|
7383
|
+
globalTransform.multiply(vertTransform);
|
|
7364
7384
|
[a, c, tx, b, d, ty] = globalTransform.toArray();
|
|
7365
7385
|
} else {
|
|
7366
7386
|
[a, c, tx, b, d, ty] = this.globalTransform.toArray();
|
|
@@ -7398,46 +7418,81 @@ exports.Node2D = class Node2D extends exports.CanvasItem {
|
|
|
7398
7418
|
return this.globalTransform.apply(localPos, newPos);
|
|
7399
7419
|
}
|
|
7400
7420
|
};
|
|
7401
|
-
__decorateClass$
|
|
7421
|
+
__decorateClass$D([
|
|
7402
7422
|
modernIdoc.property({ internal: true, fallback: 0 })
|
|
7403
7423
|
], exports.Node2D.prototype, "rotation", 2);
|
|
7404
|
-
__decorateClass$
|
|
7424
|
+
__decorateClass$D([
|
|
7405
7425
|
modernIdoc.property({ internal: true, fallback: 0 })
|
|
7406
7426
|
], exports.Node2D.prototype, "globalRotation", 2);
|
|
7407
|
-
exports.Node2D = __decorateClass$
|
|
7427
|
+
exports.Node2D = __decorateClass$D([
|
|
7408
7428
|
customNode("Node2D")
|
|
7409
7429
|
], exports.Node2D);
|
|
7410
7430
|
|
|
7411
|
-
var __defProp$
|
|
7412
|
-
var __getOwnPropDesc$
|
|
7413
|
-
var __decorateClass$
|
|
7414
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
7431
|
+
var __defProp$z = Object.defineProperty;
|
|
7432
|
+
var __getOwnPropDesc$t = Object.getOwnPropertyDescriptor;
|
|
7433
|
+
var __decorateClass$C = (decorators, target, key, kind) => {
|
|
7434
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$t(target, key) : target;
|
|
7415
7435
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
7416
7436
|
if (decorator = decorators[i])
|
|
7417
7437
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
7418
|
-
if (kind && result) __defProp$
|
|
7438
|
+
if (kind && result) __defProp$z(target, key, result);
|
|
7419
7439
|
return result;
|
|
7420
7440
|
};
|
|
7421
7441
|
exports.Camera2D = class Camera2D extends exports.Node2D {
|
|
7422
|
-
zoom = new Vector2(1, 1).on("update", () => this.updateCanvasTransform());
|
|
7423
|
-
maxZoom = new Vector2(6, 6);
|
|
7424
|
-
minZoom = new Vector2(0.1, 0.1);
|
|
7425
7442
|
_screenOffset = { x: 0, y: 0 };
|
|
7426
|
-
|
|
7427
|
-
|
|
7428
|
-
this.
|
|
7443
|
+
_zoom = new Vector2(1, 1).on("update", () => this.updateCanvasTransform());
|
|
7444
|
+
get zoom() {
|
|
7445
|
+
return this._zoom;
|
|
7429
7446
|
}
|
|
7430
|
-
|
|
7431
|
-
this.
|
|
7432
|
-
|
|
7433
|
-
|
|
7434
|
-
|
|
7447
|
+
set zoom(val) {
|
|
7448
|
+
this._zoom.set(val.x, val.y);
|
|
7449
|
+
}
|
|
7450
|
+
_minZoom = new Vector2(0.02, 0.02);
|
|
7451
|
+
get minZoom() {
|
|
7452
|
+
return this._minZoom;
|
|
7453
|
+
}
|
|
7454
|
+
set minZoom(val) {
|
|
7455
|
+
this._minZoom.set(val.x, val.y);
|
|
7456
|
+
}
|
|
7457
|
+
_maxZoom = new Vector2(256, 256);
|
|
7458
|
+
get maxZoom() {
|
|
7459
|
+
return this._maxZoom;
|
|
7460
|
+
}
|
|
7461
|
+
set maxZoom(val) {
|
|
7462
|
+
this._maxZoom.set(val.x, val.y);
|
|
7463
|
+
}
|
|
7464
|
+
constructor(properties, nodes = []) {
|
|
7465
|
+
super();
|
|
7466
|
+
this.setProperties(properties).append(nodes);
|
|
7467
|
+
}
|
|
7468
|
+
setProperties(properties) {
|
|
7469
|
+
if (properties) {
|
|
7470
|
+
const {
|
|
7471
|
+
zoom,
|
|
7472
|
+
minZoom,
|
|
7473
|
+
maxZoom,
|
|
7474
|
+
...restProperties
|
|
7475
|
+
} = properties;
|
|
7476
|
+
if (zoom)
|
|
7477
|
+
this.zoom = zoom;
|
|
7478
|
+
if (minZoom)
|
|
7479
|
+
this.minZoom = minZoom;
|
|
7480
|
+
if (maxZoom)
|
|
7481
|
+
this.maxZoom = maxZoom;
|
|
7482
|
+
super.setProperties(restProperties);
|
|
7483
|
+
}
|
|
7435
7484
|
return this;
|
|
7436
7485
|
}
|
|
7486
|
+
addZoom(x, y = x) {
|
|
7487
|
+
return this.setZoom(
|
|
7488
|
+
this._zoom.x + x,
|
|
7489
|
+
this._zoom.y + y
|
|
7490
|
+
);
|
|
7491
|
+
}
|
|
7437
7492
|
setZoom(x, y = x) {
|
|
7438
|
-
this.
|
|
7439
|
-
clamp(x, this.
|
|
7440
|
-
clamp(y, this.
|
|
7493
|
+
this._zoom.set(
|
|
7494
|
+
clamp(x, this._minZoom.x, this._maxZoom.x),
|
|
7495
|
+
clamp(y, this._minZoom.y, this._maxZoom.y)
|
|
7441
7496
|
);
|
|
7442
7497
|
return this;
|
|
7443
7498
|
}
|
|
@@ -7491,9 +7546,9 @@ exports.Camera2D = class Camera2D extends exports.Node2D {
|
|
|
7491
7546
|
const isTouchPad = e.wheelDeltaY ? Math.abs(Math.abs(e.wheelDeltaY) - Math.abs(3 * e.deltaY)) < 3 : e.deltaMode === 0;
|
|
7492
7547
|
if (!isTouchPad) {
|
|
7493
7548
|
e.preventDefault();
|
|
7494
|
-
const oldZoom = this.
|
|
7495
|
-
this.
|
|
7496
|
-
const ratio = 1 - this.
|
|
7549
|
+
const oldZoom = this._zoom.x;
|
|
7550
|
+
this.zoomWithWheel(e.deltaY);
|
|
7551
|
+
const ratio = 1 - this._zoom.x / oldZoom;
|
|
7497
7552
|
this.position.add(
|
|
7498
7553
|
(e.screenX - this.position.x) * ratio,
|
|
7499
7554
|
(e.screenY - this.position.y) * ratio
|
|
@@ -7504,6 +7559,12 @@ exports.Camera2D = class Camera2D extends exports.Node2D {
|
|
|
7504
7559
|
this.position.add(-e.deltaX, -e.deltaY);
|
|
7505
7560
|
}
|
|
7506
7561
|
}
|
|
7562
|
+
zoomWithWheel(wheelDeltaY) {
|
|
7563
|
+
const logCur = Math.log(this._zoom.x);
|
|
7564
|
+
const logDelta = -wheelDeltaY * this.wheelSensitivity;
|
|
7565
|
+
const logNew = logCur + logDelta;
|
|
7566
|
+
this.setZoom(Math.exp(logNew));
|
|
7567
|
+
}
|
|
7507
7568
|
updateTransform() {
|
|
7508
7569
|
super.updateTransform();
|
|
7509
7570
|
this.updateCanvasTransform();
|
|
@@ -7512,7 +7573,7 @@ exports.Camera2D = class Camera2D extends exports.Node2D {
|
|
|
7512
7573
|
const viewport = this.getViewport();
|
|
7513
7574
|
if (!viewport)
|
|
7514
7575
|
return;
|
|
7515
|
-
viewport.canvasTransform.identity().scale(this.
|
|
7576
|
+
viewport.canvasTransform.identity().scale(this._zoom.x, this._zoom.y).translate(this.position.x, this.position.y);
|
|
7516
7577
|
this.emit("updateCanvasTransform");
|
|
7517
7578
|
}
|
|
7518
7579
|
toGlobal(screenPos, newPos) {
|
|
@@ -7527,14 +7588,25 @@ exports.Camera2D = class Camera2D extends exports.Node2D {
|
|
|
7527
7588
|
throw new Error("Failed to toScreen, viewport is empty");
|
|
7528
7589
|
return viewport.toCanvasScreen(globalPos, newPos);
|
|
7529
7590
|
}
|
|
7591
|
+
toJSON() {
|
|
7592
|
+
return {
|
|
7593
|
+
zoom: this._zoom.toJSON(),
|
|
7594
|
+
minZoom: this._minZoom.toJSON(),
|
|
7595
|
+
maxZoom: this._maxZoom.toJSON(),
|
|
7596
|
+
...super.toJSON()
|
|
7597
|
+
};
|
|
7598
|
+
}
|
|
7530
7599
|
};
|
|
7531
|
-
__decorateClass$
|
|
7600
|
+
__decorateClass$C([
|
|
7601
|
+
modernIdoc.property({ fallback: 0.02 })
|
|
7602
|
+
], exports.Camera2D.prototype, "wheelSensitivity", 2);
|
|
7603
|
+
__decorateClass$C([
|
|
7532
7604
|
modernIdoc.property({ internal: true, fallback: false })
|
|
7533
7605
|
], exports.Camera2D.prototype, "spaceKey", 2);
|
|
7534
|
-
__decorateClass$
|
|
7606
|
+
__decorateClass$C([
|
|
7535
7607
|
modernIdoc.property({ internal: true, fallback: false })
|
|
7536
7608
|
], exports.Camera2D.prototype, "grabbing", 2);
|
|
7537
|
-
exports.Camera2D = __decorateClass$
|
|
7609
|
+
exports.Camera2D = __decorateClass$C([
|
|
7538
7610
|
customNode("Camera2D", {
|
|
7539
7611
|
processMode: "disabled",
|
|
7540
7612
|
renderMode: "disabled"
|
|
@@ -7687,18 +7759,18 @@ function parseCSSTransformOrigin(transformOrigin) {
|
|
|
7687
7759
|
});
|
|
7688
7760
|
}
|
|
7689
7761
|
|
|
7690
|
-
var __defProp$
|
|
7691
|
-
var __getOwnPropDesc$
|
|
7692
|
-
var __defNormalProp$
|
|
7693
|
-
var __decorateClass$
|
|
7694
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
7762
|
+
var __defProp$y = Object.defineProperty;
|
|
7763
|
+
var __getOwnPropDesc$s = Object.getOwnPropertyDescriptor;
|
|
7764
|
+
var __defNormalProp$j = (obj, key, value) => key in obj ? __defProp$y(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
7765
|
+
var __decorateClass$B = (decorators, target, key, kind) => {
|
|
7766
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$s(target, key) : target;
|
|
7695
7767
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
7696
7768
|
if (decorator = decorators[i])
|
|
7697
7769
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
7698
|
-
if (kind && result) __defProp$
|
|
7770
|
+
if (kind && result) __defProp$y(target, key, result);
|
|
7699
7771
|
return result;
|
|
7700
7772
|
};
|
|
7701
|
-
var __publicField$
|
|
7773
|
+
var __publicField$j = (obj, key, value) => __defNormalProp$j(obj, key + "" , value);
|
|
7702
7774
|
exports.ColorAdjustEffect = class ColorAdjustEffect extends exports.Effect {
|
|
7703
7775
|
constructor(properties, children = []) {
|
|
7704
7776
|
super();
|
|
@@ -7720,7 +7792,7 @@ exports.ColorAdjustEffect = class ColorAdjustEffect extends exports.Effect {
|
|
|
7720
7792
|
});
|
|
7721
7793
|
}
|
|
7722
7794
|
};
|
|
7723
|
-
__publicField$
|
|
7795
|
+
__publicField$j(exports.ColorAdjustEffect, "material", new Material({
|
|
7724
7796
|
vert: `precision mediump float;
|
|
7725
7797
|
attribute vec2 position;
|
|
7726
7798
|
attribute vec2 uv;
|
|
@@ -7755,46 +7827,46 @@ void main(void) {
|
|
|
7755
7827
|
gl_FragColor = c * alpha;
|
|
7756
7828
|
}`
|
|
7757
7829
|
}));
|
|
7758
|
-
__decorateClass$
|
|
7830
|
+
__decorateClass$B([
|
|
7759
7831
|
modernIdoc.property({ fallback: 1 })
|
|
7760
7832
|
], exports.ColorAdjustEffect.prototype, "saturation", 2);
|
|
7761
|
-
__decorateClass$
|
|
7833
|
+
__decorateClass$B([
|
|
7762
7834
|
modernIdoc.property({ fallback: 1 })
|
|
7763
7835
|
], exports.ColorAdjustEffect.prototype, "contrast", 2);
|
|
7764
|
-
__decorateClass$
|
|
7836
|
+
__decorateClass$B([
|
|
7765
7837
|
modernIdoc.property({ fallback: 1 })
|
|
7766
7838
|
], exports.ColorAdjustEffect.prototype, "brightness", 2);
|
|
7767
|
-
__decorateClass$
|
|
7839
|
+
__decorateClass$B([
|
|
7768
7840
|
modernIdoc.property({ fallback: 1 })
|
|
7769
7841
|
], exports.ColorAdjustEffect.prototype, "red", 2);
|
|
7770
|
-
__decorateClass$
|
|
7842
|
+
__decorateClass$B([
|
|
7771
7843
|
modernIdoc.property({ fallback: 1 })
|
|
7772
7844
|
], exports.ColorAdjustEffect.prototype, "green", 2);
|
|
7773
|
-
__decorateClass$
|
|
7845
|
+
__decorateClass$B([
|
|
7774
7846
|
modernIdoc.property({ fallback: 1 })
|
|
7775
7847
|
], exports.ColorAdjustEffect.prototype, "blue", 2);
|
|
7776
|
-
__decorateClass$
|
|
7848
|
+
__decorateClass$B([
|
|
7777
7849
|
modernIdoc.property({ fallback: 1 })
|
|
7778
7850
|
], exports.ColorAdjustEffect.prototype, "alpha", 2);
|
|
7779
|
-
__decorateClass$
|
|
7851
|
+
__decorateClass$B([
|
|
7780
7852
|
modernIdoc.property({ fallback: 1 })
|
|
7781
7853
|
], exports.ColorAdjustEffect.prototype, "gamma", 2);
|
|
7782
|
-
exports.ColorAdjustEffect = __decorateClass$
|
|
7854
|
+
exports.ColorAdjustEffect = __decorateClass$B([
|
|
7783
7855
|
customNode("ColorAdjustEffect")
|
|
7784
7856
|
], exports.ColorAdjustEffect);
|
|
7785
7857
|
|
|
7786
|
-
var __defProp$
|
|
7787
|
-
var __getOwnPropDesc$
|
|
7788
|
-
var __defNormalProp$
|
|
7789
|
-
var __decorateClass$
|
|
7790
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
7858
|
+
var __defProp$x = Object.defineProperty;
|
|
7859
|
+
var __getOwnPropDesc$r = Object.getOwnPropertyDescriptor;
|
|
7860
|
+
var __defNormalProp$i = (obj, key, value) => key in obj ? __defProp$x(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
7861
|
+
var __decorateClass$A = (decorators, target, key, kind) => {
|
|
7862
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$r(target, key) : target;
|
|
7791
7863
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
7792
7864
|
if (decorator = decorators[i])
|
|
7793
7865
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
7794
|
-
if (kind && result) __defProp$
|
|
7866
|
+
if (kind && result) __defProp$x(target, key, result);
|
|
7795
7867
|
return result;
|
|
7796
7868
|
};
|
|
7797
|
-
var __publicField$
|
|
7869
|
+
var __publicField$i = (obj, key, value) => __defNormalProp$i(obj, key + "" , value);
|
|
7798
7870
|
exports.ColorFilterEffect = class ColorFilterEffect extends exports.Effect {
|
|
7799
7871
|
_colorMatrix = new ColorMatrix();
|
|
7800
7872
|
constructor(properties, children = []) {
|
|
@@ -7844,7 +7916,7 @@ exports.ColorFilterEffect = class ColorFilterEffect extends exports.Effect {
|
|
|
7844
7916
|
});
|
|
7845
7917
|
}
|
|
7846
7918
|
};
|
|
7847
|
-
__publicField$
|
|
7919
|
+
__publicField$i(exports.ColorFilterEffect, "material", new Material({
|
|
7848
7920
|
vert: `precision mediump float;
|
|
7849
7921
|
attribute vec2 position;
|
|
7850
7922
|
attribute vec2 uv;
|
|
@@ -7871,25 +7943,25 @@ void main(void) {
|
|
|
7871
7943
|
);
|
|
7872
7944
|
}`
|
|
7873
7945
|
}));
|
|
7874
|
-
__decorateClass$
|
|
7946
|
+
__decorateClass$A([
|
|
7875
7947
|
modernIdoc.property()
|
|
7876
7948
|
], exports.ColorFilterEffect.prototype, "filter", 2);
|
|
7877
|
-
exports.ColorFilterEffect = __decorateClass$
|
|
7949
|
+
exports.ColorFilterEffect = __decorateClass$A([
|
|
7878
7950
|
customNode("ColorFilterEffect")
|
|
7879
7951
|
], exports.ColorFilterEffect);
|
|
7880
7952
|
|
|
7881
|
-
var __defProp$
|
|
7882
|
-
var __getOwnPropDesc$
|
|
7883
|
-
var __defNormalProp$
|
|
7884
|
-
var __decorateClass$
|
|
7885
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
7953
|
+
var __defProp$w = Object.defineProperty;
|
|
7954
|
+
var __getOwnPropDesc$q = Object.getOwnPropertyDescriptor;
|
|
7955
|
+
var __defNormalProp$h = (obj, key, value) => key in obj ? __defProp$w(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
7956
|
+
var __decorateClass$z = (decorators, target, key, kind) => {
|
|
7957
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$q(target, key) : target;
|
|
7886
7958
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
7887
7959
|
if (decorator = decorators[i])
|
|
7888
7960
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
7889
|
-
if (kind && result) __defProp$
|
|
7961
|
+
if (kind && result) __defProp$w(target, key, result);
|
|
7890
7962
|
return result;
|
|
7891
7963
|
};
|
|
7892
|
-
var __publicField$
|
|
7964
|
+
var __publicField$h = (obj, key, value) => __defNormalProp$h(obj, key + "" , value);
|
|
7893
7965
|
const MAX_COLORS$1 = 50;
|
|
7894
7966
|
exports.ColorOverlayEffect = class ColorOverlayEffect extends exports.Effect {
|
|
7895
7967
|
_color = new Color();
|
|
@@ -7915,7 +7987,7 @@ exports.ColorOverlayEffect = class ColorOverlayEffect extends exports.Effect {
|
|
|
7915
7987
|
});
|
|
7916
7988
|
}
|
|
7917
7989
|
};
|
|
7918
|
-
__publicField$
|
|
7990
|
+
__publicField$h(exports.ColorOverlayEffect, "material", new Material({
|
|
7919
7991
|
vert: `precision mediump float;
|
|
7920
7992
|
attribute vec2 position;
|
|
7921
7993
|
attribute vec2 uv;
|
|
@@ -7962,28 +8034,28 @@ void main(void) {
|
|
|
7962
8034
|
gl_FragColor = vec4(mix(color.rgb, mask.rgb, color.a * mask.a), color.a);
|
|
7963
8035
|
}`
|
|
7964
8036
|
}));
|
|
7965
|
-
__decorateClass$
|
|
8037
|
+
__decorateClass$z([
|
|
7966
8038
|
modernIdoc.property({ default: () => [] })
|
|
7967
8039
|
], exports.ColorOverlayEffect.prototype, "colors", 2);
|
|
7968
|
-
__decorateClass$
|
|
8040
|
+
__decorateClass$z([
|
|
7969
8041
|
modernIdoc.property({ fallback: 0.5 })
|
|
7970
8042
|
], exports.ColorOverlayEffect.prototype, "alpha", 2);
|
|
7971
|
-
exports.ColorOverlayEffect = __decorateClass$
|
|
8043
|
+
exports.ColorOverlayEffect = __decorateClass$z([
|
|
7972
8044
|
customNode("ColorOverlayEffect")
|
|
7973
8045
|
], exports.ColorOverlayEffect);
|
|
7974
8046
|
|
|
7975
|
-
var __defProp$
|
|
7976
|
-
var __getOwnPropDesc$
|
|
7977
|
-
var __defNormalProp$
|
|
7978
|
-
var __decorateClass$
|
|
7979
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
8047
|
+
var __defProp$v = Object.defineProperty;
|
|
8048
|
+
var __getOwnPropDesc$p = Object.getOwnPropertyDescriptor;
|
|
8049
|
+
var __defNormalProp$g = (obj, key, value) => key in obj ? __defProp$v(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8050
|
+
var __decorateClass$y = (decorators, target, key, kind) => {
|
|
8051
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$p(target, key) : target;
|
|
7980
8052
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
7981
8053
|
if (decorator = decorators[i])
|
|
7982
8054
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
7983
|
-
if (kind && result) __defProp$
|
|
8055
|
+
if (kind && result) __defProp$v(target, key, result);
|
|
7984
8056
|
return result;
|
|
7985
8057
|
};
|
|
7986
|
-
var __publicField$
|
|
8058
|
+
var __publicField$g = (obj, key, value) => __defNormalProp$g(obj, key + "" , value);
|
|
7987
8059
|
exports.ColorRemoveEffect = class ColorRemoveEffect extends exports.Effect {
|
|
7988
8060
|
_color = new Color();
|
|
7989
8061
|
constructor(properties, children = []) {
|
|
@@ -8014,7 +8086,7 @@ exports.ColorRemoveEffect = class ColorRemoveEffect extends exports.Effect {
|
|
|
8014
8086
|
});
|
|
8015
8087
|
}
|
|
8016
8088
|
};
|
|
8017
|
-
__publicField$
|
|
8089
|
+
__publicField$g(exports.ColorRemoveEffect, "material", new Material({
|
|
8018
8090
|
vert: `precision mediump float;
|
|
8019
8091
|
attribute vec2 position;
|
|
8020
8092
|
attribute vec2 uv;
|
|
@@ -8047,28 +8119,28 @@ void main(void) {
|
|
|
8047
8119
|
gl_FragColor = color;
|
|
8048
8120
|
}`
|
|
8049
8121
|
}));
|
|
8050
|
-
__decorateClass$
|
|
8122
|
+
__decorateClass$y([
|
|
8051
8123
|
modernIdoc.property({ default: () => [] })
|
|
8052
8124
|
], exports.ColorRemoveEffect.prototype, "colors", 2);
|
|
8053
|
-
__decorateClass$
|
|
8125
|
+
__decorateClass$y([
|
|
8054
8126
|
modernIdoc.property({ fallback: 0.5 })
|
|
8055
8127
|
], exports.ColorRemoveEffect.prototype, "epsilon", 2);
|
|
8056
|
-
exports.ColorRemoveEffect = __decorateClass$
|
|
8128
|
+
exports.ColorRemoveEffect = __decorateClass$y([
|
|
8057
8129
|
customNode("ColorRemoveEffect")
|
|
8058
8130
|
], exports.ColorRemoveEffect);
|
|
8059
8131
|
|
|
8060
|
-
var __defProp$
|
|
8061
|
-
var __getOwnPropDesc$
|
|
8062
|
-
var __defNormalProp$
|
|
8063
|
-
var __decorateClass$
|
|
8064
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
8132
|
+
var __defProp$u = Object.defineProperty;
|
|
8133
|
+
var __getOwnPropDesc$o = Object.getOwnPropertyDescriptor;
|
|
8134
|
+
var __defNormalProp$f = (obj, key, value) => key in obj ? __defProp$u(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8135
|
+
var __decorateClass$x = (decorators, target, key, kind) => {
|
|
8136
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$o(target, key) : target;
|
|
8065
8137
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
8066
8138
|
if (decorator = decorators[i])
|
|
8067
8139
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
8068
|
-
if (kind && result) __defProp$
|
|
8140
|
+
if (kind && result) __defProp$u(target, key, result);
|
|
8069
8141
|
return result;
|
|
8070
8142
|
};
|
|
8071
|
-
var __publicField$
|
|
8143
|
+
var __publicField$f = (obj, key, value) => __defNormalProp$f(obj, key + "" , value);
|
|
8072
8144
|
const MAX_COLORS = 50;
|
|
8073
8145
|
exports.ColorReplaceEffect = class ColorReplaceEffect extends exports.Effect {
|
|
8074
8146
|
_color = new Color();
|
|
@@ -8114,7 +8186,7 @@ exports.ColorReplaceEffect = class ColorReplaceEffect extends exports.Effect {
|
|
|
8114
8186
|
});
|
|
8115
8187
|
}
|
|
8116
8188
|
};
|
|
8117
|
-
__publicField$
|
|
8189
|
+
__publicField$f(exports.ColorReplaceEffect, "material", new Material({
|
|
8118
8190
|
vert: `precision mediump float;
|
|
8119
8191
|
attribute vec2 position;
|
|
8120
8192
|
attribute vec2 uv;
|
|
@@ -8154,25 +8226,139 @@ void main(void) {
|
|
|
8154
8226
|
}
|
|
8155
8227
|
}`
|
|
8156
8228
|
}));
|
|
8157
|
-
__decorateClass$
|
|
8229
|
+
__decorateClass$x([
|
|
8158
8230
|
modernIdoc.property({ default: () => [] })
|
|
8159
8231
|
], exports.ColorReplaceEffect.prototype, "colors", 2);
|
|
8160
|
-
__decorateClass$
|
|
8232
|
+
__decorateClass$x([
|
|
8161
8233
|
modernIdoc.property({ fallback: 0.05 })
|
|
8162
8234
|
], exports.ColorReplaceEffect.prototype, "epsilon", 2);
|
|
8163
|
-
exports.ColorReplaceEffect = __decorateClass$
|
|
8235
|
+
exports.ColorReplaceEffect = __decorateClass$x([
|
|
8164
8236
|
customNode("ColorReplaceEffect")
|
|
8165
8237
|
], exports.ColorReplaceEffect);
|
|
8166
8238
|
|
|
8167
|
-
var __defProp$
|
|
8168
|
-
var __getOwnPropDesc$
|
|
8169
|
-
var __defNormalProp$
|
|
8170
|
-
var __decorateClass$
|
|
8171
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
8239
|
+
var __defProp$t = Object.defineProperty;
|
|
8240
|
+
var __getOwnPropDesc$n = Object.getOwnPropertyDescriptor;
|
|
8241
|
+
var __defNormalProp$e = (obj, key, value) => key in obj ? __defProp$t(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8242
|
+
var __decorateClass$w = (decorators, target, key, kind) => {
|
|
8243
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$n(target, key) : target;
|
|
8172
8244
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
8173
8245
|
if (decorator = decorators[i])
|
|
8174
8246
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
8175
|
-
if (kind && result) __defProp$
|
|
8247
|
+
if (kind && result) __defProp$t(target, key, result);
|
|
8248
|
+
return result;
|
|
8249
|
+
};
|
|
8250
|
+
var __publicField$e = (obj, key, value) => __defNormalProp$e(obj, key + "" , value);
|
|
8251
|
+
exports.DrawboardEffect = class DrawboardEffect extends exports.Effect {
|
|
8252
|
+
constructor(properties, children = []) {
|
|
8253
|
+
super();
|
|
8254
|
+
this.setProperties(properties).append(children);
|
|
8255
|
+
}
|
|
8256
|
+
apply(renderer, source) {
|
|
8257
|
+
source.redraw(renderer, () => {
|
|
8258
|
+
const viewMatrix = renderer.program.uniforms.viewMatrix;
|
|
8259
|
+
QuadUvGeometry.draw(renderer, exports.DrawboardEffect.material, {
|
|
8260
|
+
sampler: 0,
|
|
8261
|
+
inputSize: [source.width, source.height],
|
|
8262
|
+
zoom: [viewMatrix[0], viewMatrix[4]],
|
|
8263
|
+
translate: [viewMatrix[6], viewMatrix[7]],
|
|
8264
|
+
checkerboard: this.checkerboard ? 1 : 0,
|
|
8265
|
+
checkerboardScale: this.checkerboardScale,
|
|
8266
|
+
pixelGrid: this.pixelGrid ? 1 : 0,
|
|
8267
|
+
pixelGridSize: [
|
|
8268
|
+
viewMatrix[0] > 4 ? Math.ceil(0.5 / viewMatrix[0] * 1e4) / 1e4 : 0,
|
|
8269
|
+
viewMatrix[4] > 4 ? Math.ceil(0.5 / viewMatrix[4] * 1e4) / 1e4 : 0
|
|
8270
|
+
]
|
|
8271
|
+
});
|
|
8272
|
+
});
|
|
8273
|
+
}
|
|
8274
|
+
};
|
|
8275
|
+
__publicField$e(exports.DrawboardEffect, "material", new Material({
|
|
8276
|
+
vert: `precision mediump float;
|
|
8277
|
+
attribute vec2 position;
|
|
8278
|
+
attribute vec2 uv;
|
|
8279
|
+
uniform mat3 projectionMatrix;
|
|
8280
|
+
uniform mat3 viewMatrix;
|
|
8281
|
+
varying vec2 vUv;
|
|
8282
|
+
void main() {
|
|
8283
|
+
gl_Position = vec4(position.xy, 0.0, 1.0);
|
|
8284
|
+
vUv = uv;
|
|
8285
|
+
}`,
|
|
8286
|
+
frag: `varying vec2 vUv;
|
|
8287
|
+
uniform sampler2D sampler;
|
|
8288
|
+
uniform int checkerboard;
|
|
8289
|
+
uniform float checkerboardScale;
|
|
8290
|
+
uniform int pixelGrid;
|
|
8291
|
+
uniform vec2 pixelGridSize;
|
|
8292
|
+
uniform vec2 inputSize;
|
|
8293
|
+
uniform vec2 zoom;
|
|
8294
|
+
uniform vec2 translate;
|
|
8295
|
+
|
|
8296
|
+
vec4 renderCheckerboard(vec2 coord, vec4 color, vec2 scale) {
|
|
8297
|
+
vec2 fractValue = fract(coord * scale) - 0.5;
|
|
8298
|
+
float value = fractValue.x * fractValue.y < 0.0 ? 1.0 : 0.95;
|
|
8299
|
+
return vec4(value * (1.0 - color.a) + color.rgb, 1);
|
|
8300
|
+
}
|
|
8301
|
+
|
|
8302
|
+
vec3 renderPixelGrid(vec2 coord, vec3 rgb, vec2 size) {
|
|
8303
|
+
vec2 corner = fract(coord);
|
|
8304
|
+
float gridWeight = max(float(corner.x < size.x), float(corner.y < size.y));
|
|
8305
|
+
vec3 gridColor;
|
|
8306
|
+
vec3 weights = vec3(0.299, 0.587, 0.114);
|
|
8307
|
+
float c2 = dot(rgb * rgb, weights);
|
|
8308
|
+
float luminance = sqrt(c2);
|
|
8309
|
+
if (luminance > 0.5) {
|
|
8310
|
+
float target = (luminance - 0.05) / luminance;
|
|
8311
|
+
gridColor = rgb * target;
|
|
8312
|
+
}
|
|
8313
|
+
else {
|
|
8314
|
+
float target = luminance * 0.8 + 0.15;
|
|
8315
|
+
float c1 = dot(rgb, weights);
|
|
8316
|
+
float a = 1.0 - 2.0 * c1 + c2;
|
|
8317
|
+
float b = c2 - c1;
|
|
8318
|
+
gridColor = mix(rgb, vec3(1), (b + sqrt(b * b - a * (c2 - target * target))) / a);
|
|
8319
|
+
}
|
|
8320
|
+
return mix(rgb, gridColor, gridWeight);
|
|
8321
|
+
}
|
|
8322
|
+
|
|
8323
|
+
void main(void) {
|
|
8324
|
+
vec4 color = texture2D(sampler, vUv);
|
|
8325
|
+
vec2 coord = vec2(vUv.x, 1.0 - vUv.y);
|
|
8326
|
+
coord = (coord * inputSize - translate) / zoom;
|
|
8327
|
+
|
|
8328
|
+
if (checkerboard > 0) {
|
|
8329
|
+
color = renderCheckerboard(coord, color, vec2(checkerboardScale) * zoom);
|
|
8330
|
+
}
|
|
8331
|
+
if (pixelGrid > 0) {
|
|
8332
|
+
color = vec4(
|
|
8333
|
+
renderPixelGrid(coord, color.rgb, pixelGridSize),
|
|
8334
|
+
color.a
|
|
8335
|
+
);
|
|
8336
|
+
}
|
|
8337
|
+
gl_FragColor = color;
|
|
8338
|
+
}`
|
|
8339
|
+
}));
|
|
8340
|
+
__decorateClass$w([
|
|
8341
|
+
modernIdoc.property({ fallback: false })
|
|
8342
|
+
], exports.DrawboardEffect.prototype, "checkerboard", 2);
|
|
8343
|
+
__decorateClass$w([
|
|
8344
|
+
modernIdoc.property({ fallback: 1 / 16 })
|
|
8345
|
+
], exports.DrawboardEffect.prototype, "checkerboardScale", 2);
|
|
8346
|
+
__decorateClass$w([
|
|
8347
|
+
modernIdoc.property({ fallback: false })
|
|
8348
|
+
], exports.DrawboardEffect.prototype, "pixelGrid", 2);
|
|
8349
|
+
exports.DrawboardEffect = __decorateClass$w([
|
|
8350
|
+
customNode("DrawboardEffect")
|
|
8351
|
+
], exports.DrawboardEffect);
|
|
8352
|
+
|
|
8353
|
+
var __defProp$s = Object.defineProperty;
|
|
8354
|
+
var __getOwnPropDesc$m = Object.getOwnPropertyDescriptor;
|
|
8355
|
+
var __defNormalProp$d = (obj, key, value) => key in obj ? __defProp$s(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8356
|
+
var __decorateClass$v = (decorators, target, key, kind) => {
|
|
8357
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$m(target, key) : target;
|
|
8358
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
8359
|
+
if (decorator = decorators[i])
|
|
8360
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
8361
|
+
if (kind && result) __defProp$s(target, key, result);
|
|
8176
8362
|
return result;
|
|
8177
8363
|
};
|
|
8178
8364
|
var __publicField$d = (obj, key, value) => __defNormalProp$d(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
@@ -8278,25 +8464,25 @@ void main(void) {
|
|
|
8278
8464
|
}`,
|
|
8279
8465
|
frag: frag$2
|
|
8280
8466
|
}));
|
|
8281
|
-
__decorateClass$
|
|
8467
|
+
__decorateClass$v([
|
|
8282
8468
|
modernIdoc.property({ fallback: 4 })
|
|
8283
8469
|
], exports.GaussianBlurEffect.prototype, "strength", 2);
|
|
8284
|
-
__decorateClass$
|
|
8470
|
+
__decorateClass$v([
|
|
8285
8471
|
modernIdoc.property({ fallback: 3 })
|
|
8286
8472
|
], exports.GaussianBlurEffect.prototype, "quality", 2);
|
|
8287
|
-
exports.GaussianBlurEffect = __decorateClass$
|
|
8473
|
+
exports.GaussianBlurEffect = __decorateClass$v([
|
|
8288
8474
|
customNode("GaussianBlurEffect")
|
|
8289
8475
|
], exports.GaussianBlurEffect);
|
|
8290
8476
|
|
|
8291
|
-
var __defProp$
|
|
8292
|
-
var __getOwnPropDesc$
|
|
8293
|
-
var __defNormalProp$c = (obj, key, value) => key in obj ? __defProp$
|
|
8294
|
-
var __decorateClass$
|
|
8295
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
8477
|
+
var __defProp$r = Object.defineProperty;
|
|
8478
|
+
var __getOwnPropDesc$l = Object.getOwnPropertyDescriptor;
|
|
8479
|
+
var __defNormalProp$c = (obj, key, value) => key in obj ? __defProp$r(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8480
|
+
var __decorateClass$u = (decorators, target, key, kind) => {
|
|
8481
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$l(target, key) : target;
|
|
8296
8482
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
8297
8483
|
if (decorator = decorators[i])
|
|
8298
8484
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
8299
|
-
if (kind && result) __defProp$
|
|
8485
|
+
if (kind && result) __defProp$r(target, key, result);
|
|
8300
8486
|
return result;
|
|
8301
8487
|
};
|
|
8302
8488
|
var __publicField$c = (obj, key, value) => __defNormalProp$c(obj, key + "" , value);
|
|
@@ -8360,34 +8546,34 @@ void main(void) {
|
|
|
8360
8546
|
gl_FragColor = sample;
|
|
8361
8547
|
}`
|
|
8362
8548
|
}));
|
|
8363
|
-
__decorateClass$
|
|
8549
|
+
__decorateClass$u([
|
|
8364
8550
|
modernIdoc.property({ fallback: "#000000FF" })
|
|
8365
8551
|
], exports.DropShadowEffect.prototype, "color", 2);
|
|
8366
|
-
__decorateClass$
|
|
8552
|
+
__decorateClass$u([
|
|
8367
8553
|
modernIdoc.property({ fallback: 4 })
|
|
8368
8554
|
], exports.DropShadowEffect.prototype, "blur", 2);
|
|
8369
|
-
__decorateClass$
|
|
8555
|
+
__decorateClass$u([
|
|
8370
8556
|
modernIdoc.property({ fallback: 4 })
|
|
8371
8557
|
], exports.DropShadowEffect.prototype, "offsetX", 2);
|
|
8372
|
-
__decorateClass$
|
|
8558
|
+
__decorateClass$u([
|
|
8373
8559
|
modernIdoc.property({ fallback: 4 })
|
|
8374
8560
|
], exports.DropShadowEffect.prototype, "offsetY", 2);
|
|
8375
|
-
__decorateClass$
|
|
8561
|
+
__decorateClass$u([
|
|
8376
8562
|
modernIdoc.property({ fallback: false })
|
|
8377
8563
|
], exports.DropShadowEffect.prototype, "shadowOnly", 2);
|
|
8378
|
-
exports.DropShadowEffect = __decorateClass$
|
|
8564
|
+
exports.DropShadowEffect = __decorateClass$u([
|
|
8379
8565
|
customNode("DropShadowEffect")
|
|
8380
8566
|
], exports.DropShadowEffect);
|
|
8381
8567
|
|
|
8382
|
-
var __defProp$
|
|
8383
|
-
var __getOwnPropDesc$
|
|
8384
|
-
var __defNormalProp$b = (obj, key, value) => key in obj ? __defProp$
|
|
8385
|
-
var __decorateClass$
|
|
8386
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
8568
|
+
var __defProp$q = Object.defineProperty;
|
|
8569
|
+
var __getOwnPropDesc$k = Object.getOwnPropertyDescriptor;
|
|
8570
|
+
var __defNormalProp$b = (obj, key, value) => key in obj ? __defProp$q(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8571
|
+
var __decorateClass$t = (decorators, target, key, kind) => {
|
|
8572
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$k(target, key) : target;
|
|
8387
8573
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
8388
8574
|
if (decorator = decorators[i])
|
|
8389
8575
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
8390
|
-
if (kind && result) __defProp$
|
|
8576
|
+
if (kind && result) __defProp$q(target, key, result);
|
|
8391
8577
|
return result;
|
|
8392
8578
|
};
|
|
8393
8579
|
var __publicField$b = (obj, key, value) => __defNormalProp$b(obj, key + "" , value);
|
|
@@ -8432,22 +8618,22 @@ void main(void) {
|
|
|
8432
8618
|
gl_FragColor = vec4(color.rgb * alpha, alpha);
|
|
8433
8619
|
}`
|
|
8434
8620
|
}));
|
|
8435
|
-
__decorateClass$
|
|
8621
|
+
__decorateClass$t([
|
|
8436
8622
|
modernIdoc.property({ fallback: 5 })
|
|
8437
8623
|
], exports.EmbossEffect.prototype, "strength", 2);
|
|
8438
|
-
exports.EmbossEffect = __decorateClass$
|
|
8624
|
+
exports.EmbossEffect = __decorateClass$t([
|
|
8439
8625
|
customNode("EmbossEffect")
|
|
8440
8626
|
], exports.EmbossEffect);
|
|
8441
8627
|
|
|
8442
|
-
var __defProp$
|
|
8443
|
-
var __getOwnPropDesc$
|
|
8444
|
-
var __defNormalProp$a = (obj, key, value) => key in obj ? __defProp$
|
|
8445
|
-
var __decorateClass$
|
|
8446
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
8628
|
+
var __defProp$p = Object.defineProperty;
|
|
8629
|
+
var __getOwnPropDesc$j = Object.getOwnPropertyDescriptor;
|
|
8630
|
+
var __defNormalProp$a = (obj, key, value) => key in obj ? __defProp$p(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8631
|
+
var __decorateClass$s = (decorators, target, key, kind) => {
|
|
8632
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$j(target, key) : target;
|
|
8447
8633
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
8448
8634
|
if (decorator = decorators[i])
|
|
8449
8635
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
8450
|
-
if (kind && result) __defProp$
|
|
8636
|
+
if (kind && result) __defProp$p(target, key, result);
|
|
8451
8637
|
return result;
|
|
8452
8638
|
};
|
|
8453
8639
|
var __publicField$a = (obj, key, value) => __defNormalProp$a(obj, key + "" , value);
|
|
@@ -8621,46 +8807,46 @@ void main(void) {
|
|
|
8621
8807
|
gl_FragColor.a = texture2D(sampler, coord).a;
|
|
8622
8808
|
}`
|
|
8623
8809
|
}));
|
|
8624
|
-
__decorateClass$
|
|
8810
|
+
__decorateClass$s([
|
|
8625
8811
|
modernIdoc.property({ fallback: 10 })
|
|
8626
8812
|
], exports.GlitchEffect.prototype, "slices", 2);
|
|
8627
|
-
__decorateClass$
|
|
8813
|
+
__decorateClass$s([
|
|
8628
8814
|
modernIdoc.property({ fallback: 512 })
|
|
8629
8815
|
], exports.GlitchEffect.prototype, "sampleSize", 2);
|
|
8630
|
-
__decorateClass$
|
|
8816
|
+
__decorateClass$s([
|
|
8631
8817
|
modernIdoc.property({ fallback: 100 })
|
|
8632
8818
|
], exports.GlitchEffect.prototype, "offset", 2);
|
|
8633
|
-
__decorateClass$
|
|
8819
|
+
__decorateClass$s([
|
|
8634
8820
|
modernIdoc.property({ fallback: 0 })
|
|
8635
8821
|
], exports.GlitchEffect.prototype, "direction", 2);
|
|
8636
|
-
__decorateClass$
|
|
8822
|
+
__decorateClass$s([
|
|
8637
8823
|
modernIdoc.property({ fallback: 2 })
|
|
8638
8824
|
], exports.GlitchEffect.prototype, "fillMode", 2);
|
|
8639
|
-
__decorateClass$
|
|
8825
|
+
__decorateClass$s([
|
|
8640
8826
|
modernIdoc.property({ fallback: 0 })
|
|
8641
8827
|
], exports.GlitchEffect.prototype, "seed", 2);
|
|
8642
|
-
__decorateClass$
|
|
8828
|
+
__decorateClass$s([
|
|
8643
8829
|
modernIdoc.property({ default: () => [2, 2] })
|
|
8644
8830
|
], exports.GlitchEffect.prototype, "red", 2);
|
|
8645
|
-
__decorateClass$
|
|
8831
|
+
__decorateClass$s([
|
|
8646
8832
|
modernIdoc.property({ default: () => [-10, 4] })
|
|
8647
8833
|
], exports.GlitchEffect.prototype, "green", 2);
|
|
8648
|
-
__decorateClass$
|
|
8834
|
+
__decorateClass$s([
|
|
8649
8835
|
modernIdoc.property({ default: () => [10, -4] })
|
|
8650
8836
|
], exports.GlitchEffect.prototype, "blue", 2);
|
|
8651
|
-
exports.GlitchEffect = __decorateClass$
|
|
8837
|
+
exports.GlitchEffect = __decorateClass$s([
|
|
8652
8838
|
customNode("GlitchEffect")
|
|
8653
8839
|
], exports.GlitchEffect);
|
|
8654
8840
|
|
|
8655
|
-
var __defProp$
|
|
8656
|
-
var __getOwnPropDesc$
|
|
8657
|
-
var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$
|
|
8658
|
-
var __decorateClass$
|
|
8659
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
8841
|
+
var __defProp$o = Object.defineProperty;
|
|
8842
|
+
var __getOwnPropDesc$i = Object.getOwnPropertyDescriptor;
|
|
8843
|
+
var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$o(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8844
|
+
var __decorateClass$r = (decorators, target, key, kind) => {
|
|
8845
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$i(target, key) : target;
|
|
8660
8846
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
8661
8847
|
if (decorator = decorators[i])
|
|
8662
8848
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
8663
|
-
if (kind && result) __defProp$
|
|
8849
|
+
if (kind && result) __defProp$o(target, key, result);
|
|
8664
8850
|
return result;
|
|
8665
8851
|
};
|
|
8666
8852
|
var __publicField$9 = (obj, key, value) => __defNormalProp$9(obj, key + "" , value);
|
|
@@ -8838,39 +9024,39 @@ void main(void) {
|
|
|
8838
9024
|
gl_FragColor = vec4(color.rgb + mist.rgb, color.a);
|
|
8839
9025
|
}`
|
|
8840
9026
|
}));
|
|
8841
|
-
__decorateClass$
|
|
9027
|
+
__decorateClass$r([
|
|
8842
9028
|
modernIdoc.property({ fallback: 0 })
|
|
8843
9029
|
], exports.GodrayEffect.prototype, "time", 2);
|
|
8844
|
-
__decorateClass$
|
|
9030
|
+
__decorateClass$r([
|
|
8845
9031
|
modernIdoc.property({ fallback: 30 })
|
|
8846
9032
|
], exports.GodrayEffect.prototype, "angle", 2);
|
|
8847
|
-
__decorateClass$
|
|
9033
|
+
__decorateClass$r([
|
|
8848
9034
|
modernIdoc.property({ fallback: 0.5 })
|
|
8849
9035
|
], exports.GodrayEffect.prototype, "gain", 2);
|
|
8850
|
-
__decorateClass$
|
|
9036
|
+
__decorateClass$r([
|
|
8851
9037
|
modernIdoc.property({ fallback: 2.5 })
|
|
8852
9038
|
], exports.GodrayEffect.prototype, "lacunarity", 2);
|
|
8853
|
-
__decorateClass$
|
|
9039
|
+
__decorateClass$r([
|
|
8854
9040
|
modernIdoc.property({ fallback: true })
|
|
8855
9041
|
], exports.GodrayEffect.prototype, "parallel", 2);
|
|
8856
|
-
__decorateClass$
|
|
9042
|
+
__decorateClass$r([
|
|
8857
9043
|
modernIdoc.property({ default: () => [0, 0] })
|
|
8858
9044
|
], exports.GodrayEffect.prototype, "center", 2);
|
|
8859
|
-
__decorateClass$
|
|
9045
|
+
__decorateClass$r([
|
|
8860
9046
|
modernIdoc.property({ fallback: 1 })
|
|
8861
9047
|
], exports.GodrayEffect.prototype, "alpha", 2);
|
|
8862
|
-
exports.GodrayEffect = __decorateClass$
|
|
9048
|
+
exports.GodrayEffect = __decorateClass$r([
|
|
8863
9049
|
customNode("GodrayEffect")
|
|
8864
9050
|
], exports.GodrayEffect);
|
|
8865
9051
|
|
|
8866
|
-
var __defProp$
|
|
8867
|
-
var __getOwnPropDesc$
|
|
8868
|
-
var __decorateClass$
|
|
8869
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
9052
|
+
var __defProp$n = Object.defineProperty;
|
|
9053
|
+
var __getOwnPropDesc$h = Object.getOwnPropertyDescriptor;
|
|
9054
|
+
var __decorateClass$q = (decorators, target, key, kind) => {
|
|
9055
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$h(target, key) : target;
|
|
8870
9056
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
8871
9057
|
if (decorator = decorators[i])
|
|
8872
9058
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
8873
|
-
if (kind && result) __defProp$
|
|
9059
|
+
if (kind && result) __defProp$n(target, key, result);
|
|
8874
9060
|
return result;
|
|
8875
9061
|
};
|
|
8876
9062
|
const frag$1 = `varying vec2 vUv;
|
|
@@ -8960,28 +9146,28 @@ void main() {
|
|
|
8960
9146
|
});
|
|
8961
9147
|
}
|
|
8962
9148
|
};
|
|
8963
|
-
__decorateClass$
|
|
9149
|
+
__decorateClass$q([
|
|
8964
9150
|
modernIdoc.property({ fallback: 4 })
|
|
8965
9151
|
], exports.KawaseBlurEffect.prototype, "strength", 2);
|
|
8966
|
-
__decorateClass$
|
|
9152
|
+
__decorateClass$q([
|
|
8967
9153
|
modernIdoc.property({ fallback: 3 })
|
|
8968
9154
|
], exports.KawaseBlurEffect.prototype, "quality", 2);
|
|
8969
|
-
__decorateClass$
|
|
9155
|
+
__decorateClass$q([
|
|
8970
9156
|
modernIdoc.property({ default: () => [1, 1] })
|
|
8971
9157
|
], exports.KawaseBlurEffect.prototype, "pixelSize", 2);
|
|
8972
|
-
exports.KawaseBlurEffect = __decorateClass$
|
|
9158
|
+
exports.KawaseBlurEffect = __decorateClass$q([
|
|
8973
9159
|
customNode("KawaseBlurEffect")
|
|
8974
9160
|
], exports.KawaseBlurEffect);
|
|
8975
9161
|
|
|
8976
|
-
var __defProp$
|
|
8977
|
-
var __getOwnPropDesc$
|
|
8978
|
-
var __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$
|
|
8979
|
-
var __decorateClass$
|
|
8980
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
9162
|
+
var __defProp$m = Object.defineProperty;
|
|
9163
|
+
var __getOwnPropDesc$g = Object.getOwnPropertyDescriptor;
|
|
9164
|
+
var __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$m(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
9165
|
+
var __decorateClass$p = (decorators, target, key, kind) => {
|
|
9166
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$g(target, key) : target;
|
|
8981
9167
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
8982
9168
|
if (decorator = decorators[i])
|
|
8983
9169
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
8984
|
-
if (kind && result) __defProp$
|
|
9170
|
+
if (kind && result) __defProp$m(target, key, result);
|
|
8985
9171
|
return result;
|
|
8986
9172
|
};
|
|
8987
9173
|
var __publicField$8 = (obj, key, value) => __defNormalProp$8(obj, key + "" , value);
|
|
@@ -9069,25 +9255,25 @@ void main(void) {
|
|
|
9069
9255
|
}
|
|
9070
9256
|
}`
|
|
9071
9257
|
}));
|
|
9072
|
-
__decorateClass$
|
|
9258
|
+
__decorateClass$p([
|
|
9073
9259
|
modernIdoc.property({ internal: true })
|
|
9074
9260
|
], exports.MaskEffect.prototype, "texture", 2);
|
|
9075
|
-
__decorateClass$
|
|
9261
|
+
__decorateClass$p([
|
|
9076
9262
|
modernIdoc.property({ fallback: "" })
|
|
9077
9263
|
], exports.MaskEffect.prototype, "src", 2);
|
|
9078
|
-
exports.MaskEffect = __decorateClass$
|
|
9264
|
+
exports.MaskEffect = __decorateClass$p([
|
|
9079
9265
|
customNode("MaskEffect")
|
|
9080
9266
|
], exports.MaskEffect);
|
|
9081
9267
|
|
|
9082
|
-
var __defProp$
|
|
9083
|
-
var __getOwnPropDesc$
|
|
9084
|
-
var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$
|
|
9085
|
-
var __decorateClass$
|
|
9086
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
9268
|
+
var __defProp$l = Object.defineProperty;
|
|
9269
|
+
var __getOwnPropDesc$f = Object.getOwnPropertyDescriptor;
|
|
9270
|
+
var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$l(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
9271
|
+
var __decorateClass$o = (decorators, target, key, kind) => {
|
|
9272
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$f(target, key) : target;
|
|
9087
9273
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
9088
9274
|
if (decorator = decorators[i])
|
|
9089
9275
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
9090
|
-
if (kind && result) __defProp$
|
|
9276
|
+
if (kind && result) __defProp$l(target, key, result);
|
|
9091
9277
|
return result;
|
|
9092
9278
|
};
|
|
9093
9279
|
var __publicField$7 = (obj, key, value) => __defNormalProp$7(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
@@ -9174,40 +9360,40 @@ void main() {
|
|
|
9174
9360
|
};
|
|
9175
9361
|
__publicField$7(exports.OutlineEffect, "MIN_SAMPLES", 1);
|
|
9176
9362
|
__publicField$7(exports.OutlineEffect, "MAX_SAMPLES", 100);
|
|
9177
|
-
__decorateClass$
|
|
9363
|
+
__decorateClass$o([
|
|
9178
9364
|
modernIdoc.property({ fallback: "#000000ff" })
|
|
9179
9365
|
], exports.OutlineEffect.prototype, "color", 2);
|
|
9180
|
-
__decorateClass$
|
|
9366
|
+
__decorateClass$o([
|
|
9181
9367
|
modernIdoc.property({ fallback: 1 })
|
|
9182
9368
|
], exports.OutlineEffect.prototype, "width", 2);
|
|
9183
|
-
__decorateClass$
|
|
9369
|
+
__decorateClass$o([
|
|
9184
9370
|
modernIdoc.property({ fallback: "solid" })
|
|
9185
9371
|
], exports.OutlineEffect.prototype, "style", 2);
|
|
9186
|
-
__decorateClass$
|
|
9372
|
+
__decorateClass$o([
|
|
9187
9373
|
modernIdoc.property()
|
|
9188
9374
|
], exports.OutlineEffect.prototype, "image", 2);
|
|
9189
|
-
__decorateClass$
|
|
9375
|
+
__decorateClass$o([
|
|
9190
9376
|
modernIdoc.property({ fallback: 1 })
|
|
9191
9377
|
], exports.OutlineEffect.prototype, "opacity", 2);
|
|
9192
|
-
__decorateClass$
|
|
9378
|
+
__decorateClass$o([
|
|
9193
9379
|
modernIdoc.property({ fallback: 0.1 })
|
|
9194
9380
|
], exports.OutlineEffect.prototype, "quality", 2);
|
|
9195
|
-
__decorateClass$
|
|
9381
|
+
__decorateClass$o([
|
|
9196
9382
|
modernIdoc.property({ fallback: false })
|
|
9197
9383
|
], exports.OutlineEffect.prototype, "knockout", 2);
|
|
9198
|
-
exports.OutlineEffect = __decorateClass$
|
|
9384
|
+
exports.OutlineEffect = __decorateClass$o([
|
|
9199
9385
|
customNode("OutlineEffect")
|
|
9200
9386
|
], exports.OutlineEffect);
|
|
9201
9387
|
|
|
9202
|
-
var __defProp$
|
|
9203
|
-
var __getOwnPropDesc$
|
|
9204
|
-
var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$
|
|
9205
|
-
var __decorateClass$
|
|
9206
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
9388
|
+
var __defProp$k = Object.defineProperty;
|
|
9389
|
+
var __getOwnPropDesc$e = Object.getOwnPropertyDescriptor;
|
|
9390
|
+
var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$k(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
9391
|
+
var __decorateClass$n = (decorators, target, key, kind) => {
|
|
9392
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$e(target, key) : target;
|
|
9207
9393
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
9208
9394
|
if (decorator = decorators[i])
|
|
9209
9395
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
9210
|
-
if (kind && result) __defProp$
|
|
9396
|
+
if (kind && result) __defProp$k(target, key, result);
|
|
9211
9397
|
return result;
|
|
9212
9398
|
};
|
|
9213
9399
|
var __publicField$6 = (obj, key, value) => __defNormalProp$6(obj, key + "" , value);
|
|
@@ -9263,22 +9449,22 @@ void main(void) {
|
|
|
9263
9449
|
gl_FragColor = texture2D(sampler, coord);
|
|
9264
9450
|
}`
|
|
9265
9451
|
}));
|
|
9266
|
-
__decorateClass$
|
|
9452
|
+
__decorateClass$n([
|
|
9267
9453
|
modernIdoc.property({ fallback: 10 })
|
|
9268
9454
|
], exports.PixelateEffect.prototype, "strength", 2);
|
|
9269
|
-
exports.PixelateEffect = __decorateClass$
|
|
9455
|
+
exports.PixelateEffect = __decorateClass$n([
|
|
9270
9456
|
customNode("PixelateEffect")
|
|
9271
9457
|
], exports.PixelateEffect);
|
|
9272
9458
|
|
|
9273
|
-
var __defProp$
|
|
9274
|
-
var __getOwnPropDesc$
|
|
9275
|
-
var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$
|
|
9276
|
-
var __decorateClass$
|
|
9277
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
9459
|
+
var __defProp$j = Object.defineProperty;
|
|
9460
|
+
var __getOwnPropDesc$d = Object.getOwnPropertyDescriptor;
|
|
9461
|
+
var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$j(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
9462
|
+
var __decorateClass$m = (decorators, target, key, kind) => {
|
|
9463
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$d(target, key) : target;
|
|
9278
9464
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
9279
9465
|
if (decorator = decorators[i])
|
|
9280
9466
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
9281
|
-
if (kind && result) __defProp$
|
|
9467
|
+
if (kind && result) __defProp$j(target, key, result);
|
|
9282
9468
|
return result;
|
|
9283
9469
|
};
|
|
9284
9470
|
var __publicField$5 = (obj, key, value) => __defNormalProp$5(obj, key + "" , value);
|
|
@@ -9391,19 +9577,19 @@ void main() {
|
|
|
9391
9577
|
gl_FragColor = color;
|
|
9392
9578
|
}`
|
|
9393
9579
|
}));
|
|
9394
|
-
__decorateClass$
|
|
9580
|
+
__decorateClass$m([
|
|
9395
9581
|
modernIdoc.property()
|
|
9396
9582
|
], exports.ZoomBlurEffect.prototype, "center", 2);
|
|
9397
|
-
__decorateClass$
|
|
9583
|
+
__decorateClass$m([
|
|
9398
9584
|
modernIdoc.property({ fallback: 20 })
|
|
9399
9585
|
], exports.ZoomBlurEffect.prototype, "innerRadius", 2);
|
|
9400
|
-
__decorateClass$
|
|
9586
|
+
__decorateClass$m([
|
|
9401
9587
|
modernIdoc.property({ fallback: -1 })
|
|
9402
9588
|
], exports.ZoomBlurEffect.prototype, "radius", 2);
|
|
9403
|
-
__decorateClass$
|
|
9589
|
+
__decorateClass$m([
|
|
9404
9590
|
modernIdoc.property({ fallback: 0.1 })
|
|
9405
9591
|
], exports.ZoomBlurEffect.prototype, "strength", 2);
|
|
9406
|
-
exports.ZoomBlurEffect = __decorateClass$
|
|
9592
|
+
exports.ZoomBlurEffect = __decorateClass$m([
|
|
9407
9593
|
customNode("ZoomBlurEffect")
|
|
9408
9594
|
], exports.ZoomBlurEffect);
|
|
9409
9595
|
|
|
@@ -9451,13 +9637,13 @@ function getDrawOptions(fill, box) {
|
|
|
9451
9637
|
return { disableWrapMode, uvTransform };
|
|
9452
9638
|
}
|
|
9453
9639
|
|
|
9454
|
-
var __defProp$
|
|
9455
|
-
var __decorateClass$
|
|
9640
|
+
var __defProp$i = Object.defineProperty;
|
|
9641
|
+
var __decorateClass$l = (decorators, target, key, kind) => {
|
|
9456
9642
|
var result = void 0 ;
|
|
9457
9643
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
9458
9644
|
if (decorator = decorators[i])
|
|
9459
9645
|
result = (decorator(target, key, result) ) || result;
|
|
9460
|
-
if (result) __defProp$
|
|
9646
|
+
if (result) __defProp$i(target, key, result);
|
|
9461
9647
|
return result;
|
|
9462
9648
|
};
|
|
9463
9649
|
class BaseElement2DFill extends CoreObject {
|
|
@@ -9515,7 +9701,7 @@ class BaseElement2DFill extends CoreObject {
|
|
|
9515
9701
|
await this.loadTexture();
|
|
9516
9702
|
this.parent.requestRedraw();
|
|
9517
9703
|
}
|
|
9518
|
-
|
|
9704
|
+
isValid() {
|
|
9519
9705
|
return Boolean(
|
|
9520
9706
|
this.enabled && (this._texture || this._animatedTexture || this.color)
|
|
9521
9707
|
);
|
|
@@ -9567,47 +9753,47 @@ class BaseElement2DFill extends CoreObject {
|
|
|
9567
9753
|
return this;
|
|
9568
9754
|
}
|
|
9569
9755
|
}
|
|
9570
|
-
__decorateClass$
|
|
9756
|
+
__decorateClass$l([
|
|
9571
9757
|
modernIdoc.property({ fallback: true })
|
|
9572
9758
|
], BaseElement2DFill.prototype, "enabled");
|
|
9573
|
-
__decorateClass$
|
|
9759
|
+
__decorateClass$l([
|
|
9574
9760
|
modernIdoc.property()
|
|
9575
9761
|
], BaseElement2DFill.prototype, "color");
|
|
9576
|
-
__decorateClass$
|
|
9762
|
+
__decorateClass$l([
|
|
9577
9763
|
modernIdoc.property()
|
|
9578
9764
|
], BaseElement2DFill.prototype, "image");
|
|
9579
|
-
__decorateClass$
|
|
9765
|
+
__decorateClass$l([
|
|
9580
9766
|
modernIdoc.property()
|
|
9581
9767
|
], BaseElement2DFill.prototype, "linearGradient");
|
|
9582
|
-
__decorateClass$
|
|
9768
|
+
__decorateClass$l([
|
|
9583
9769
|
modernIdoc.property()
|
|
9584
9770
|
], BaseElement2DFill.prototype, "radialGradient");
|
|
9585
|
-
__decorateClass$
|
|
9771
|
+
__decorateClass$l([
|
|
9586
9772
|
modernIdoc.property()
|
|
9587
9773
|
], BaseElement2DFill.prototype, "cropRect");
|
|
9588
|
-
__decorateClass$
|
|
9774
|
+
__decorateClass$l([
|
|
9589
9775
|
modernIdoc.property()
|
|
9590
9776
|
], BaseElement2DFill.prototype, "stretchRect");
|
|
9591
|
-
__decorateClass$
|
|
9777
|
+
__decorateClass$l([
|
|
9592
9778
|
modernIdoc.property()
|
|
9593
9779
|
], BaseElement2DFill.prototype, "dpi");
|
|
9594
|
-
__decorateClass$
|
|
9780
|
+
__decorateClass$l([
|
|
9595
9781
|
modernIdoc.property()
|
|
9596
9782
|
], BaseElement2DFill.prototype, "rotateWithShape");
|
|
9597
|
-
__decorateClass$
|
|
9783
|
+
__decorateClass$l([
|
|
9598
9784
|
modernIdoc.property()
|
|
9599
9785
|
], BaseElement2DFill.prototype, "tile");
|
|
9600
|
-
__decorateClass$
|
|
9786
|
+
__decorateClass$l([
|
|
9601
9787
|
modernIdoc.property()
|
|
9602
9788
|
], BaseElement2DFill.prototype, "opacity");
|
|
9603
9789
|
|
|
9604
|
-
var __defProp$
|
|
9605
|
-
var __decorateClass$
|
|
9790
|
+
var __defProp$h = Object.defineProperty;
|
|
9791
|
+
var __decorateClass$k = (decorators, target, key, kind) => {
|
|
9606
9792
|
var result = void 0 ;
|
|
9607
9793
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
9608
9794
|
if (decorator = decorators[i])
|
|
9609
9795
|
result = (decorator(target, key, result) ) || result;
|
|
9610
|
-
if (result) __defProp$
|
|
9796
|
+
if (result) __defProp$h(target, key, result);
|
|
9611
9797
|
return result;
|
|
9612
9798
|
};
|
|
9613
9799
|
class BaseElement2DBackground extends BaseElement2DFill {
|
|
@@ -9625,17 +9811,17 @@ class BaseElement2DBackground extends BaseElement2DFill {
|
|
|
9625
9811
|
}
|
|
9626
9812
|
}
|
|
9627
9813
|
}
|
|
9628
|
-
__decorateClass$
|
|
9814
|
+
__decorateClass$k([
|
|
9629
9815
|
modernIdoc.property()
|
|
9630
9816
|
], BaseElement2DBackground.prototype, "fillWithShape");
|
|
9631
9817
|
|
|
9632
|
-
var __defProp$
|
|
9633
|
-
var __decorateClass$
|
|
9818
|
+
var __defProp$g = Object.defineProperty;
|
|
9819
|
+
var __decorateClass$j = (decorators, target, key, kind) => {
|
|
9634
9820
|
var result = void 0 ;
|
|
9635
9821
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
9636
9822
|
if (decorator = decorators[i])
|
|
9637
9823
|
result = (decorator(target, key, result) ) || result;
|
|
9638
|
-
if (result) __defProp$
|
|
9824
|
+
if (result) __defProp$g(target, key, result);
|
|
9639
9825
|
return result;
|
|
9640
9826
|
};
|
|
9641
9827
|
class BaseElement2DForeground extends BaseElement2DFill {
|
|
@@ -9653,17 +9839,17 @@ class BaseElement2DForeground extends BaseElement2DFill {
|
|
|
9653
9839
|
}
|
|
9654
9840
|
}
|
|
9655
9841
|
}
|
|
9656
|
-
__decorateClass$
|
|
9842
|
+
__decorateClass$j([
|
|
9657
9843
|
modernIdoc.property()
|
|
9658
9844
|
], BaseElement2DForeground.prototype, "fillWithShape");
|
|
9659
9845
|
|
|
9660
|
-
var __defProp$
|
|
9661
|
-
var __decorateClass$
|
|
9846
|
+
var __defProp$f = Object.defineProperty;
|
|
9847
|
+
var __decorateClass$i = (decorators, target, key, kind) => {
|
|
9662
9848
|
var result = void 0 ;
|
|
9663
9849
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
9664
9850
|
if (decorator = decorators[i])
|
|
9665
9851
|
result = (decorator(target, key, result) ) || result;
|
|
9666
|
-
if (result) __defProp$
|
|
9852
|
+
if (result) __defProp$f(target, key, result);
|
|
9667
9853
|
return result;
|
|
9668
9854
|
};
|
|
9669
9855
|
class BaseElement2DOutline extends BaseElement2DFill {
|
|
@@ -9684,9 +9870,9 @@ class BaseElement2DOutline extends BaseElement2DFill {
|
|
|
9684
9870
|
break;
|
|
9685
9871
|
}
|
|
9686
9872
|
}
|
|
9687
|
-
|
|
9873
|
+
isValid() {
|
|
9688
9874
|
return Boolean(
|
|
9689
|
-
this.enabled && (this.width || this.color || super.
|
|
9875
|
+
this.enabled && (this.width || this.color || super.isValid())
|
|
9690
9876
|
);
|
|
9691
9877
|
}
|
|
9692
9878
|
draw() {
|
|
@@ -9706,29 +9892,29 @@ class BaseElement2DOutline extends BaseElement2DFill {
|
|
|
9706
9892
|
ctx.stroke({ disableWrapMode });
|
|
9707
9893
|
}
|
|
9708
9894
|
}
|
|
9709
|
-
__decorateClass$
|
|
9895
|
+
__decorateClass$i([
|
|
9710
9896
|
modernIdoc.property({ fallback: "#00000000" })
|
|
9711
9897
|
], BaseElement2DOutline.prototype, "color");
|
|
9712
|
-
__decorateClass$
|
|
9898
|
+
__decorateClass$i([
|
|
9713
9899
|
modernIdoc.property({ fallback: 0 })
|
|
9714
9900
|
], BaseElement2DOutline.prototype, "width");
|
|
9715
|
-
__decorateClass$
|
|
9901
|
+
__decorateClass$i([
|
|
9716
9902
|
modernIdoc.property({ fallback: "solid" })
|
|
9717
9903
|
], BaseElement2DOutline.prototype, "style");
|
|
9718
|
-
__decorateClass$
|
|
9904
|
+
__decorateClass$i([
|
|
9719
9905
|
modernIdoc.property({ fallback: "butt" })
|
|
9720
9906
|
], BaseElement2DOutline.prototype, "lineCap");
|
|
9721
|
-
__decorateClass$
|
|
9907
|
+
__decorateClass$i([
|
|
9722
9908
|
modernIdoc.property({ fallback: "miter" })
|
|
9723
9909
|
], BaseElement2DOutline.prototype, "lineJoin");
|
|
9724
9910
|
|
|
9725
|
-
var __defProp$
|
|
9726
|
-
var __decorateClass$
|
|
9911
|
+
var __defProp$e = Object.defineProperty;
|
|
9912
|
+
var __decorateClass$h = (decorators, target, key, kind) => {
|
|
9727
9913
|
var result = void 0 ;
|
|
9728
9914
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
9729
9915
|
if (decorator = decorators[i])
|
|
9730
9916
|
result = (decorator(target, key, result) ) || result;
|
|
9731
|
-
if (result) __defProp$
|
|
9917
|
+
if (result) __defProp$e(target, key, result);
|
|
9732
9918
|
return result;
|
|
9733
9919
|
};
|
|
9734
9920
|
class BaseElement2DShadow extends CoreObject {
|
|
@@ -9768,29 +9954,29 @@ class BaseElement2DShadow extends CoreObject {
|
|
|
9768
9954
|
}
|
|
9769
9955
|
}
|
|
9770
9956
|
}
|
|
9771
|
-
__decorateClass$
|
|
9957
|
+
__decorateClass$h([
|
|
9772
9958
|
modernIdoc.property({ fallback: true })
|
|
9773
9959
|
], BaseElement2DShadow.prototype, "enabled");
|
|
9774
|
-
__decorateClass$
|
|
9960
|
+
__decorateClass$h([
|
|
9775
9961
|
modernIdoc.property({ fallback: "#000000FF" })
|
|
9776
9962
|
], BaseElement2DShadow.prototype, "color");
|
|
9777
|
-
__decorateClass$
|
|
9963
|
+
__decorateClass$h([
|
|
9778
9964
|
modernIdoc.property({ fallback: 0 })
|
|
9779
9965
|
], BaseElement2DShadow.prototype, "blur");
|
|
9780
|
-
__decorateClass$
|
|
9966
|
+
__decorateClass$h([
|
|
9781
9967
|
modernIdoc.property({ fallback: 0 })
|
|
9782
9968
|
], BaseElement2DShadow.prototype, "offsetY");
|
|
9783
|
-
__decorateClass$
|
|
9969
|
+
__decorateClass$h([
|
|
9784
9970
|
modernIdoc.property({ fallback: 0 })
|
|
9785
9971
|
], BaseElement2DShadow.prototype, "offsetX");
|
|
9786
9972
|
|
|
9787
|
-
var __defProp$
|
|
9788
|
-
var __decorateClass$
|
|
9973
|
+
var __defProp$d = Object.defineProperty;
|
|
9974
|
+
var __decorateClass$g = (decorators, target, key, kind) => {
|
|
9789
9975
|
var result = void 0 ;
|
|
9790
9976
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
9791
9977
|
if (decorator = decorators[i])
|
|
9792
9978
|
result = (decorator(target, key, result) ) || result;
|
|
9793
|
-
if (result) __defProp$
|
|
9979
|
+
if (result) __defProp$d(target, key, result);
|
|
9794
9980
|
return result;
|
|
9795
9981
|
};
|
|
9796
9982
|
class BaseElement2DShape extends CoreObject {
|
|
@@ -9841,18 +10027,18 @@ class BaseElement2DShape extends CoreObject {
|
|
|
9841
10027
|
path.applyTransform(new modernPath2d.Matrix3().translate(-x, -y).scale(1 / w, 1 / h));
|
|
9842
10028
|
});
|
|
9843
10029
|
}
|
|
9844
|
-
draw() {
|
|
9845
|
-
if (this.enabled && this._path2DSet.paths.length) {
|
|
10030
|
+
draw(rect = false) {
|
|
10031
|
+
if (!rect && this.enabled && this._path2DSet.paths.length) {
|
|
9846
10032
|
const ctx = this.parent.context;
|
|
9847
10033
|
const { width, height } = this.parent.size;
|
|
9848
10034
|
this._path2DSet.paths.forEach((path) => {
|
|
9849
10035
|
ctx.addPath(path.clone().applyTransform(new modernPath2d.Matrix3().scale(width, height)));
|
|
9850
10036
|
});
|
|
9851
10037
|
} else {
|
|
9852
|
-
this.
|
|
10038
|
+
this._drawRect();
|
|
9853
10039
|
}
|
|
9854
10040
|
}
|
|
9855
|
-
|
|
10041
|
+
_drawRect() {
|
|
9856
10042
|
const ctx = this.parent.context;
|
|
9857
10043
|
const { width, height } = this.parent.size;
|
|
9858
10044
|
const { borderRadius } = this.parent.style;
|
|
@@ -9865,19 +10051,19 @@ class BaseElement2DShape extends CoreObject {
|
|
|
9865
10051
|
}
|
|
9866
10052
|
}
|
|
9867
10053
|
}
|
|
9868
|
-
__decorateClass$
|
|
10054
|
+
__decorateClass$g([
|
|
9869
10055
|
modernIdoc.property({ fallback: true })
|
|
9870
10056
|
], BaseElement2DShape.prototype, "enabled");
|
|
9871
|
-
__decorateClass$
|
|
10057
|
+
__decorateClass$g([
|
|
9872
10058
|
modernIdoc.property()
|
|
9873
10059
|
], BaseElement2DShape.prototype, "preset");
|
|
9874
|
-
__decorateClass$
|
|
10060
|
+
__decorateClass$g([
|
|
9875
10061
|
modernIdoc.property()
|
|
9876
10062
|
], BaseElement2DShape.prototype, "svg");
|
|
9877
|
-
__decorateClass$
|
|
10063
|
+
__decorateClass$g([
|
|
9878
10064
|
modernIdoc.property()
|
|
9879
10065
|
], BaseElement2DShape.prototype, "viewBox");
|
|
9880
|
-
__decorateClass$
|
|
10066
|
+
__decorateClass$g([
|
|
9881
10067
|
modernIdoc.property()
|
|
9882
10068
|
], BaseElement2DShape.prototype, "paths");
|
|
9883
10069
|
|
|
@@ -9893,13 +10079,13 @@ for (const key in defaultStyles$1) {
|
|
|
9893
10079
|
modernIdoc.defineProperty(BaseElement2DStyle, key, { fallback });
|
|
9894
10080
|
}
|
|
9895
10081
|
|
|
9896
|
-
var __defProp$
|
|
9897
|
-
var __decorateClass$
|
|
10082
|
+
var __defProp$c = Object.defineProperty;
|
|
10083
|
+
var __decorateClass$f = (decorators, target, key, kind) => {
|
|
9898
10084
|
var result = void 0 ;
|
|
9899
10085
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
9900
10086
|
if (decorator = decorators[i])
|
|
9901
10087
|
result = (decorator(target, key, result) ) || result;
|
|
9902
|
-
if (result) __defProp$
|
|
10088
|
+
if (result) __defProp$c(target, key, result);
|
|
9903
10089
|
return result;
|
|
9904
10090
|
};
|
|
9905
10091
|
class BaseElement2DText extends CoreObject {
|
|
@@ -9911,6 +10097,7 @@ class BaseElement2DText extends CoreObject {
|
|
|
9911
10097
|
}
|
|
9912
10098
|
base;
|
|
9913
10099
|
measureResult;
|
|
10100
|
+
_texture = new CanvasTexture();
|
|
9914
10101
|
_textureMap = /* @__PURE__ */ new Map();
|
|
9915
10102
|
setProperties(properties) {
|
|
9916
10103
|
return super.setProperties(
|
|
@@ -9921,24 +10108,28 @@ class BaseElement2DText extends CoreObject {
|
|
|
9921
10108
|
super._updateProperty(key, value, oldValue);
|
|
9922
10109
|
switch (key) {
|
|
9923
10110
|
case "enabled":
|
|
10111
|
+
this.parent.requestRedraw();
|
|
10112
|
+
break;
|
|
9924
10113
|
case "effects":
|
|
9925
10114
|
case "measureDom":
|
|
9926
10115
|
case "fonts":
|
|
10116
|
+
this.update();
|
|
9927
10117
|
this.parent.requestRedraw();
|
|
9928
10118
|
break;
|
|
9929
10119
|
case "fill":
|
|
9930
10120
|
case "outline":
|
|
9931
10121
|
case "content":
|
|
10122
|
+
this.update();
|
|
9932
10123
|
this._updateTextureMap();
|
|
10124
|
+
this.parent.requestRedraw();
|
|
9933
10125
|
break;
|
|
9934
10126
|
}
|
|
9935
10127
|
}
|
|
9936
|
-
|
|
10128
|
+
update() {
|
|
9937
10129
|
this.base.fonts = this.base.fonts ?? this.parent.tree?.fonts;
|
|
9938
10130
|
this.base.update();
|
|
9939
10131
|
}
|
|
9940
10132
|
_updateTextureMap() {
|
|
9941
|
-
this._updateBase();
|
|
9942
10133
|
this._textureMap.clear();
|
|
9943
10134
|
const pGlyphBoxs = [];
|
|
9944
10135
|
this.base.paragraphs.forEach((p, pIndex) => {
|
|
@@ -9965,7 +10156,6 @@ class BaseElement2DText extends CoreObject {
|
|
|
9965
10156
|
this._updateTexture("fill", this.fill, glyphBox);
|
|
9966
10157
|
this._updateTexture("outline", this.outline, glyphBox);
|
|
9967
10158
|
}
|
|
9968
|
-
this.parent.requestRedraw();
|
|
9969
10159
|
}
|
|
9970
10160
|
async _updateTexture(key, fill, box) {
|
|
9971
10161
|
if (fill && Object.keys(fill).length > 0) {
|
|
@@ -9994,19 +10184,19 @@ class BaseElement2DText extends CoreObject {
|
|
|
9994
10184
|
this.content = modernIdoc.normalizeTextContent(content);
|
|
9995
10185
|
}
|
|
9996
10186
|
measure() {
|
|
9997
|
-
this.
|
|
10187
|
+
this.update();
|
|
9998
10188
|
return this.base.measure();
|
|
9999
10189
|
}
|
|
10000
10190
|
updateMeasure() {
|
|
10001
10191
|
this.measureResult = this.measure();
|
|
10002
10192
|
return this;
|
|
10003
10193
|
}
|
|
10004
|
-
|
|
10194
|
+
isValid() {
|
|
10005
10195
|
return Boolean(
|
|
10006
10196
|
this.enabled && !/^\s*$/.test(this.base.toString())
|
|
10007
10197
|
);
|
|
10008
10198
|
}
|
|
10009
|
-
|
|
10199
|
+
_createVertTransform() {
|
|
10010
10200
|
const parent = this.parent;
|
|
10011
10201
|
if (parent.scale.x > 0 && parent.scale.y > 0) {
|
|
10012
10202
|
return void 0;
|
|
@@ -10015,9 +10205,12 @@ class BaseElement2DText extends CoreObject {
|
|
|
10015
10205
|
const origin = parent.getTransformOrigin();
|
|
10016
10206
|
return new Transform2D().translate(-origin.x, -origin.y).scale(scale > 0 ? 1 : -1, 1).translate(origin.x, origin.y);
|
|
10017
10207
|
}
|
|
10018
|
-
|
|
10019
|
-
|
|
10020
|
-
|
|
10208
|
+
_useDrawByTexture() {
|
|
10209
|
+
return !!this.effects?.length || this.content.some((p) => {
|
|
10210
|
+
return p.fragments.some((f) => !!f.highlightImage);
|
|
10211
|
+
});
|
|
10212
|
+
}
|
|
10213
|
+
_drawByVertices(ctx) {
|
|
10021
10214
|
this.base.pathSets.forEach((pathSet) => {
|
|
10022
10215
|
pathSet.paths.forEach((path) => {
|
|
10023
10216
|
const meta = path.getMeta();
|
|
@@ -10040,13 +10233,13 @@ class BaseElement2DText extends CoreObject {
|
|
|
10040
10233
|
ctx.style = { ...path.style };
|
|
10041
10234
|
ctx.uvTransform = uvTransform;
|
|
10042
10235
|
ctx.fillStyle = texture?.texture ?? fill.color;
|
|
10043
|
-
ctx.vertTransform = this.
|
|
10236
|
+
ctx.vertTransform = this._createVertTransform();
|
|
10044
10237
|
ctx.fill({ disableWrapMode });
|
|
10045
10238
|
}
|
|
10046
10239
|
} else {
|
|
10047
10240
|
ctx.addPath(path);
|
|
10048
10241
|
ctx.style = { ...path.style };
|
|
10049
|
-
ctx.vertTransform = this.
|
|
10242
|
+
ctx.vertTransform = this._createVertTransform();
|
|
10050
10243
|
ctx.fill();
|
|
10051
10244
|
}
|
|
10052
10245
|
}
|
|
@@ -10069,54 +10262,70 @@ class BaseElement2DText extends CoreObject {
|
|
|
10069
10262
|
ctx.strokeStyle = texture?.texture ?? outline.color;
|
|
10070
10263
|
ctx.lineCap = outline.lineCap;
|
|
10071
10264
|
ctx.lineJoin = outline.lineJoin;
|
|
10072
|
-
ctx.vertTransform = this.
|
|
10265
|
+
ctx.vertTransform = this._createVertTransform();
|
|
10073
10266
|
ctx.stroke({ disableWrapMode });
|
|
10074
10267
|
}
|
|
10075
10268
|
} else {
|
|
10076
10269
|
ctx.addPath(path);
|
|
10077
10270
|
ctx.style = { ...path.style };
|
|
10078
|
-
ctx.vertTransform = this.
|
|
10271
|
+
ctx.vertTransform = this._createVertTransform();
|
|
10079
10272
|
ctx.stroke();
|
|
10080
10273
|
}
|
|
10081
10274
|
}
|
|
10082
10275
|
} else {
|
|
10083
10276
|
ctx.addPath(path);
|
|
10084
10277
|
ctx.style = { ...path.style };
|
|
10085
|
-
ctx.vertTransform = this.
|
|
10278
|
+
ctx.vertTransform = this._createVertTransform();
|
|
10086
10279
|
ctx.fill();
|
|
10087
10280
|
}
|
|
10088
10281
|
});
|
|
10089
10282
|
});
|
|
10090
10283
|
}
|
|
10284
|
+
_drawByTexture(ctx) {
|
|
10285
|
+
this._texture.width = Math.round(this.base.boundingBox.width);
|
|
10286
|
+
this._texture.height = Math.round(this.base.boundingBox.height);
|
|
10287
|
+
this.base.render({ view: this._texture.source });
|
|
10288
|
+
ctx.fillStyle = this._texture;
|
|
10289
|
+
ctx.vertTransform = this._createVertTransform();
|
|
10290
|
+
ctx.fill();
|
|
10291
|
+
}
|
|
10292
|
+
draw() {
|
|
10293
|
+
const ctx = this.parent.context;
|
|
10294
|
+
if (this._useDrawByTexture()) {
|
|
10295
|
+
this._drawByTexture(ctx);
|
|
10296
|
+
} else {
|
|
10297
|
+
this._drawByVertices(ctx);
|
|
10298
|
+
}
|
|
10299
|
+
}
|
|
10091
10300
|
}
|
|
10092
|
-
__decorateClass$
|
|
10301
|
+
__decorateClass$f([
|
|
10093
10302
|
modernIdoc.property({ fallback: true })
|
|
10094
10303
|
], BaseElement2DText.prototype, "enabled");
|
|
10095
|
-
__decorateClass$
|
|
10304
|
+
__decorateClass$f([
|
|
10096
10305
|
modernIdoc.property({ fallback: () => [] })
|
|
10097
10306
|
], BaseElement2DText.prototype, "content");
|
|
10098
|
-
__decorateClass$
|
|
10307
|
+
__decorateClass$f([
|
|
10099
10308
|
modernIdoc.property({ alias: "parent.style.json" })
|
|
10100
10309
|
], BaseElement2DText.prototype, "style");
|
|
10101
|
-
__decorateClass$
|
|
10310
|
+
__decorateClass$f([
|
|
10102
10311
|
modernIdoc.property()
|
|
10103
10312
|
], BaseElement2DText.prototype, "effects");
|
|
10104
|
-
__decorateClass$
|
|
10313
|
+
__decorateClass$f([
|
|
10105
10314
|
modernIdoc.property()
|
|
10106
10315
|
], BaseElement2DText.prototype, "fill");
|
|
10107
|
-
__decorateClass$
|
|
10316
|
+
__decorateClass$f([
|
|
10108
10317
|
modernIdoc.property()
|
|
10109
10318
|
], BaseElement2DText.prototype, "outline");
|
|
10110
|
-
__decorateClass$
|
|
10319
|
+
__decorateClass$f([
|
|
10111
10320
|
modernIdoc.property({ alias: "base.measureDom" })
|
|
10112
10321
|
], BaseElement2DText.prototype, "measureDom");
|
|
10113
|
-
__decorateClass$
|
|
10322
|
+
__decorateClass$f([
|
|
10114
10323
|
modernIdoc.property({ alias: "base.fonts" })
|
|
10115
10324
|
], BaseElement2DText.prototype, "fonts");
|
|
10116
10325
|
|
|
10117
|
-
var __getOwnPropDesc$
|
|
10118
|
-
var __decorateClass$
|
|
10119
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
10326
|
+
var __getOwnPropDesc$c = Object.getOwnPropertyDescriptor;
|
|
10327
|
+
var __decorateClass$e = (decorators, target, key, kind) => {
|
|
10328
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$c(target, key) : target;
|
|
10120
10329
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
10121
10330
|
if (decorator = decorators[i])
|
|
10122
10331
|
result = (decorator(result)) || result;
|
|
@@ -10226,13 +10435,13 @@ exports.BaseElement2D = class BaseElement2D extends exports.Node2D {
|
|
|
10226
10435
|
break;
|
|
10227
10436
|
case "scaleX":
|
|
10228
10437
|
this.scale.x = this.style.scaleX;
|
|
10229
|
-
if (this.text.
|
|
10438
|
+
if (this.text.isValid() && (value ^ oldValue) < 0) {
|
|
10230
10439
|
this.requestRedraw();
|
|
10231
10440
|
}
|
|
10232
10441
|
break;
|
|
10233
10442
|
case "scaleY":
|
|
10234
10443
|
this.scale.y = this.style.scaleY;
|
|
10235
|
-
if (this.text.
|
|
10444
|
+
if (this.text.isValid() && (value ^ oldValue) < 0) {
|
|
10236
10445
|
this.requestRedraw();
|
|
10237
10446
|
}
|
|
10238
10447
|
break;
|
|
@@ -10323,6 +10532,14 @@ exports.BaseElement2D = class BaseElement2D extends exports.Node2D {
|
|
|
10323
10532
|
super.updateGlobalTransform();
|
|
10324
10533
|
this._updateOverflow();
|
|
10325
10534
|
}
|
|
10535
|
+
_relayout(batchables) {
|
|
10536
|
+
return super._relayout(batchables).map((batchable) => {
|
|
10537
|
+
return {
|
|
10538
|
+
...batchable,
|
|
10539
|
+
dimension: this.size.toFloat32Array()
|
|
10540
|
+
};
|
|
10541
|
+
});
|
|
10542
|
+
}
|
|
10326
10543
|
getRect() {
|
|
10327
10544
|
return this.getGlobalAabb();
|
|
10328
10545
|
}
|
|
@@ -10427,39 +10644,29 @@ exports.BaseElement2D = class BaseElement2D extends exports.Node2D {
|
|
|
10427
10644
|
}
|
|
10428
10645
|
_draw() {
|
|
10429
10646
|
super._draw();
|
|
10430
|
-
if (this.
|
|
10431
|
-
this._text.updateMeasure();
|
|
10432
|
-
}
|
|
10433
|
-
if (this._background.canDraw()) {
|
|
10647
|
+
if (this._background.isValid()) {
|
|
10434
10648
|
this._tree?.log(this.name, "background drawing");
|
|
10435
|
-
|
|
10436
|
-
this._shape.draw();
|
|
10437
|
-
} else {
|
|
10438
|
-
this._shape.drawRect();
|
|
10439
|
-
}
|
|
10649
|
+
this._shape.draw(!this._background.fillWithShape);
|
|
10440
10650
|
this._background.draw();
|
|
10441
10651
|
}
|
|
10442
|
-
if (this._fill.
|
|
10652
|
+
if (this._fill.isValid()) {
|
|
10443
10653
|
this._tree?.log(this.name, "fill drawing");
|
|
10444
10654
|
this._shape.draw();
|
|
10445
10655
|
this._fill.draw();
|
|
10446
10656
|
}
|
|
10447
|
-
if (this._outline.
|
|
10657
|
+
if (this._outline.isValid()) {
|
|
10448
10658
|
this._tree?.log(this.name, "outline drawing");
|
|
10449
10659
|
this._shape.draw();
|
|
10450
10660
|
this._outline.draw();
|
|
10451
10661
|
}
|
|
10452
|
-
if (this._foreground.
|
|
10662
|
+
if (this._foreground.isValid()) {
|
|
10453
10663
|
this._tree?.log(this.name, "foreground drawing");
|
|
10454
|
-
|
|
10455
|
-
this._shape.draw();
|
|
10456
|
-
} else {
|
|
10457
|
-
this._shape.drawRect();
|
|
10458
|
-
}
|
|
10664
|
+
this._shape.draw(!this._foreground.fillWithShape);
|
|
10459
10665
|
this._foreground.draw();
|
|
10460
10666
|
}
|
|
10461
|
-
if (this._text.
|
|
10667
|
+
if (this._text.isValid()) {
|
|
10462
10668
|
this._tree?.log(this.name, "text drawing");
|
|
10669
|
+
this._shape.draw(true);
|
|
10463
10670
|
this._text.draw();
|
|
10464
10671
|
}
|
|
10465
10672
|
this._drawContent();
|
|
@@ -10535,7 +10742,7 @@ exports.BaseElement2D = class BaseElement2D extends exports.Node2D {
|
|
|
10535
10742
|
});
|
|
10536
10743
|
}
|
|
10537
10744
|
};
|
|
10538
|
-
exports.BaseElement2D = __decorateClass$
|
|
10745
|
+
exports.BaseElement2D = __decorateClass$e([
|
|
10539
10746
|
customNode("BaseElement2D")
|
|
10540
10747
|
], exports.BaseElement2D);
|
|
10541
10748
|
|
|
@@ -10562,9 +10769,9 @@ class FlexElement2DStyle extends BaseElement2DStyle {
|
|
|
10562
10769
|
}
|
|
10563
10770
|
}
|
|
10564
10771
|
|
|
10565
|
-
var __getOwnPropDesc$
|
|
10566
|
-
var __decorateClass$
|
|
10567
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
10772
|
+
var __getOwnPropDesc$b = Object.getOwnPropertyDescriptor;
|
|
10773
|
+
var __decorateClass$d = (decorators, target, key, kind) => {
|
|
10774
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$b(target, key) : target;
|
|
10568
10775
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
10569
10776
|
if (decorator = decorators[i])
|
|
10570
10777
|
result = (decorator(result)) || result;
|
|
@@ -10615,7 +10822,7 @@ exports.Element2D = class Element2D extends exports.BaseElement2D {
|
|
|
10615
10822
|
}
|
|
10616
10823
|
}
|
|
10617
10824
|
};
|
|
10618
|
-
exports.Element2D = __decorateClass$
|
|
10825
|
+
exports.Element2D = __decorateClass$d([
|
|
10619
10826
|
customNode("Element2D")
|
|
10620
10827
|
], exports.Element2D);
|
|
10621
10828
|
|
|
@@ -10925,9 +11132,9 @@ class FlexLayout {
|
|
|
10925
11132
|
}
|
|
10926
11133
|
}
|
|
10927
11134
|
|
|
10928
|
-
var __getOwnPropDesc$
|
|
10929
|
-
var __decorateClass$
|
|
10930
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
11135
|
+
var __getOwnPropDesc$a = Object.getOwnPropertyDescriptor;
|
|
11136
|
+
var __decorateClass$c = (decorators, target, key, kind) => {
|
|
11137
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$a(target, key) : target;
|
|
10931
11138
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
10932
11139
|
if (decorator = decorators[i])
|
|
10933
11140
|
result = (decorator(result)) || result;
|
|
@@ -11004,18 +11211,18 @@ exports.FlexElement2D = class FlexElement2D extends exports.BaseElement2D {
|
|
|
11004
11211
|
}
|
|
11005
11212
|
}
|
|
11006
11213
|
};
|
|
11007
|
-
exports.FlexElement2D = __decorateClass$
|
|
11214
|
+
exports.FlexElement2D = __decorateClass$c([
|
|
11008
11215
|
customNode("FlexElement2D")
|
|
11009
11216
|
], exports.FlexElement2D);
|
|
11010
11217
|
|
|
11011
|
-
var __defProp$
|
|
11012
|
-
var __getOwnPropDesc$
|
|
11013
|
-
var __decorateClass$
|
|
11014
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
11218
|
+
var __defProp$b = Object.defineProperty;
|
|
11219
|
+
var __getOwnPropDesc$9 = Object.getOwnPropertyDescriptor;
|
|
11220
|
+
var __decorateClass$b = (decorators, target, key, kind) => {
|
|
11221
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$9(target, key) : target;
|
|
11015
11222
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
11016
11223
|
if (decorator = decorators[i])
|
|
11017
11224
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
11018
|
-
if (kind && result) __defProp$
|
|
11225
|
+
if (kind && result) __defProp$b(target, key, result);
|
|
11019
11226
|
return result;
|
|
11020
11227
|
};
|
|
11021
11228
|
exports.Image2D = class Image2D extends exports.Element2D {
|
|
@@ -11127,7 +11334,7 @@ exports.Image2D = class Image2D extends exports.Element2D {
|
|
|
11127
11334
|
}
|
|
11128
11335
|
_drawContent() {
|
|
11129
11336
|
const texture = this.currentFrameTexture;
|
|
11130
|
-
if (texture?.
|
|
11337
|
+
if (texture?.isValid()) {
|
|
11131
11338
|
const { left = 0, top = 0, right = 0, bottom = 0 } = this.srcRect ?? {};
|
|
11132
11339
|
const { width, height } = this.size;
|
|
11133
11340
|
this.context.fillStyle = texture;
|
|
@@ -11151,19 +11358,19 @@ exports.Image2D = class Image2D extends exports.Element2D {
|
|
|
11151
11358
|
});
|
|
11152
11359
|
}
|
|
11153
11360
|
};
|
|
11154
|
-
__decorateClass$
|
|
11361
|
+
__decorateClass$b([
|
|
11155
11362
|
modernIdoc.property({ internal: true })
|
|
11156
11363
|
], exports.Image2D.prototype, "texture", 2);
|
|
11157
|
-
__decorateClass$
|
|
11364
|
+
__decorateClass$b([
|
|
11158
11365
|
modernIdoc.property({ fallback: "" })
|
|
11159
11366
|
], exports.Image2D.prototype, "src", 2);
|
|
11160
|
-
__decorateClass$
|
|
11367
|
+
__decorateClass$b([
|
|
11161
11368
|
modernIdoc.property()
|
|
11162
11369
|
], exports.Image2D.prototype, "srcRect", 2);
|
|
11163
|
-
__decorateClass$
|
|
11370
|
+
__decorateClass$b([
|
|
11164
11371
|
modernIdoc.property({ fallback: false })
|
|
11165
11372
|
], exports.Image2D.prototype, "gif", 2);
|
|
11166
|
-
exports.Image2D = __decorateClass$
|
|
11373
|
+
exports.Image2D = __decorateClass$b([
|
|
11167
11374
|
customNode("Image2D")
|
|
11168
11375
|
], exports.Image2D);
|
|
11169
11376
|
|
|
@@ -11174,27 +11381,22 @@ class TextureRect2D extends exports.Element2D {
|
|
|
11174
11381
|
this.setProperties(properties).append(children);
|
|
11175
11382
|
}
|
|
11176
11383
|
_drawContent() {
|
|
11177
|
-
if (this.texture?.
|
|
11178
|
-
|
|
11384
|
+
if (this.texture?.isValid()) {
|
|
11385
|
+
this.shape.draw(true);
|
|
11179
11386
|
this.context.fillStyle = this.texture;
|
|
11180
|
-
this.context.uvTransform = new Transform2D().scale(
|
|
11181
|
-
1 / width,
|
|
11182
|
-
1 / height
|
|
11183
|
-
);
|
|
11184
|
-
this.shape.drawRect();
|
|
11185
11387
|
this.context.fill();
|
|
11186
11388
|
}
|
|
11187
11389
|
}
|
|
11188
11390
|
}
|
|
11189
11391
|
|
|
11190
|
-
var __defProp$
|
|
11191
|
-
var __getOwnPropDesc$
|
|
11192
|
-
var __decorateClass$
|
|
11193
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
11392
|
+
var __defProp$a = Object.defineProperty;
|
|
11393
|
+
var __getOwnPropDesc$8 = Object.getOwnPropertyDescriptor;
|
|
11394
|
+
var __decorateClass$a = (decorators, target, key, kind) => {
|
|
11395
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$8(target, key) : target;
|
|
11194
11396
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
11195
11397
|
if (decorator = decorators[i])
|
|
11196
11398
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
11197
|
-
if (kind && result) __defProp$
|
|
11399
|
+
if (kind && result) __defProp$a(target, key, result);
|
|
11198
11400
|
return result;
|
|
11199
11401
|
};
|
|
11200
11402
|
exports.Lottie2D = class Lottie2D extends TextureRect2D {
|
|
@@ -11237,20 +11439,20 @@ exports.Lottie2D = class Lottie2D extends TextureRect2D {
|
|
|
11237
11439
|
super._process(delta);
|
|
11238
11440
|
}
|
|
11239
11441
|
};
|
|
11240
|
-
__decorateClass$
|
|
11442
|
+
__decorateClass$a([
|
|
11241
11443
|
modernIdoc.property({ fallback: "" })
|
|
11242
11444
|
], exports.Lottie2D.prototype, "src", 2);
|
|
11243
|
-
exports.Lottie2D = __decorateClass$
|
|
11445
|
+
exports.Lottie2D = __decorateClass$a([
|
|
11244
11446
|
customNode("Lottie2D")
|
|
11245
11447
|
], exports.Lottie2D);
|
|
11246
11448
|
|
|
11247
|
-
var __defProp$
|
|
11248
|
-
var __decorateClass$
|
|
11449
|
+
var __defProp$9 = Object.defineProperty;
|
|
11450
|
+
var __decorateClass$9 = (decorators, target, key, kind) => {
|
|
11249
11451
|
var result = void 0 ;
|
|
11250
11452
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
11251
11453
|
if (decorator = decorators[i])
|
|
11252
11454
|
result = (decorator(target, key, result) ) || result;
|
|
11253
|
-
if (result) __defProp$
|
|
11455
|
+
if (result) __defProp$9(target, key, result);
|
|
11254
11456
|
return result;
|
|
11255
11457
|
};
|
|
11256
11458
|
class TransformRect2D extends exports.Element2D {
|
|
@@ -11296,18 +11498,18 @@ class TransformRect2D extends exports.Element2D {
|
|
|
11296
11498
|
this._drawEllipse(width, height / 2);
|
|
11297
11499
|
}
|
|
11298
11500
|
}
|
|
11299
|
-
__decorateClass$
|
|
11501
|
+
__decorateClass$9([
|
|
11300
11502
|
modernIdoc.property({ fallback: 6 })
|
|
11301
11503
|
], TransformRect2D.prototype, "handleSize");
|
|
11302
11504
|
|
|
11303
|
-
var __defProp$
|
|
11304
|
-
var __getOwnPropDesc$
|
|
11305
|
-
var __decorateClass$
|
|
11306
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
11505
|
+
var __defProp$8 = Object.defineProperty;
|
|
11506
|
+
var __getOwnPropDesc$7 = Object.getOwnPropertyDescriptor;
|
|
11507
|
+
var __decorateClass$8 = (decorators, target, key, kind) => {
|
|
11508
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$7(target, key) : target;
|
|
11307
11509
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
11308
11510
|
if (decorator = decorators[i])
|
|
11309
11511
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
11310
|
-
if (kind && result) __defProp$
|
|
11512
|
+
if (kind && result) __defProp$8(target, key, result);
|
|
11311
11513
|
return result;
|
|
11312
11514
|
};
|
|
11313
11515
|
exports.Video2D = class Video2D extends TextureRect2D {
|
|
@@ -11360,21 +11562,21 @@ exports.Video2D = class Video2D extends TextureRect2D {
|
|
|
11360
11562
|
super._process(delta);
|
|
11361
11563
|
}
|
|
11362
11564
|
};
|
|
11363
|
-
__decorateClass$
|
|
11565
|
+
__decorateClass$8([
|
|
11364
11566
|
modernIdoc.property({ fallback: "" })
|
|
11365
11567
|
], exports.Video2D.prototype, "src", 2);
|
|
11366
|
-
exports.Video2D = __decorateClass$
|
|
11568
|
+
exports.Video2D = __decorateClass$8([
|
|
11367
11569
|
customNode("Video2D")
|
|
11368
11570
|
], exports.Video2D);
|
|
11369
11571
|
|
|
11370
|
-
var __defProp$
|
|
11371
|
-
var __getOwnPropDesc$
|
|
11372
|
-
var __decorateClass$
|
|
11373
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
11572
|
+
var __defProp$7 = Object.defineProperty;
|
|
11573
|
+
var __getOwnPropDesc$6 = Object.getOwnPropertyDescriptor;
|
|
11574
|
+
var __decorateClass$7 = (decorators, target, key, kind) => {
|
|
11575
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$6(target, key) : target;
|
|
11374
11576
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
11375
11577
|
if (decorator = decorators[i])
|
|
11376
11578
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
11377
|
-
if (kind && result) __defProp$
|
|
11579
|
+
if (kind && result) __defProp$7(target, key, result);
|
|
11378
11580
|
return result;
|
|
11379
11581
|
};
|
|
11380
11582
|
const linear = (amount) => amount;
|
|
@@ -11693,19 +11895,16 @@ exports.Animation = class Animation extends exports.TimelineNode {
|
|
|
11693
11895
|
});
|
|
11694
11896
|
}
|
|
11695
11897
|
};
|
|
11696
|
-
__decorateClass$
|
|
11898
|
+
__decorateClass$7([
|
|
11697
11899
|
modernIdoc.property({ fallback: "parent" })
|
|
11698
11900
|
], exports.Animation.prototype, "effectMode", 2);
|
|
11699
|
-
__decorateClass$
|
|
11700
|
-
modernIdoc.property({ fallback: false })
|
|
11701
|
-
], exports.Animation.prototype, "loop", 2);
|
|
11702
|
-
__decorateClass$f([
|
|
11901
|
+
__decorateClass$7([
|
|
11703
11902
|
modernIdoc.property({ default: () => [] })
|
|
11704
11903
|
], exports.Animation.prototype, "keyframes", 2);
|
|
11705
|
-
__decorateClass$
|
|
11904
|
+
__decorateClass$7([
|
|
11706
11905
|
modernIdoc.property()
|
|
11707
11906
|
], exports.Animation.prototype, "easing", 2);
|
|
11708
|
-
exports.Animation = __decorateClass$
|
|
11907
|
+
exports.Animation = __decorateClass$7([
|
|
11709
11908
|
customNode("Animation", {
|
|
11710
11909
|
renderMode: "disabled",
|
|
11711
11910
|
processMode: "pausable",
|
|
@@ -12586,11 +12785,11 @@ class WebAudio extends AudioPipeline {
|
|
|
12586
12785
|
}
|
|
12587
12786
|
}
|
|
12588
12787
|
|
|
12589
|
-
var __defProp$
|
|
12590
|
-
var __getOwnPropDesc$
|
|
12591
|
-
var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$
|
|
12592
|
-
var __decorateClass$
|
|
12593
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
12788
|
+
var __defProp$6 = Object.defineProperty;
|
|
12789
|
+
var __getOwnPropDesc$5 = Object.getOwnPropertyDescriptor;
|
|
12790
|
+
var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
12791
|
+
var __decorateClass$6 = (decorators, target, key, kind) => {
|
|
12792
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$5(target, key) : target;
|
|
12594
12793
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
12595
12794
|
if (decorator = decorators[i])
|
|
12596
12795
|
result = (decorator(result)) || result;
|
|
@@ -12801,7 +13000,7 @@ exports.Audio = class Audio extends exports.TimelineNode {
|
|
|
12801
13000
|
}
|
|
12802
13001
|
};
|
|
12803
13002
|
__publicField$4(exports.Audio, "_soundPool", []);
|
|
12804
|
-
exports.Audio = __decorateClass$
|
|
13003
|
+
exports.Audio = __decorateClass$6([
|
|
12805
13004
|
customNode("Audio")
|
|
12806
13005
|
], exports.Audio);
|
|
12807
13006
|
|
|
@@ -12809,14 +13008,14 @@ class AudioSpectrum extends exports.Node2D {
|
|
|
12809
13008
|
//
|
|
12810
13009
|
}
|
|
12811
13010
|
|
|
12812
|
-
var __defProp$
|
|
12813
|
-
var __getOwnPropDesc$
|
|
12814
|
-
var __decorateClass$
|
|
12815
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
13011
|
+
var __defProp$5 = Object.defineProperty;
|
|
13012
|
+
var __getOwnPropDesc$4 = Object.getOwnPropertyDescriptor;
|
|
13013
|
+
var __decorateClass$5 = (decorators, target, key, kind) => {
|
|
13014
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$4(target, key) : target;
|
|
12816
13015
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
12817
13016
|
if (decorator = decorators[i])
|
|
12818
13017
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
12819
|
-
if (kind && result) __defProp$
|
|
13018
|
+
if (kind && result) __defProp$5(target, key, result);
|
|
12820
13019
|
return result;
|
|
12821
13020
|
};
|
|
12822
13021
|
exports.AudioWaveform = class AudioWaveform extends exports.Element2D {
|
|
@@ -12898,7 +13097,7 @@ exports.AudioWaveform = class AudioWaveform extends exports.Element2D {
|
|
|
12898
13097
|
}
|
|
12899
13098
|
_drawSrc() {
|
|
12900
13099
|
const src = this._src;
|
|
12901
|
-
if (src?.
|
|
13100
|
+
if (src?.isValid()) {
|
|
12902
13101
|
this.context.fillStyle = src;
|
|
12903
13102
|
this.context.uvTransform = new Transform2D().scale(
|
|
12904
13103
|
1 / this.style.width,
|
|
@@ -12907,521 +13106,24 @@ exports.AudioWaveform = class AudioWaveform extends exports.Element2D {
|
|
|
12907
13106
|
}
|
|
12908
13107
|
}
|
|
12909
13108
|
};
|
|
12910
|
-
__decorateClass$
|
|
13109
|
+
__decorateClass$5([
|
|
12911
13110
|
modernIdoc.property()
|
|
12912
13111
|
], exports.AudioWaveform.prototype, "src", 2);
|
|
12913
|
-
__decorateClass$
|
|
13112
|
+
__decorateClass$5([
|
|
12914
13113
|
modernIdoc.property({ fallback: 0 })
|
|
12915
13114
|
], exports.AudioWaveform.prototype, "gap", 2);
|
|
12916
|
-
__decorateClass$
|
|
13115
|
+
__decorateClass$5([
|
|
12917
13116
|
modernIdoc.property({ fallback: "#000000" })
|
|
12918
13117
|
], exports.AudioWaveform.prototype, "color", 2);
|
|
12919
|
-
exports.AudioWaveform = __decorateClass$
|
|
13118
|
+
exports.AudioWaveform = __decorateClass$5([
|
|
12920
13119
|
customNode("AudioWaveform")
|
|
12921
13120
|
], exports.AudioWaveform);
|
|
12922
13121
|
|
|
12923
|
-
var __getOwnPropDesc$b = Object.getOwnPropertyDescriptor;
|
|
12924
|
-
var __decorateClass$c = (decorators, target, key, kind) => {
|
|
12925
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$b(target, key) : target;
|
|
12926
|
-
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
12927
|
-
if (decorator = decorators[i])
|
|
12928
|
-
result = (decorator(result)) || result;
|
|
12929
|
-
return result;
|
|
12930
|
-
};
|
|
12931
|
-
exports.Control = class Control extends exports.Element2D {
|
|
12932
|
-
constructor(properties, children = []) {
|
|
12933
|
-
super();
|
|
12934
|
-
this._parentUpdateRect = this._parentUpdateRect.bind(this);
|
|
12935
|
-
this.setProperties(properties);
|
|
12936
|
-
this.append(children);
|
|
12937
|
-
}
|
|
12938
|
-
_parented(parent) {
|
|
12939
|
-
super._parented(parent);
|
|
12940
|
-
parent.on("updateRect", this._parentUpdateRect);
|
|
12941
|
-
}
|
|
12942
|
-
_unparented(oldParent) {
|
|
12943
|
-
super._unparented(oldParent);
|
|
12944
|
-
oldParent.off("updateRect", this._parentUpdateRect);
|
|
12945
|
-
}
|
|
12946
|
-
_parentUpdateRect() {
|
|
12947
|
-
const rect = this._parent.getRect();
|
|
12948
|
-
this.style.left = rect.left;
|
|
12949
|
-
this.style.top = rect.top;
|
|
12950
|
-
this.style.width = rect.width;
|
|
12951
|
-
this.style.height = rect.height;
|
|
12952
|
-
}
|
|
12953
|
-
_input(event, key) {
|
|
12954
|
-
super._input(event, key);
|
|
12955
|
-
this._guiInput(event, key);
|
|
12956
|
-
}
|
|
12957
|
-
_updateStyleProperty(key, value, oldValue) {
|
|
12958
|
-
super._updateStyleProperty(key, value, oldValue);
|
|
12959
|
-
switch (key) {
|
|
12960
|
-
case "width":
|
|
12961
|
-
case "height":
|
|
12962
|
-
case "left":
|
|
12963
|
-
case "top":
|
|
12964
|
-
this.emit("updateRect");
|
|
12965
|
-
break;
|
|
12966
|
-
}
|
|
12967
|
-
}
|
|
12968
|
-
// eslint-disable-next-line unused-imports/no-unused-vars
|
|
12969
|
-
_guiInput(event, key) {
|
|
12970
|
-
}
|
|
12971
|
-
};
|
|
12972
|
-
exports.Control = __decorateClass$c([
|
|
12973
|
-
customNode("Control")
|
|
12974
|
-
], exports.Control);
|
|
12975
|
-
|
|
12976
|
-
var __defProp$8 = Object.defineProperty;
|
|
12977
|
-
var __getOwnPropDesc$a = Object.getOwnPropertyDescriptor;
|
|
12978
|
-
var __decorateClass$b = (decorators, target, key, kind) => {
|
|
12979
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$a(target, key) : target;
|
|
12980
|
-
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
12981
|
-
if (decorator = decorators[i])
|
|
12982
|
-
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
12983
|
-
if (kind && result) __defProp$8(target, key, result);
|
|
12984
|
-
return result;
|
|
12985
|
-
};
|
|
12986
|
-
exports.Range = class Range extends exports.Control {
|
|
12987
|
-
constructor(properties, children = []) {
|
|
12988
|
-
super();
|
|
12989
|
-
this.setProperties(properties).append(children);
|
|
12990
|
-
}
|
|
12991
|
-
_updateProperty(key, value, oldValue) {
|
|
12992
|
-
super._updateProperty(key, value, oldValue);
|
|
12993
|
-
switch (key) {
|
|
12994
|
-
case "allowGreater":
|
|
12995
|
-
case "allowLesser":
|
|
12996
|
-
case "page":
|
|
12997
|
-
case "minValue":
|
|
12998
|
-
case "maxValue":
|
|
12999
|
-
case "step":
|
|
13000
|
-
case "value":
|
|
13001
|
-
this.requestRedraw();
|
|
13002
|
-
break;
|
|
13003
|
-
}
|
|
13004
|
-
}
|
|
13005
|
-
};
|
|
13006
|
-
__decorateClass$b([
|
|
13007
|
-
modernIdoc.property({ fallback: false })
|
|
13008
|
-
], exports.Range.prototype, "allowGreater", 2);
|
|
13009
|
-
__decorateClass$b([
|
|
13010
|
-
modernIdoc.property({ fallback: false })
|
|
13011
|
-
], exports.Range.prototype, "allowLesser", 2);
|
|
13012
|
-
__decorateClass$b([
|
|
13013
|
-
modernIdoc.property({ fallback: 1 })
|
|
13014
|
-
], exports.Range.prototype, "page", 2);
|
|
13015
|
-
__decorateClass$b([
|
|
13016
|
-
modernIdoc.property({ fallback: 0 })
|
|
13017
|
-
], exports.Range.prototype, "minValue", 2);
|
|
13018
|
-
__decorateClass$b([
|
|
13019
|
-
modernIdoc.property({ fallback: 100 })
|
|
13020
|
-
], exports.Range.prototype, "maxValue", 2);
|
|
13021
|
-
__decorateClass$b([
|
|
13022
|
-
modernIdoc.property({ fallback: 0.01 })
|
|
13023
|
-
], exports.Range.prototype, "step", 2);
|
|
13024
|
-
__decorateClass$b([
|
|
13025
|
-
modernIdoc.property({ fallback: 0 })
|
|
13026
|
-
], exports.Range.prototype, "value", 2);
|
|
13027
|
-
exports.Range = __decorateClass$b([
|
|
13028
|
-
customNode("Range")
|
|
13029
|
-
], exports.Range);
|
|
13030
|
-
|
|
13031
|
-
var __defProp$7 = Object.defineProperty;
|
|
13032
|
-
var __getOwnPropDesc$9 = Object.getOwnPropertyDescriptor;
|
|
13033
|
-
var __decorateClass$a = (decorators, target, key, kind) => {
|
|
13034
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$9(target, key) : target;
|
|
13035
|
-
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
13036
|
-
if (decorator = decorators[i])
|
|
13037
|
-
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
13038
|
-
if (kind && result) __defProp$7(target, key, result);
|
|
13039
|
-
return result;
|
|
13040
|
-
};
|
|
13041
|
-
exports.Ruler = class Ruler extends exports.Control {
|
|
13042
|
-
texture = new CanvasTexture();
|
|
13043
|
-
constructor(properties, children = []) {
|
|
13044
|
-
super();
|
|
13045
|
-
this.setProperties(properties);
|
|
13046
|
-
this.append(children);
|
|
13047
|
-
}
|
|
13048
|
-
_updateProperty(key, value, oldValue) {
|
|
13049
|
-
super._updateProperty(key, value, oldValue);
|
|
13050
|
-
switch (key) {
|
|
13051
|
-
case "offsetX":
|
|
13052
|
-
case "offsetY":
|
|
13053
|
-
case "thickness":
|
|
13054
|
-
case "markHeight":
|
|
13055
|
-
case "color":
|
|
13056
|
-
case "markBackgroundColor":
|
|
13057
|
-
case "markColor":
|
|
13058
|
-
case "gap":
|
|
13059
|
-
case "scale":
|
|
13060
|
-
this.requestRedraw();
|
|
13061
|
-
break;
|
|
13062
|
-
}
|
|
13063
|
-
}
|
|
13064
|
-
_updateStyleProperty(key, value, oldValue) {
|
|
13065
|
-
super._updateStyleProperty(key, value, oldValue);
|
|
13066
|
-
switch (key) {
|
|
13067
|
-
case "width":
|
|
13068
|
-
case "height":
|
|
13069
|
-
this.texture[key] = value;
|
|
13070
|
-
this.requestRedraw();
|
|
13071
|
-
break;
|
|
13072
|
-
}
|
|
13073
|
-
}
|
|
13074
|
-
_drawTexture() {
|
|
13075
|
-
const { width, height } = this.size;
|
|
13076
|
-
const {
|
|
13077
|
-
offsetX,
|
|
13078
|
-
offsetY,
|
|
13079
|
-
thickness,
|
|
13080
|
-
markHeight,
|
|
13081
|
-
markBackgroundColor,
|
|
13082
|
-
markColor,
|
|
13083
|
-
color,
|
|
13084
|
-
gap: _gap,
|
|
13085
|
-
gapScale: _scale
|
|
13086
|
-
} = this;
|
|
13087
|
-
const canvas = this.texture.source;
|
|
13088
|
-
const ctx = canvas.getContext("2d");
|
|
13089
|
-
ctx.reset();
|
|
13090
|
-
ctx.scale(this.texture.pixelRatio, this.texture.pixelRatio);
|
|
13091
|
-
const x = Math.round(offsetX);
|
|
13092
|
-
const y = Math.round(offsetY);
|
|
13093
|
-
ctx.beginPath();
|
|
13094
|
-
ctx.fillStyle = markBackgroundColor || "#EEE";
|
|
13095
|
-
ctx.fillRect(0, 0, width, thickness);
|
|
13096
|
-
ctx.fillRect(0, 0, thickness, height);
|
|
13097
|
-
ctx.fill();
|
|
13098
|
-
ctx.strokeStyle = markColor || "#000";
|
|
13099
|
-
ctx.moveTo(thickness, 0);
|
|
13100
|
-
ctx.lineTo(thickness, height);
|
|
13101
|
-
ctx.moveTo(0, thickness);
|
|
13102
|
-
ctx.lineTo(width, thickness);
|
|
13103
|
-
ctx.stroke();
|
|
13104
|
-
const originGap = _gap;
|
|
13105
|
-
const curGap = _gap * _scale;
|
|
13106
|
-
let scale;
|
|
13107
|
-
let gap;
|
|
13108
|
-
let markSize;
|
|
13109
|
-
let axis;
|
|
13110
|
-
let i;
|
|
13111
|
-
if (originGap >= curGap) {
|
|
13112
|
-
scale = originGap / curGap;
|
|
13113
|
-
gap = Math.floor(scale) * originGap / 20;
|
|
13114
|
-
markSize = originGap / 20 * Math.floor(scale) / scale;
|
|
13115
|
-
} else {
|
|
13116
|
-
scale = curGap / originGap;
|
|
13117
|
-
gap = Math.floor(originGap / 20 / scale);
|
|
13118
|
-
if (gap >= 2) {
|
|
13119
|
-
gap = Math.floor(gap / 2) * 2;
|
|
13120
|
-
} else {
|
|
13121
|
-
gap = 1;
|
|
13122
|
-
}
|
|
13123
|
-
markSize = gap * scale;
|
|
13124
|
-
}
|
|
13125
|
-
ctx.fillStyle = ctx.strokeStyle;
|
|
13126
|
-
for (axis = x, i = 0; axis < width; i++, axis += markSize) {
|
|
13127
|
-
ctx.moveTo(axis, thickness - (i % 5 ? markHeight : 2 * markHeight));
|
|
13128
|
-
ctx.lineTo(axis, thickness);
|
|
13129
|
-
}
|
|
13130
|
-
for (axis = x, i = 0; axis > thickness; i++, axis -= markSize) {
|
|
13131
|
-
ctx.moveTo(axis, thickness - (i % 5 ? markHeight : 2 * markHeight));
|
|
13132
|
-
ctx.lineTo(axis, thickness);
|
|
13133
|
-
}
|
|
13134
|
-
let textOffset = 0;
|
|
13135
|
-
for (axis = y, i = 0; axis > thickness; i++, axis -= markSize) {
|
|
13136
|
-
ctx.moveTo(thickness - (i % 5 ? markHeight : 2 * markHeight), axis);
|
|
13137
|
-
ctx.lineTo(thickness, axis);
|
|
13138
|
-
}
|
|
13139
|
-
for (axis = y, i = 0; axis < height; i++, axis += markSize) {
|
|
13140
|
-
ctx.moveTo(thickness - (i % 5 ? markHeight : 2 * markHeight), axis);
|
|
13141
|
-
ctx.lineTo(thickness, axis);
|
|
13142
|
-
}
|
|
13143
|
-
ctx.save();
|
|
13144
|
-
ctx.fillStyle = color;
|
|
13145
|
-
ctx.scale(0.8, 0.8);
|
|
13146
|
-
textOffset = thickness - 8;
|
|
13147
|
-
for (axis = x, i = 0; axis < width; i++, axis += markSize) {
|
|
13148
|
-
if (i % 10 === 0) {
|
|
13149
|
-
ctx.fillText(String(Math.ceil(gap * i)), axis * 1.25 - 3, textOffset * 1.25);
|
|
13150
|
-
}
|
|
13151
|
-
}
|
|
13152
|
-
for (axis = x, i = 0; axis > thickness; i++, axis -= markSize) {
|
|
13153
|
-
if (i % 10 === 0) {
|
|
13154
|
-
ctx.fillText(String(Math.ceil(-gap * i)), axis * 1.25 - 3, textOffset * 1.25);
|
|
13155
|
-
}
|
|
13156
|
-
}
|
|
13157
|
-
textOffset = 0;
|
|
13158
|
-
for (axis = y, i = 0; axis > thickness; i++, axis -= markSize) {
|
|
13159
|
-
if (i % 10 === 0) {
|
|
13160
|
-
ctx.fillText(String(Math.ceil(gap * i)), textOffset * 1.25, axis * 1.25 + 3);
|
|
13161
|
-
}
|
|
13162
|
-
}
|
|
13163
|
-
for (axis = y, i = 0; axis < height; i++, axis += markSize) {
|
|
13164
|
-
if (i % 10 === 0) {
|
|
13165
|
-
ctx.fillText(String(Math.ceil(-gap * i)), textOffset * 1.25, axis * 1.25 + 3);
|
|
13166
|
-
}
|
|
13167
|
-
}
|
|
13168
|
-
ctx.restore();
|
|
13169
|
-
ctx.stroke();
|
|
13170
|
-
this.texture.requestUpload();
|
|
13171
|
-
}
|
|
13172
|
-
_draw() {
|
|
13173
|
-
this._drawTexture();
|
|
13174
|
-
const texture = this.texture;
|
|
13175
|
-
if (texture?.valid) {
|
|
13176
|
-
this.context.fillStyle = texture;
|
|
13177
|
-
this.context.uvTransform = new Transform2D().scale(
|
|
13178
|
-
1 / this.size.width,
|
|
13179
|
-
1 / this.size.height
|
|
13180
|
-
);
|
|
13181
|
-
this.context.rect(0, 0, texture.width, texture.height);
|
|
13182
|
-
this.context.fill();
|
|
13183
|
-
}
|
|
13184
|
-
}
|
|
13185
|
-
};
|
|
13186
|
-
__decorateClass$a([
|
|
13187
|
-
modernIdoc.property({ fallback: 0 })
|
|
13188
|
-
], exports.Ruler.prototype, "offsetX", 2);
|
|
13189
|
-
__decorateClass$a([
|
|
13190
|
-
modernIdoc.property({ fallback: 0 })
|
|
13191
|
-
], exports.Ruler.prototype, "offsetY", 2);
|
|
13192
|
-
__decorateClass$a([
|
|
13193
|
-
modernIdoc.property({ fallback: 20 })
|
|
13194
|
-
], exports.Ruler.prototype, "thickness", 2);
|
|
13195
|
-
__decorateClass$a([
|
|
13196
|
-
modernIdoc.property({ fallback: 3 })
|
|
13197
|
-
], exports.Ruler.prototype, "markHeight", 2);
|
|
13198
|
-
__decorateClass$a([
|
|
13199
|
-
modernIdoc.property({ fallback: "#b2b6bc" })
|
|
13200
|
-
], exports.Ruler.prototype, "color", 2);
|
|
13201
|
-
__decorateClass$a([
|
|
13202
|
-
modernIdoc.property({ fallback: "#f9f9fa" })
|
|
13203
|
-
], exports.Ruler.prototype, "markBackgroundColor", 2);
|
|
13204
|
-
__decorateClass$a([
|
|
13205
|
-
modernIdoc.property({ fallback: "#b2b6bc" })
|
|
13206
|
-
], exports.Ruler.prototype, "markColor", 2);
|
|
13207
|
-
__decorateClass$a([
|
|
13208
|
-
modernIdoc.property({ fallback: 300 })
|
|
13209
|
-
], exports.Ruler.prototype, "gap", 2);
|
|
13210
|
-
__decorateClass$a([
|
|
13211
|
-
modernIdoc.property({ fallback: 1 })
|
|
13212
|
-
], exports.Ruler.prototype, "gapScale", 2);
|
|
13213
|
-
exports.Ruler = __decorateClass$a([
|
|
13214
|
-
customNode("Ruler")
|
|
13215
|
-
], exports.Ruler);
|
|
13216
|
-
|
|
13217
|
-
var __defProp$6 = Object.defineProperty;
|
|
13218
|
-
var __getOwnPropDesc$8 = Object.getOwnPropertyDescriptor;
|
|
13219
|
-
var __decorateClass$9 = (decorators, target, key, kind) => {
|
|
13220
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$8(target, key) : target;
|
|
13221
|
-
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
13222
|
-
if (decorator = decorators[i])
|
|
13223
|
-
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
13224
|
-
if (kind && result) __defProp$6(target, key, result);
|
|
13225
|
-
return result;
|
|
13226
|
-
};
|
|
13227
|
-
exports.ScrollBar = class ScrollBar extends exports.Range {
|
|
13228
|
-
constructor(properties, children = []) {
|
|
13229
|
-
super();
|
|
13230
|
-
this.setProperties(properties).append(children);
|
|
13231
|
-
}
|
|
13232
|
-
_updateStyleProperty(key, value, oldValue) {
|
|
13233
|
-
super._updateStyleProperty(key, value, oldValue);
|
|
13234
|
-
switch (key) {
|
|
13235
|
-
case "width":
|
|
13236
|
-
case "height":
|
|
13237
|
-
case "left":
|
|
13238
|
-
case "top":
|
|
13239
|
-
this.requestRedraw();
|
|
13240
|
-
break;
|
|
13241
|
-
}
|
|
13242
|
-
}
|
|
13243
|
-
_rect() {
|
|
13244
|
-
const { size, position } = this;
|
|
13245
|
-
let left, top, width, height, radii;
|
|
13246
|
-
if (this.direction === "vertical") {
|
|
13247
|
-
width = 10;
|
|
13248
|
-
height = size.height * (this.page / (this.maxValue - this.minValue));
|
|
13249
|
-
left = position.left + size.width - width;
|
|
13250
|
-
top = size.height * (this.value / (this.maxValue - this.minValue));
|
|
13251
|
-
radii = width / 2;
|
|
13252
|
-
} else {
|
|
13253
|
-
width = size.width * (this.page / (this.maxValue - this.minValue));
|
|
13254
|
-
height = 10;
|
|
13255
|
-
left = size.width * (this.value / (this.maxValue - this.minValue));
|
|
13256
|
-
top = position.top + size.height - height;
|
|
13257
|
-
radii = height / 2;
|
|
13258
|
-
}
|
|
13259
|
-
return { left, top, width, height, radii };
|
|
13260
|
-
}
|
|
13261
|
-
_draw() {
|
|
13262
|
-
const { left, top, width, height, radii } = this._rect();
|
|
13263
|
-
this.context.roundRect(left, top, width, height, radii);
|
|
13264
|
-
this.context.fillStyle = 34;
|
|
13265
|
-
this.context.fill();
|
|
13266
|
-
}
|
|
13267
|
-
_pointerInput(point, key) {
|
|
13268
|
-
const { left, top, width, height } = this._rect();
|
|
13269
|
-
const flag = point.x >= left && point.x < left + width && point.y >= top && point.y < top + height;
|
|
13270
|
-
switch (key) {
|
|
13271
|
-
case "pointerdown":
|
|
13272
|
-
case "pointermove":
|
|
13273
|
-
if (flag) {
|
|
13274
|
-
this._tree?.input.setCursor("pointer");
|
|
13275
|
-
} else {
|
|
13276
|
-
this._tree?.input.setCursor(void 0);
|
|
13277
|
-
}
|
|
13278
|
-
break;
|
|
13279
|
-
}
|
|
13280
|
-
return false;
|
|
13281
|
-
}
|
|
13282
|
-
};
|
|
13283
|
-
__decorateClass$9([
|
|
13284
|
-
modernIdoc.property({ fallback: "vertical" })
|
|
13285
|
-
], exports.ScrollBar.prototype, "direction", 2);
|
|
13286
|
-
exports.ScrollBar = __decorateClass$9([
|
|
13287
|
-
customNode("ScrollBar")
|
|
13288
|
-
], exports.ScrollBar);
|
|
13289
|
-
|
|
13290
|
-
var __getOwnPropDesc$7 = Object.getOwnPropertyDescriptor;
|
|
13291
|
-
var __decorateClass$8 = (decorators, target, key, kind) => {
|
|
13292
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$7(target, key) : target;
|
|
13293
|
-
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
13294
|
-
if (decorator = decorators[i])
|
|
13295
|
-
result = (decorator(result)) || result;
|
|
13296
|
-
return result;
|
|
13297
|
-
};
|
|
13298
|
-
exports.XScrollBar = class XScrollBar extends exports.ScrollBar {
|
|
13299
|
-
constructor(properties, children = []) {
|
|
13300
|
-
super();
|
|
13301
|
-
this.setProperties(properties).append(children);
|
|
13302
|
-
}
|
|
13303
|
-
};
|
|
13304
|
-
exports.XScrollBar = __decorateClass$8([
|
|
13305
|
-
customNode("XScrollBar", {
|
|
13306
|
-
direction: "horizontal"
|
|
13307
|
-
})
|
|
13308
|
-
], exports.XScrollBar);
|
|
13309
|
-
|
|
13310
|
-
var __getOwnPropDesc$6 = Object.getOwnPropertyDescriptor;
|
|
13311
|
-
var __decorateClass$7 = (decorators, target, key, kind) => {
|
|
13312
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$6(target, key) : target;
|
|
13313
|
-
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
13314
|
-
if (decorator = decorators[i])
|
|
13315
|
-
result = (decorator(result)) || result;
|
|
13316
|
-
return result;
|
|
13317
|
-
};
|
|
13318
|
-
exports.YScrollBar = class YScrollBar extends exports.ScrollBar {
|
|
13319
|
-
constructor(properties, children = []) {
|
|
13320
|
-
super();
|
|
13321
|
-
this.setProperties(properties).append(children);
|
|
13322
|
-
}
|
|
13323
|
-
};
|
|
13324
|
-
exports.YScrollBar = __decorateClass$7([
|
|
13325
|
-
customNode("YScrollBar", {
|
|
13326
|
-
direction: "vertical"
|
|
13327
|
-
})
|
|
13328
|
-
], exports.YScrollBar);
|
|
13329
|
-
|
|
13330
|
-
var __defProp$5 = Object.defineProperty;
|
|
13331
|
-
var __getOwnPropDesc$5 = Object.getOwnPropertyDescriptor;
|
|
13332
|
-
var __decorateClass$6 = (decorators, target, key, kind) => {
|
|
13333
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$5(target, key) : target;
|
|
13334
|
-
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
13335
|
-
if (decorator = decorators[i])
|
|
13336
|
-
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
13337
|
-
if (kind && result) __defProp$5(target, key, result);
|
|
13338
|
-
return result;
|
|
13339
|
-
};
|
|
13340
|
-
exports.Scaler = class Scaler extends exports.Node {
|
|
13341
|
-
get target() {
|
|
13342
|
-
if (this.parent?.style) {
|
|
13343
|
-
return this.parent;
|
|
13344
|
-
}
|
|
13345
|
-
return void 0;
|
|
13346
|
-
}
|
|
13347
|
-
constructor(properties, children = []) {
|
|
13348
|
-
super();
|
|
13349
|
-
this.setProperties(properties);
|
|
13350
|
-
this.append(children);
|
|
13351
|
-
}
|
|
13352
|
-
_updateProperty(key, value, oldValue) {
|
|
13353
|
-
super._updateProperty(key, value, oldValue);
|
|
13354
|
-
switch (key) {
|
|
13355
|
-
case "translateY":
|
|
13356
|
-
case "translateX":
|
|
13357
|
-
case "scale":
|
|
13358
|
-
case "min":
|
|
13359
|
-
case "max": {
|
|
13360
|
-
this.scale = clamp(this.scale, this.minScale, this.maxScale);
|
|
13361
|
-
this._updateTarget();
|
|
13362
|
-
break;
|
|
13363
|
-
}
|
|
13364
|
-
}
|
|
13365
|
-
}
|
|
13366
|
-
_updateTarget() {
|
|
13367
|
-
const target = this.target;
|
|
13368
|
-
if (target) {
|
|
13369
|
-
target.style.transform = `translate(${this.translateX}px, ${this.translateY}px) scale(${this.scale})`;
|
|
13370
|
-
this.emit("updateScale", this.scale);
|
|
13371
|
-
}
|
|
13372
|
-
}
|
|
13373
|
-
_onWheel(e) {
|
|
13374
|
-
const target = this.target;
|
|
13375
|
-
if (!target)
|
|
13376
|
-
return;
|
|
13377
|
-
e.preventDefault();
|
|
13378
|
-
if (e.ctrlKey) {
|
|
13379
|
-
const isTouchPad = e.wheelDeltaY ? Math.abs(Math.abs(e.wheelDeltaY) - Math.abs(3 * e.deltaY)) < 3 : e.deltaMode === 0;
|
|
13380
|
-
if (!isTouchPad) {
|
|
13381
|
-
e.preventDefault();
|
|
13382
|
-
this.scale += e.deltaY * -0.015;
|
|
13383
|
-
}
|
|
13384
|
-
} else {
|
|
13385
|
-
this.translateX -= e.deltaX;
|
|
13386
|
-
this.translateY -= e.deltaY;
|
|
13387
|
-
}
|
|
13388
|
-
}
|
|
13389
|
-
_input(event, key) {
|
|
13390
|
-
super._input(event, key);
|
|
13391
|
-
switch (key) {
|
|
13392
|
-
case "wheel":
|
|
13393
|
-
this._onWheel(event);
|
|
13394
|
-
break;
|
|
13395
|
-
}
|
|
13396
|
-
}
|
|
13397
|
-
};
|
|
13398
|
-
__decorateClass$6([
|
|
13399
|
-
modernIdoc.property({ default: 1 })
|
|
13400
|
-
], exports.Scaler.prototype, "translateX", 2);
|
|
13401
|
-
__decorateClass$6([
|
|
13402
|
-
modernIdoc.property({ default: 1 })
|
|
13403
|
-
], exports.Scaler.prototype, "translateY", 2);
|
|
13404
|
-
__decorateClass$6([
|
|
13405
|
-
modernIdoc.property({ default: 1 })
|
|
13406
|
-
], exports.Scaler.prototype, "scale", 2);
|
|
13407
|
-
__decorateClass$6([
|
|
13408
|
-
modernIdoc.property({ default: 0.05 })
|
|
13409
|
-
], exports.Scaler.prototype, "minScale", 2);
|
|
13410
|
-
__decorateClass$6([
|
|
13411
|
-
modernIdoc.property({ default: 10 })
|
|
13412
|
-
], exports.Scaler.prototype, "maxScale", 2);
|
|
13413
|
-
exports.Scaler = __decorateClass$6([
|
|
13414
|
-
customNode("Scaler", {
|
|
13415
|
-
processMode: "disabled",
|
|
13416
|
-
renderMode: "disabled"
|
|
13417
|
-
})
|
|
13418
|
-
], exports.Scaler);
|
|
13419
|
-
|
|
13420
13122
|
var __defProp$4 = Object.defineProperty;
|
|
13421
|
-
var __getOwnPropDesc$
|
|
13123
|
+
var __getOwnPropDesc$3 = Object.getOwnPropertyDescriptor;
|
|
13422
13124
|
var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
13423
|
-
var __decorateClass$
|
|
13424
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
13125
|
+
var __decorateClass$4 = (decorators, target, key, kind) => {
|
|
13126
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3(target, key) : target;
|
|
13425
13127
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
13426
13128
|
if (decorator = decorators[i])
|
|
13427
13129
|
result = (decorator(result)) || result;
|
|
@@ -13509,15 +13211,15 @@ void main(void) {
|
|
|
13509
13211
|
gl_FragColor = color;
|
|
13510
13212
|
}`
|
|
13511
13213
|
}));
|
|
13512
|
-
exports.KawaseTransition = __decorateClass$
|
|
13214
|
+
exports.KawaseTransition = __decorateClass$4([
|
|
13513
13215
|
customNode("KawaseTransition")
|
|
13514
13216
|
], exports.KawaseTransition);
|
|
13515
13217
|
|
|
13516
13218
|
var __defProp$3 = Object.defineProperty;
|
|
13517
|
-
var __getOwnPropDesc$
|
|
13219
|
+
var __getOwnPropDesc$2 = Object.getOwnPropertyDescriptor;
|
|
13518
13220
|
var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
13519
|
-
var __decorateClass$
|
|
13520
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
13221
|
+
var __decorateClass$3 = (decorators, target, key, kind) => {
|
|
13222
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2(target, key) : target;
|
|
13521
13223
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
13522
13224
|
if (decorator = decorators[i])
|
|
13523
13225
|
result = (decorator(result)) || result;
|
|
@@ -13562,15 +13264,15 @@ void main() {
|
|
|
13562
13264
|
gl_FragColor = mix(src2Color, src1Color, mixPercent);
|
|
13563
13265
|
}`
|
|
13564
13266
|
}));
|
|
13565
|
-
exports.LeftEraseTransition = __decorateClass$
|
|
13267
|
+
exports.LeftEraseTransition = __decorateClass$3([
|
|
13566
13268
|
customNode("LeftEraseTransition")
|
|
13567
13269
|
], exports.LeftEraseTransition);
|
|
13568
13270
|
|
|
13569
13271
|
var __defProp$2 = Object.defineProperty;
|
|
13570
|
-
var __getOwnPropDesc$
|
|
13272
|
+
var __getOwnPropDesc$1 = Object.getOwnPropertyDescriptor;
|
|
13571
13273
|
var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
13572
|
-
var __decorateClass$
|
|
13573
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
13274
|
+
var __decorateClass$2 = (decorators, target, key, kind) => {
|
|
13275
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1(target, key) : target;
|
|
13574
13276
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
13575
13277
|
if (decorator = decorators[i])
|
|
13576
13278
|
result = (decorator(result)) || result;
|
|
@@ -13669,15 +13371,15 @@ void main(void) {
|
|
|
13669
13371
|
gl_FragColor = color;
|
|
13670
13372
|
}`
|
|
13671
13373
|
}));
|
|
13672
|
-
exports.TiltShiftTransition = __decorateClass$
|
|
13374
|
+
exports.TiltShiftTransition = __decorateClass$2([
|
|
13673
13375
|
customNode("TiltShiftTransition")
|
|
13674
13376
|
], exports.TiltShiftTransition);
|
|
13675
13377
|
|
|
13676
13378
|
var __defProp$1 = Object.defineProperty;
|
|
13677
|
-
var __getOwnPropDesc
|
|
13379
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
13678
13380
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
13679
|
-
var __decorateClass$
|
|
13680
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc
|
|
13381
|
+
var __decorateClass$1 = (decorators, target, key, kind) => {
|
|
13382
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
13681
13383
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
13682
13384
|
if (decorator = decorators[i])
|
|
13683
13385
|
result = (decorator(result)) || result;
|
|
@@ -13763,7 +13465,7 @@ void main(void) {
|
|
|
13763
13465
|
gl_FragColor = texture2D(sampler, coord);
|
|
13764
13466
|
}`
|
|
13765
13467
|
}));
|
|
13766
|
-
exports.TwistTransition = __decorateClass$
|
|
13468
|
+
exports.TwistTransition = __decorateClass$1([
|
|
13767
13469
|
customNode("TwistTransition")
|
|
13768
13470
|
], exports.TwistTransition);
|
|
13769
13471
|
|
|
@@ -14127,220 +13829,6 @@ class Assets {
|
|
|
14127
13829
|
}
|
|
14128
13830
|
const assets = new Assets().use(new FontLoader()).use(new GifLoader()).use(new JsonLoader()).use(new LottieLoader()).use(new TextLoader()).use(new TextureLoader()).use(new VideoLoader());
|
|
14129
13831
|
|
|
14130
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
14131
|
-
var __decorateClass$1 = (decorators, target, key, kind) => {
|
|
14132
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
14133
|
-
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
14134
|
-
if (decorator = decorators[i])
|
|
14135
|
-
result = (decorator(result)) || result;
|
|
14136
|
-
return result;
|
|
14137
|
-
};
|
|
14138
|
-
exports.CanvasItemEditor = class CanvasItemEditor extends exports.Control {
|
|
14139
|
-
_pointerStart;
|
|
14140
|
-
_pointerOffset;
|
|
14141
|
-
selected;
|
|
14142
|
-
dragging;
|
|
14143
|
-
hovered;
|
|
14144
|
-
hover = new exports.Element2D({
|
|
14145
|
-
name: "hover",
|
|
14146
|
-
internalMode: "back",
|
|
14147
|
-
style: {
|
|
14148
|
-
visibility: "hidden",
|
|
14149
|
-
outlineStyle: "solid",
|
|
14150
|
-
outlineColor: "#00FF00FF",
|
|
14151
|
-
outlineWidth: 2,
|
|
14152
|
-
pointerEvents: "none"
|
|
14153
|
-
}
|
|
14154
|
-
});
|
|
14155
|
-
transformRect = new TransformRect2D({
|
|
14156
|
-
name: "transformRect",
|
|
14157
|
-
internalMode: "back",
|
|
14158
|
-
style: {
|
|
14159
|
-
visibility: "hidden",
|
|
14160
|
-
pointerEvents: "none"
|
|
14161
|
-
}
|
|
14162
|
-
});
|
|
14163
|
-
scaler = new exports.Scaler({
|
|
14164
|
-
name: "Scaler",
|
|
14165
|
-
internalMode: "back"
|
|
14166
|
-
}).on("updateScale", (scale) => {
|
|
14167
|
-
this.ruler.gapScale = scale;
|
|
14168
|
-
this._updateScrollbars();
|
|
14169
|
-
this._updateSelectionRect();
|
|
14170
|
-
});
|
|
14171
|
-
xScrollBar = new exports.XScrollBar({
|
|
14172
|
-
name: "XScrollBar",
|
|
14173
|
-
internalMode: "back",
|
|
14174
|
-
style: {
|
|
14175
|
-
visibility: "hidden"
|
|
14176
|
-
}
|
|
14177
|
-
});
|
|
14178
|
-
yScrollBar = new exports.YScrollBar({
|
|
14179
|
-
name: "yScrollBar",
|
|
14180
|
-
internalMode: "back",
|
|
14181
|
-
style: {
|
|
14182
|
-
visibility: "hidden"
|
|
14183
|
-
}
|
|
14184
|
-
});
|
|
14185
|
-
drawboard = new exports.Element2D({
|
|
14186
|
-
name: "drawboard",
|
|
14187
|
-
style: {
|
|
14188
|
-
width: 500,
|
|
14189
|
-
height: 500,
|
|
14190
|
-
backgroundColor: "#00FFFFFF",
|
|
14191
|
-
// overflow: 'hidden',
|
|
14192
|
-
pointerEvents: "none"
|
|
14193
|
-
// boxShadow: '2px 2px 2px 1px rgba(0, 0, 0, 0.2)',
|
|
14194
|
-
}
|
|
14195
|
-
}, [
|
|
14196
|
-
this.scaler
|
|
14197
|
-
]);
|
|
14198
|
-
ruler = new exports.Ruler({
|
|
14199
|
-
name: "ruler",
|
|
14200
|
-
offsetX: 100,
|
|
14201
|
-
offsetY: 100,
|
|
14202
|
-
style: {
|
|
14203
|
-
pointerEvents: "none"
|
|
14204
|
-
}
|
|
14205
|
-
}, [
|
|
14206
|
-
this.drawboard,
|
|
14207
|
-
this.hover,
|
|
14208
|
-
this.transformRect,
|
|
14209
|
-
this.xScrollBar,
|
|
14210
|
-
this.yScrollBar
|
|
14211
|
-
]);
|
|
14212
|
-
constructor() {
|
|
14213
|
-
super();
|
|
14214
|
-
this._onPointerdown = this._onPointerdown.bind(this);
|
|
14215
|
-
this._onPointermove = this._onPointermove.bind(this);
|
|
14216
|
-
this._onPointerup = this._onPointerup.bind(this);
|
|
14217
|
-
this.append(this.ruler);
|
|
14218
|
-
}
|
|
14219
|
-
_updateStyleProperty(key, value, oldValue) {
|
|
14220
|
-
super._updateStyleProperty(key, value, oldValue);
|
|
14221
|
-
switch (key) {
|
|
14222
|
-
case "width":
|
|
14223
|
-
this.drawboard.style.left = (this.size.width - this.drawboard.size.width) / 2;
|
|
14224
|
-
this.ruler.offsetX = this.drawboard.style.left;
|
|
14225
|
-
break;
|
|
14226
|
-
case "height":
|
|
14227
|
-
this.drawboard.style.top = (this.size.height - this.drawboard.size.height) / 2;
|
|
14228
|
-
this.ruler.offsetY = this.drawboard.style.top;
|
|
14229
|
-
break;
|
|
14230
|
-
}
|
|
14231
|
-
}
|
|
14232
|
-
_guiInput(event, key) {
|
|
14233
|
-
super._guiInput(event, key);
|
|
14234
|
-
switch (key) {
|
|
14235
|
-
case "pointerdown":
|
|
14236
|
-
this._onPointerdown(event);
|
|
14237
|
-
break;
|
|
14238
|
-
case "pointermove":
|
|
14239
|
-
this._onPointermove(event);
|
|
14240
|
-
break;
|
|
14241
|
-
case "pointerup":
|
|
14242
|
-
this._onPointerup();
|
|
14243
|
-
break;
|
|
14244
|
-
}
|
|
14245
|
-
}
|
|
14246
|
-
_onPointerdown(e) {
|
|
14247
|
-
let target = e.target;
|
|
14248
|
-
if (target?.equal(this)) {
|
|
14249
|
-
target = void 0;
|
|
14250
|
-
}
|
|
14251
|
-
if (target?.equal(this.transformRect)) {
|
|
14252
|
-
target = this.selected;
|
|
14253
|
-
}
|
|
14254
|
-
this._pointerOffset = { x: e.offsetX, y: e.offsetY };
|
|
14255
|
-
this.selected = target;
|
|
14256
|
-
this.dragging = target;
|
|
14257
|
-
if (target instanceof exports.Element2D) {
|
|
14258
|
-
this._pointerStart = target.style.clone();
|
|
14259
|
-
} else {
|
|
14260
|
-
this._pointerStart = void 0;
|
|
14261
|
-
}
|
|
14262
|
-
this._updateHover();
|
|
14263
|
-
this._updateSelectionRect();
|
|
14264
|
-
}
|
|
14265
|
-
_onPointermove(e) {
|
|
14266
|
-
let target = e.target;
|
|
14267
|
-
if (target?.equal(this)) {
|
|
14268
|
-
target = void 0;
|
|
14269
|
-
}
|
|
14270
|
-
if (target?.equal(this.transformRect)) {
|
|
14271
|
-
target = this.selected;
|
|
14272
|
-
}
|
|
14273
|
-
const { selected, dragging, _pointerStart, _pointerOffset } = this;
|
|
14274
|
-
if (selected && target?.equal(selected)) {
|
|
14275
|
-
this.hovered = void 0;
|
|
14276
|
-
} else {
|
|
14277
|
-
this.hovered = target;
|
|
14278
|
-
}
|
|
14279
|
-
const offset = _pointerOffset ? { x: e.offsetX - _pointerOffset.x, y: e.offsetY - _pointerOffset.y } : { x: 0, y: 0 };
|
|
14280
|
-
if (dragging && _pointerStart) {
|
|
14281
|
-
dragging.style.left = _pointerStart.left + offset.x / this.scaler.scale;
|
|
14282
|
-
dragging.style.top = _pointerStart.top + offset.y / this.scaler.scale;
|
|
14283
|
-
dragging.update();
|
|
14284
|
-
}
|
|
14285
|
-
this._updateHover();
|
|
14286
|
-
this._updateSelectionRect();
|
|
14287
|
-
}
|
|
14288
|
-
_onPointerup() {
|
|
14289
|
-
this.dragging = void 0;
|
|
14290
|
-
this._updateHover();
|
|
14291
|
-
this._updateSelectionRect();
|
|
14292
|
-
}
|
|
14293
|
-
_copyGlobalTransform(a, b) {
|
|
14294
|
-
a.style.visibility = "visible";
|
|
14295
|
-
a.style.width = b.globalScale.x * b.size.x;
|
|
14296
|
-
a.style.height = b.globalScale.y * b.size.y;
|
|
14297
|
-
a.style.left = b.globalPosition.x;
|
|
14298
|
-
a.style.top = b.globalPosition.y;
|
|
14299
|
-
a.style.rotate = b.globalRotation;
|
|
14300
|
-
a.update();
|
|
14301
|
-
}
|
|
14302
|
-
_updateHover() {
|
|
14303
|
-
const hovered = this.hovered;
|
|
14304
|
-
if (hovered instanceof exports.Element2D) {
|
|
14305
|
-
this.hover.style.visibility = "visible";
|
|
14306
|
-
this._copyGlobalTransform(this.hover, hovered);
|
|
14307
|
-
this.hover.requestRedraw();
|
|
14308
|
-
} else {
|
|
14309
|
-
this.hover.style.visibility = "hidden";
|
|
14310
|
-
}
|
|
14311
|
-
}
|
|
14312
|
-
_updateSelectionRect() {
|
|
14313
|
-
if (this.selected) {
|
|
14314
|
-
this.transformRect.style.visibility = "visible";
|
|
14315
|
-
this._copyGlobalTransform(this.transformRect, this.selected);
|
|
14316
|
-
} else {
|
|
14317
|
-
this.transformRect.style.visibility = "hidden";
|
|
14318
|
-
}
|
|
14319
|
-
}
|
|
14320
|
-
_updateScrollbars() {
|
|
14321
|
-
const scale = this.ruler.gapScale;
|
|
14322
|
-
const scrollHeight = this.drawboard.size.height * scale;
|
|
14323
|
-
const scrollWidth = this.drawboard.size.width * scale;
|
|
14324
|
-
if (scrollHeight > this.size.height) {
|
|
14325
|
-
this.yScrollBar.style.visibility = "visible";
|
|
14326
|
-
this.yScrollBar.maxValue = scrollHeight;
|
|
14327
|
-
this.yScrollBar.page = this.size.height;
|
|
14328
|
-
} else {
|
|
14329
|
-
this.yScrollBar.style.visibility = "hidden";
|
|
14330
|
-
}
|
|
14331
|
-
if (scrollWidth > this.size.width) {
|
|
14332
|
-
this.xScrollBar.style.visibility = "visible";
|
|
14333
|
-
this.xScrollBar.maxValue = scrollWidth;
|
|
14334
|
-
this.xScrollBar.page = this.size.width;
|
|
14335
|
-
} else {
|
|
14336
|
-
this.xScrollBar.style.visibility = "hidden";
|
|
14337
|
-
}
|
|
14338
|
-
}
|
|
14339
|
-
};
|
|
14340
|
-
exports.CanvasItemEditor = __decorateClass$1([
|
|
14341
|
-
customNode("CanvasItemEditor")
|
|
14342
|
-
], exports.CanvasItemEditor);
|
|
14343
|
-
|
|
14344
13832
|
var __defProp = Object.defineProperty;
|
|
14345
13833
|
var __decorateClass = (decorators, target, key, kind) => {
|
|
14346
13834
|
var result = void 0 ;
|