@inweb/viewer-three 26.9.1 → 26.9.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/plugins/components/AxesHelperComponent.js +8 -6
- package/dist/plugins/components/AxesHelperComponent.js.map +1 -1
- package/dist/plugins/components/AxesHelperComponent.min.js +1 -1
- package/dist/plugins/components/AxesHelperComponent.module.js +8 -6
- package/dist/plugins/components/AxesHelperComponent.module.js.map +1 -1
- package/dist/plugins/components/ExtentsHelperComponent.js.map +1 -1
- package/dist/plugins/components/ExtentsHelperComponent.min.js +1 -1
- package/dist/plugins/components/ExtentsHelperComponent.module.js +1 -1
- package/dist/plugins/components/ExtentsHelperComponent.module.js.map +1 -1
- package/dist/plugins/components/LightHelperComponent.js.map +1 -1
- package/dist/plugins/components/LightHelperComponent.min.js +1 -1
- package/dist/plugins/components/LightHelperComponent.module.js +7 -7
- package/dist/plugins/components/LightHelperComponent.module.js.map +1 -1
- package/dist/plugins/components/RoomEnvironmentComponent.js.map +1 -1
- package/dist/plugins/components/RoomEnvironmentComponent.min.js +1 -1
- package/dist/plugins/components/RoomEnvironmentComponent.module.js +1 -1
- package/dist/plugins/components/RoomEnvironmentComponent.module.js.map +1 -1
- package/dist/plugins/components/StatsPanelComponent.js.map +1 -1
- package/dist/plugins/components/StatsPanelComponent.min.js +1 -1
- package/dist/plugins/components/StatsPanelComponent.module.js +1 -1
- package/dist/plugins/components/StatsPanelComponent.module.js.map +1 -1
- package/dist/plugins/loaders/GLTFCloudLoader.js.map +1 -1
- package/dist/plugins/loaders/GLTFCloudLoader.min.js +1 -1
- package/dist/plugins/loaders/GLTFCloudLoader.module.js +1 -1
- package/dist/plugins/loaders/GLTFCloudLoader.module.js.map +1 -1
- package/dist/plugins/loaders/IFCXLoader.js +4 -4
- package/dist/plugins/loaders/IFCXLoader.js.map +1 -1
- package/dist/plugins/loaders/IFCXLoader.min.js +1 -1
- package/dist/plugins/loaders/IFCXLoader.module.js +92 -92
- package/dist/plugins/loaders/IFCXLoader.module.js.map +1 -1
- package/dist/plugins/loaders/PotreeLoader.js +160 -0
- package/dist/plugins/loaders/PotreeLoader.js.map +1 -0
- package/dist/plugins/loaders/PotreeLoader.min.js +1 -0
- package/dist/plugins/loaders/PotreeLoader.module.js +68 -0
- package/dist/plugins/loaders/PotreeLoader.module.js.map +1 -0
- package/dist/viewer-three.js +1180 -795
- package/dist/viewer-three.js.map +1 -1
- package/dist/viewer-three.min.js +3 -3
- package/dist/viewer-three.module.js +608 -301
- package/dist/viewer-three.module.js.map +1 -1
- package/lib/Viewer/Viewer.d.ts +3 -2
- package/lib/Viewer/controls/FlyControls.d.ts +34 -0
- package/lib/Viewer/controls/WalkControls.d.ts +19 -3
- package/lib/Viewer/draggers/FlyDragger.d.ts +14 -0
- package/package.json +6 -5
- package/plugins/components/AxesHelperComponent.ts +10 -6
- package/plugins/loaders/{IFCXCloudLoader.ts → IFCX/IFCXCloudLoader.ts} +1 -1
- package/plugins/loaders/{IFCXFileLoader.ts → IFCX/IFCXFileLoader.ts} +1 -1
- package/plugins/loaders/Potree/PotreeFileLoader.ts +106 -0
- package/plugins/loaders/Potree/PotreeModelImpl.ts +36 -0
- package/plugins/loaders/Potree/index.ts +28 -0
- package/src/Viewer/Viewer.ts +34 -10
- package/src/Viewer/components/ExtentsComponent.ts +1 -1
- package/src/Viewer/components/ResizeCanvasComponent.ts +1 -18
- package/src/Viewer/controls/FlyControls.ts +205 -0
- package/src/Viewer/controls/WalkControls.ts +129 -20
- package/src/Viewer/draggers/FlyDragger.ts +73 -0
- package/src/Viewer/draggers/OrbitDragger.ts +9 -0
- package/src/Viewer/draggers/WalkDragger.ts +11 -2
- package/src/Viewer/draggers/index.ts +2 -0
- package/src/Viewer/helpers/WCSHelper.ts +3 -3
- /package/plugins/loaders/{IFCXLoader.ts → IFCX/index.ts} +0 -0
package/dist/viewer-three.js
CHANGED
|
@@ -17,14 +17,14 @@
|
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
19
|
registerCommandAlias(id, alias) {
|
|
20
|
-
this.registerCommand(alias, (
|
|
20
|
+
this.registerCommand(alias, (viewer, ...args) => this.executeCommand(id, viewer, ...args));
|
|
21
21
|
}
|
|
22
22
|
getCommand(id) {
|
|
23
23
|
return this._commands.get(id);
|
|
24
24
|
}
|
|
25
25
|
getCommands() {
|
|
26
26
|
const map = new Map;
|
|
27
|
-
this._commands.forEach((
|
|
27
|
+
this._commands.forEach((value, key) => map.set(key, value));
|
|
28
28
|
return map;
|
|
29
29
|
}
|
|
30
30
|
executeCommand(id, viewer, ...args) {
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
}
|
|
40
40
|
const {handler: handler, thisArg: thisArg} = command;
|
|
41
41
|
const result = handler.apply(thisArg, [ viewer, ...args ]);
|
|
42
|
-
viewer === null || viewer ===
|
|
42
|
+
viewer === null || viewer === void 0 ? void 0 : viewer.emit({
|
|
43
43
|
type: "command",
|
|
44
44
|
data: id,
|
|
45
45
|
args: args
|
|
@@ -75,11 +75,11 @@
|
|
|
75
75
|
}
|
|
76
76
|
registerDraggerAlias(name, alias) {
|
|
77
77
|
const provider = this._providers.get(name);
|
|
78
|
-
if (provider) this.registerDragger(alias,
|
|
78
|
+
if (provider) this.registerDragger(alias, viewer => provider(viewer));
|
|
79
79
|
}
|
|
80
80
|
getDraggers() {
|
|
81
81
|
const map = new Map;
|
|
82
|
-
this._providers.forEach((
|
|
82
|
+
this._providers.forEach((value, key) => map.set(key, value));
|
|
83
83
|
return map;
|
|
84
84
|
}
|
|
85
85
|
createDragger(name, viewer) {
|
|
@@ -118,11 +118,11 @@
|
|
|
118
118
|
}
|
|
119
119
|
registerComponentAlias(name, alias) {
|
|
120
120
|
const provider = this._providers.get(name);
|
|
121
|
-
if (provider) this.registerComponent(alias,
|
|
121
|
+
if (provider) this.registerComponent(alias, viewer => provider(viewer));
|
|
122
122
|
}
|
|
123
123
|
getComponents() {
|
|
124
124
|
const map = new Map;
|
|
125
|
-
this._providers.forEach((
|
|
125
|
+
this._providers.forEach((value, key) => map.set(key, value));
|
|
126
126
|
return map;
|
|
127
127
|
}
|
|
128
128
|
createComponent(name, viewer) {
|
|
@@ -177,18 +177,18 @@
|
|
|
177
177
|
}
|
|
178
178
|
getLoaders() {
|
|
179
179
|
const map = new Map;
|
|
180
|
-
this._providers.forEach((
|
|
180
|
+
this._providers.forEach((value, key) => map.set(key, value));
|
|
181
181
|
return map;
|
|
182
182
|
}
|
|
183
183
|
createLoader(viewer, file, format) {
|
|
184
184
|
let result = null;
|
|
185
|
-
this._providers.forEach((
|
|
185
|
+
this._providers.forEach((provider, key) => {
|
|
186
186
|
const loader = provider(viewer);
|
|
187
187
|
if (loader.isSupport(file, format)) {
|
|
188
188
|
result = loader;
|
|
189
189
|
result.name = key;
|
|
190
190
|
}
|
|
191
|
-
})
|
|
191
|
+
});
|
|
192
192
|
return result;
|
|
193
193
|
}
|
|
194
194
|
}
|
|
@@ -292,10 +292,10 @@
|
|
|
292
292
|
resetToDefaults(fields) {
|
|
293
293
|
if (fields !== undefined) {
|
|
294
294
|
const defaults = Options.defaults();
|
|
295
|
-
const resetData = fields.reduce((
|
|
295
|
+
const resetData = fields.reduce((acc, field) => {
|
|
296
296
|
acc[field] = defaults[field];
|
|
297
297
|
return acc;
|
|
298
|
-
}
|
|
298
|
+
}, {});
|
|
299
299
|
this.data = {
|
|
300
300
|
...this.data,
|
|
301
301
|
...resetData
|
|
@@ -529,7 +529,7 @@
|
|
|
529
529
|
* @type {ConstantsMouse}
|
|
530
530
|
* @constant
|
|
531
531
|
*/
|
|
532
|
-
const MOUSE = { ROTATE: 0, DOLLY: 1, PAN: 2 };
|
|
532
|
+
const MOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2, ROTATE: 0, DOLLY: 1, PAN: 2 };
|
|
533
533
|
|
|
534
534
|
/**
|
|
535
535
|
* Represents touch interaction types in context of controls.
|
|
@@ -57787,34 +57787,34 @@
|
|
|
57787
57787
|
|
|
57788
57788
|
// near
|
|
57789
57789
|
|
|
57790
|
-
setPoint( 'n1', pointMap, geometry, _camera$1, -
|
|
57791
|
-
setPoint( 'n2', pointMap, geometry, _camera$1, w, -
|
|
57792
|
-
setPoint( 'n3', pointMap, geometry, _camera$1, -
|
|
57790
|
+
setPoint( 'n1', pointMap, geometry, _camera$1, - w, - h, nearZ );
|
|
57791
|
+
setPoint( 'n2', pointMap, geometry, _camera$1, w, - h, nearZ );
|
|
57792
|
+
setPoint( 'n3', pointMap, geometry, _camera$1, - w, h, nearZ );
|
|
57793
57793
|
setPoint( 'n4', pointMap, geometry, _camera$1, w, h, nearZ );
|
|
57794
57794
|
|
|
57795
57795
|
// far
|
|
57796
57796
|
|
|
57797
|
-
setPoint( 'f1', pointMap, geometry, _camera$1, -
|
|
57798
|
-
setPoint( 'f2', pointMap, geometry, _camera$1, w, -
|
|
57799
|
-
setPoint( 'f3', pointMap, geometry, _camera$1, -
|
|
57797
|
+
setPoint( 'f1', pointMap, geometry, _camera$1, - w, - h, farZ );
|
|
57798
|
+
setPoint( 'f2', pointMap, geometry, _camera$1, w, - h, farZ );
|
|
57799
|
+
setPoint( 'f3', pointMap, geometry, _camera$1, - w, h, farZ );
|
|
57800
57800
|
setPoint( 'f4', pointMap, geometry, _camera$1, w, h, farZ );
|
|
57801
57801
|
|
|
57802
57802
|
// up
|
|
57803
57803
|
|
|
57804
57804
|
setPoint( 'u1', pointMap, geometry, _camera$1, w * 0.7, h * 1.1, nearZ );
|
|
57805
|
-
setPoint( 'u2', pointMap, geometry, _camera$1, -
|
|
57805
|
+
setPoint( 'u2', pointMap, geometry, _camera$1, - w * 0.7, h * 1.1, nearZ );
|
|
57806
57806
|
setPoint( 'u3', pointMap, geometry, _camera$1, 0, h * 2, nearZ );
|
|
57807
57807
|
|
|
57808
57808
|
// cross
|
|
57809
57809
|
|
|
57810
|
-
setPoint( 'cf1', pointMap, geometry, _camera$1, -
|
|
57810
|
+
setPoint( 'cf1', pointMap, geometry, _camera$1, - w, 0, farZ );
|
|
57811
57811
|
setPoint( 'cf2', pointMap, geometry, _camera$1, w, 0, farZ );
|
|
57812
|
-
setPoint( 'cf3', pointMap, geometry, _camera$1, 0, -
|
|
57812
|
+
setPoint( 'cf3', pointMap, geometry, _camera$1, 0, - h, farZ );
|
|
57813
57813
|
setPoint( 'cf4', pointMap, geometry, _camera$1, 0, h, farZ );
|
|
57814
57814
|
|
|
57815
|
-
setPoint( 'cn1', pointMap, geometry, _camera$1, -
|
|
57815
|
+
setPoint( 'cn1', pointMap, geometry, _camera$1, - w, 0, nearZ );
|
|
57816
57816
|
setPoint( 'cn2', pointMap, geometry, _camera$1, w, 0, nearZ );
|
|
57817
|
-
setPoint( 'cn3', pointMap, geometry, _camera$1, 0, -
|
|
57817
|
+
setPoint( 'cn3', pointMap, geometry, _camera$1, 0, - h, nearZ );
|
|
57818
57818
|
setPoint( 'cn4', pointMap, geometry, _camera$1, 0, h, nearZ );
|
|
57819
57819
|
|
|
57820
57820
|
geometry.getAttribute( 'position' ).needsUpdate = true;
|
|
@@ -80902,6 +80902,12 @@ void main() {
|
|
|
80902
80902
|
this.viewer.target.copy(this.orbit.target);
|
|
80903
80903
|
this.viewer.update();
|
|
80904
80904
|
switch (this.orbit.state) {
|
|
80905
|
+
case STATE.ROTATE:
|
|
80906
|
+
case STATE.TOUCH_ROTATE:
|
|
80907
|
+
this.viewer.emitEvent({
|
|
80908
|
+
type: "orbit",
|
|
80909
|
+
});
|
|
80910
|
+
break;
|
|
80905
80911
|
case STATE.PAN:
|
|
80906
80912
|
case STATE.TOUCH_PAN:
|
|
80907
80913
|
this.viewer.emitEvent({
|
|
@@ -80921,6 +80927,7 @@ void main() {
|
|
|
80921
80927
|
});
|
|
80922
80928
|
break;
|
|
80923
80929
|
}
|
|
80930
|
+
this.viewer.emitEvent({ type: "changecamera" });
|
|
80924
80931
|
this.changed = true;
|
|
80925
80932
|
};
|
|
80926
80933
|
this.stopContextMenu = (event) => {
|
|
@@ -81548,6 +81555,320 @@ void main() {
|
|
|
81548
81555
|
// acknowledge and accept the above terms.
|
|
81549
81556
|
///////////////////////////////////////////////////////////////////////////////
|
|
81550
81557
|
class WalkControls extends Controls {
|
|
81558
|
+
constructor(camera, canvas, groundObjects, viewer) {
|
|
81559
|
+
super(camera, canvas);
|
|
81560
|
+
this.EYE_HEIGHT = 1.7;
|
|
81561
|
+
this.FAILING_DISTANCE = 2;
|
|
81562
|
+
this.GROUND_FOLLOWING_SPEED = 0.05;
|
|
81563
|
+
this.LOOK_SPEED = 0.1;
|
|
81564
|
+
this.WALK_SPEED_DELIMITER = 4;
|
|
81565
|
+
this.WHEEL_SPEED_DELIMITER = 15000;
|
|
81566
|
+
this.movementSpeed = 0.1;
|
|
81567
|
+
this.multiplier = 3;
|
|
81568
|
+
this.moveWheel = 0;
|
|
81569
|
+
this.mouseDragOn = false;
|
|
81570
|
+
this.onPointerDown = (event) => {
|
|
81571
|
+
if (event.button !== 0)
|
|
81572
|
+
return;
|
|
81573
|
+
this.domElement.setPointerCapture(event.pointerId);
|
|
81574
|
+
this.downPosition.set(event.clientX, event.clientY);
|
|
81575
|
+
this.quaternion.copy(this.object.quaternion);
|
|
81576
|
+
this.mouseDragOn = true;
|
|
81577
|
+
};
|
|
81578
|
+
this.onPointerMove = (event) => {
|
|
81579
|
+
if (!this.mouseDragOn)
|
|
81580
|
+
return;
|
|
81581
|
+
const movePosition = new Vector2(event.clientX, event.clientY);
|
|
81582
|
+
if (this.downPosition.distanceTo(movePosition) === 0)
|
|
81583
|
+
return;
|
|
81584
|
+
this.rotateDelta.copy(this.downPosition).sub(movePosition);
|
|
81585
|
+
this.rotateCamera(this.rotateDelta);
|
|
81586
|
+
this.dispatchEvent({ type: "change" });
|
|
81587
|
+
};
|
|
81588
|
+
this.onPointerUp = (event) => {
|
|
81589
|
+
this.domElement.releasePointerCapture(event.pointerId);
|
|
81590
|
+
this.mouseDragOn = false;
|
|
81591
|
+
};
|
|
81592
|
+
this.onPointerCancel = (event) => {
|
|
81593
|
+
this.domElement.dispatchEvent(new PointerEvent("pointerup", event));
|
|
81594
|
+
};
|
|
81595
|
+
this.onWheel = (event) => {
|
|
81596
|
+
this.moveWheel = event.deltaY;
|
|
81597
|
+
this.update();
|
|
81598
|
+
};
|
|
81599
|
+
this.onKeyDown = (event) => {
|
|
81600
|
+
switch (event.code) {
|
|
81601
|
+
case "NumpadSubtract":
|
|
81602
|
+
case "Minus":
|
|
81603
|
+
if (this.multiplier > 1) {
|
|
81604
|
+
this.multiplier = this.multiplier - 1;
|
|
81605
|
+
this.dispatchEvent({ type: "walkspeedchange", data: this.multiplier });
|
|
81606
|
+
}
|
|
81607
|
+
break;
|
|
81608
|
+
case "NumpadAdd":
|
|
81609
|
+
case "Equal":
|
|
81610
|
+
if (this.multiplier < 10) {
|
|
81611
|
+
this.multiplier = this.multiplier + 1;
|
|
81612
|
+
this.dispatchEvent({ type: "walkspeedchange", data: this.multiplier });
|
|
81613
|
+
}
|
|
81614
|
+
break;
|
|
81615
|
+
case "ArrowLeft":
|
|
81616
|
+
case "ArrowRight":
|
|
81617
|
+
case "ArrowUp":
|
|
81618
|
+
case "ArrowDown":
|
|
81619
|
+
case "KeyW":
|
|
81620
|
+
case "KeyS":
|
|
81621
|
+
case "KeyA":
|
|
81622
|
+
case "KeyD":
|
|
81623
|
+
case "KeyQ":
|
|
81624
|
+
case "KeyE":
|
|
81625
|
+
this.moveKeys.add(event.code);
|
|
81626
|
+
this.update();
|
|
81627
|
+
break;
|
|
81628
|
+
}
|
|
81629
|
+
};
|
|
81630
|
+
this.onKeyUp = (event) => {
|
|
81631
|
+
if (this.moveKeys.delete(event.code))
|
|
81632
|
+
this.update();
|
|
81633
|
+
};
|
|
81634
|
+
this.initHighlighter = () => {
|
|
81635
|
+
this.highlighter = this.viewer.getComponent("HighlighterComponent");
|
|
81636
|
+
};
|
|
81637
|
+
this.camera = camera;
|
|
81638
|
+
this.viewer = viewer;
|
|
81639
|
+
this.groundObjects = groundObjects;
|
|
81640
|
+
this.raycaster = new Raycaster();
|
|
81641
|
+
this.raycaster.near = 0;
|
|
81642
|
+
this.raycaster.far = this.EYE_HEIGHT + this.FAILING_DISTANCE;
|
|
81643
|
+
this.moveKeys = new Set();
|
|
81644
|
+
this.moveClock = new Clock();
|
|
81645
|
+
this.quaternion = camera.quaternion.clone();
|
|
81646
|
+
this.downPosition = new Vector2(0, 0);
|
|
81647
|
+
this.rotateDelta = new Vector2(0, 0);
|
|
81648
|
+
this.domElement.addEventListener("pointerdown", this.onPointerDown);
|
|
81649
|
+
this.domElement.addEventListener("pointermove", this.onPointerMove);
|
|
81650
|
+
this.domElement.addEventListener("pointerup", this.onPointerUp);
|
|
81651
|
+
this.domElement.addEventListener("pointercancel", this.onPointerCancel);
|
|
81652
|
+
this.domElement.addEventListener("wheel", this.onWheel);
|
|
81653
|
+
window.addEventListener("keydown", this.onKeyDown);
|
|
81654
|
+
window.addEventListener("keyup", this.onKeyUp);
|
|
81655
|
+
}
|
|
81656
|
+
dispose() {
|
|
81657
|
+
this.domElement.removeEventListener("pointerdown", this.onPointerDown);
|
|
81658
|
+
this.domElement.removeEventListener("pointermove", this.onPointerMove);
|
|
81659
|
+
this.domElement.removeEventListener("pointerup", this.onPointerUp);
|
|
81660
|
+
this.domElement.removeEventListener("pointercancel", this.onPointerCancel);
|
|
81661
|
+
this.domElement.removeEventListener("wheel", this.onWheel);
|
|
81662
|
+
window.removeEventListener("keydown", this.onKeyDown);
|
|
81663
|
+
window.removeEventListener("keyup", this.onKeyUp);
|
|
81664
|
+
super.dispose();
|
|
81665
|
+
}
|
|
81666
|
+
updateGroundFollowing() {
|
|
81667
|
+
this.raycaster.set(this.object.position, new Vector3(0, -1, 0));
|
|
81668
|
+
this.raycaster.params = this.raycaster.params = {
|
|
81669
|
+
Mesh: {},
|
|
81670
|
+
Line: { threshold: 0 },
|
|
81671
|
+
Line2: { threshold: 0 },
|
|
81672
|
+
LOD: { threshold: 0 },
|
|
81673
|
+
Points: { threshold: 0 },
|
|
81674
|
+
Sprite: { threshold: 0 },
|
|
81675
|
+
};
|
|
81676
|
+
let intersects = this.raycaster.intersectObjects(this.groundObjects, false);
|
|
81677
|
+
if (intersects.length > 0) {
|
|
81678
|
+
const groundY = intersects[0].point.y;
|
|
81679
|
+
const targetY = groundY + this.EYE_HEIGHT;
|
|
81680
|
+
// Smoothly interpolate the camera's y position to the target height
|
|
81681
|
+
this.object.position.y = MathUtils.lerp(this.object.position.y, targetY, this.GROUND_FOLLOWING_SPEED);
|
|
81682
|
+
// Only for debug
|
|
81683
|
+
// const model = this.viewer.models[0];
|
|
81684
|
+
// const handles = model.getHandlesByObjects(intersects[0].object);
|
|
81685
|
+
// const objects = model.getObjectsByHandles(handles);
|
|
81686
|
+
// this.viewer.clearSelected();
|
|
81687
|
+
// this.select(objects, model);
|
|
81688
|
+
}
|
|
81689
|
+
}
|
|
81690
|
+
select(objects, model) {
|
|
81691
|
+
if (!model) {
|
|
81692
|
+
this.viewer.models.forEach((model) => this.select(objects, model));
|
|
81693
|
+
return;
|
|
81694
|
+
}
|
|
81695
|
+
if (!Array.isArray(objects))
|
|
81696
|
+
objects = [objects];
|
|
81697
|
+
if (!objects.length)
|
|
81698
|
+
return;
|
|
81699
|
+
model.showOriginalObjects(objects);
|
|
81700
|
+
this.highlighter.highlight(objects);
|
|
81701
|
+
objects.forEach((object) => this.viewer.selected.push(object));
|
|
81702
|
+
objects.forEach((object) => (object.isSelected = true));
|
|
81703
|
+
}
|
|
81704
|
+
update() {
|
|
81705
|
+
let moved = false;
|
|
81706
|
+
let upgradeGroundFollowing = false;
|
|
81707
|
+
const forward = new Vector3();
|
|
81708
|
+
const sideways = new Vector3();
|
|
81709
|
+
if (this.moveKeys.size > 0) {
|
|
81710
|
+
upgradeGroundFollowing = true;
|
|
81711
|
+
const timeDelta = this.moveClock.getDelta();
|
|
81712
|
+
const moveDelta = (timeDelta * this.multiplier * this.movementSpeed) / this.WALK_SPEED_DELIMITER;
|
|
81713
|
+
this.object.getWorldDirection(forward);
|
|
81714
|
+
forward.y = 0;
|
|
81715
|
+
forward.normalize();
|
|
81716
|
+
sideways.setFromMatrixColumn(this.object.matrix, 0);
|
|
81717
|
+
sideways.y = 0;
|
|
81718
|
+
sideways.normalize();
|
|
81719
|
+
if (this.moveKeys.has("KeyW")) {
|
|
81720
|
+
this.object.position.addScaledVector(forward, moveDelta);
|
|
81721
|
+
}
|
|
81722
|
+
if (this.moveKeys.has("KeyS")) {
|
|
81723
|
+
this.object.position.addScaledVector(forward, -moveDelta);
|
|
81724
|
+
}
|
|
81725
|
+
if (this.moveKeys.has("KeyA")) {
|
|
81726
|
+
this.object.position.addScaledVector(sideways, -moveDelta);
|
|
81727
|
+
}
|
|
81728
|
+
if (this.moveKeys.has("KeyD")) {
|
|
81729
|
+
this.object.position.addScaledVector(sideways, moveDelta);
|
|
81730
|
+
}
|
|
81731
|
+
if (this.moveKeys.has("KeyQ")) {
|
|
81732
|
+
this.object.translateY(moveDelta);
|
|
81733
|
+
upgradeGroundFollowing = false;
|
|
81734
|
+
}
|
|
81735
|
+
if (this.moveKeys.has("KeyE")) {
|
|
81736
|
+
this.object.translateY(-moveDelta);
|
|
81737
|
+
upgradeGroundFollowing = false;
|
|
81738
|
+
}
|
|
81739
|
+
const lookDelta = this.LOOK_SPEED + (this.multiplier - 1);
|
|
81740
|
+
if (this.moveKeys.has("ArrowUp"))
|
|
81741
|
+
this.rotateCamera(this.rotateDelta.add(new Vector2(0, -lookDelta / 2)));
|
|
81742
|
+
if (this.moveKeys.has("ArrowDown"))
|
|
81743
|
+
this.rotateCamera(this.rotateDelta.add(new Vector2(0, lookDelta / 2)));
|
|
81744
|
+
if (this.moveKeys.has("ArrowLeft"))
|
|
81745
|
+
this.rotateCamera(this.rotateDelta.add(new Vector2(lookDelta, 0)));
|
|
81746
|
+
if (this.moveKeys.has("ArrowRight"))
|
|
81747
|
+
this.rotateCamera(this.rotateDelta.add(new Vector2(-lookDelta, 0)));
|
|
81748
|
+
this.moveWheel = 0;
|
|
81749
|
+
moved = true;
|
|
81750
|
+
}
|
|
81751
|
+
if (this.moveWheel !== 0) {
|
|
81752
|
+
const moveDelta = (this.moveWheel * this.multiplier * this.movementSpeed) / this.WHEEL_SPEED_DELIMITER;
|
|
81753
|
+
this.object.getWorldDirection(forward);
|
|
81754
|
+
forward.y = 0;
|
|
81755
|
+
forward.normalize();
|
|
81756
|
+
this.object.position.addScaledVector(forward, -moveDelta);
|
|
81757
|
+
this.moveWheel += -1 * Math.sign(this.moveWheel);
|
|
81758
|
+
moved = true;
|
|
81759
|
+
}
|
|
81760
|
+
if (upgradeGroundFollowing)
|
|
81761
|
+
this.updateGroundFollowing();
|
|
81762
|
+
if (moved) {
|
|
81763
|
+
this.dispatchEvent({ type: "change" });
|
|
81764
|
+
}
|
|
81765
|
+
if (this.moveKeys.size === 0 && this.moveWheel === 0) {
|
|
81766
|
+
this.moveClock.stop();
|
|
81767
|
+
this.moveClock.autoStart = true;
|
|
81768
|
+
}
|
|
81769
|
+
}
|
|
81770
|
+
rotateCamera(delta) {
|
|
81771
|
+
const rotateX = (Math.PI * delta.x) / this.domElement.clientWidth;
|
|
81772
|
+
const rotateY = (Math.PI * delta.y) / this.domElement.clientHeight;
|
|
81773
|
+
const xRotation = new Quaternion();
|
|
81774
|
+
xRotation.setFromAxisAngle(this.object.up, rotateX);
|
|
81775
|
+
const yRotation = new Quaternion();
|
|
81776
|
+
yRotation.setFromAxisAngle(new Vector3(1, 0, 0), rotateY);
|
|
81777
|
+
const quaternion = this.quaternion.clone();
|
|
81778
|
+
quaternion.premultiply(xRotation).multiply(yRotation).normalize();
|
|
81779
|
+
this.object.setRotationFromQuaternion(quaternion);
|
|
81780
|
+
}
|
|
81781
|
+
}
|
|
81782
|
+
|
|
81783
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
81784
|
+
// Copyright (C) 2002-2025, Open Design Alliance (the "Alliance").
|
|
81785
|
+
// All rights reserved.
|
|
81786
|
+
//
|
|
81787
|
+
// This software and its documentation and related materials are owned by
|
|
81788
|
+
// the Alliance. The software may only be incorporated into application
|
|
81789
|
+
// programs owned by members of the Alliance, subject to a signed
|
|
81790
|
+
// Membership Agreement and Supplemental Software License Agreement with the
|
|
81791
|
+
// Alliance. The structure and organization of this software are the valuable
|
|
81792
|
+
// trade secrets of the Alliance and its suppliers. The software is also
|
|
81793
|
+
// protected by copyright law and international treaty provisions. Application
|
|
81794
|
+
// programs incorporating this software must include the following statement
|
|
81795
|
+
// with their copyright notices:
|
|
81796
|
+
//
|
|
81797
|
+
// This application incorporates Open Design Alliance software pursuant to a
|
|
81798
|
+
// license agreement with Open Design Alliance.
|
|
81799
|
+
// Open Design Alliance Copyright (C) 2002-2025 by Open Design Alliance.
|
|
81800
|
+
// All rights reserved.
|
|
81801
|
+
//
|
|
81802
|
+
// By use of this software, its documentation or related materials, you
|
|
81803
|
+
// acknowledge and accept the above terms.
|
|
81804
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
81805
|
+
class WalkDragger {
|
|
81806
|
+
constructor(viewer) {
|
|
81807
|
+
this.updateControls = () => {
|
|
81808
|
+
const size = this.viewer.extents.getSize(new Vector3());
|
|
81809
|
+
this.controls.movementSpeed = Math.min(size.x, size.y, size.z) / 2;
|
|
81810
|
+
};
|
|
81811
|
+
this.controlsChange = () => {
|
|
81812
|
+
this.viewer.update();
|
|
81813
|
+
this.viewer.emitEvent({ type: "changecamera" });
|
|
81814
|
+
};
|
|
81815
|
+
this.walkspeedChange = (event) => {
|
|
81816
|
+
this.viewer.emitEvent(event);
|
|
81817
|
+
};
|
|
81818
|
+
this.viewerRender = () => {
|
|
81819
|
+
this.controls.update();
|
|
81820
|
+
};
|
|
81821
|
+
this.viewerZoom = () => {
|
|
81822
|
+
this.controls.rotateDelta.set(0, 0);
|
|
81823
|
+
};
|
|
81824
|
+
const meshOnlyGround = [];
|
|
81825
|
+
viewer.models[0].getObjects().forEach((obj) => {
|
|
81826
|
+
obj.traverse((child) => {
|
|
81827
|
+
if (child instanceof Mesh) {
|
|
81828
|
+
meshOnlyGround.push(child);
|
|
81829
|
+
}
|
|
81830
|
+
});
|
|
81831
|
+
});
|
|
81832
|
+
this.controls = new WalkControls(viewer.camera, viewer.canvas, meshOnlyGround, viewer);
|
|
81833
|
+
this.controls.addEventListener("change", this.controlsChange);
|
|
81834
|
+
this.controls.addEventListener("walkspeedchange", this.walkspeedChange);
|
|
81835
|
+
this.viewer = viewer;
|
|
81836
|
+
this.viewer.on("render", this.viewerRender);
|
|
81837
|
+
this.viewer.on("zoom", this.viewerZoom);
|
|
81838
|
+
this.updateControls();
|
|
81839
|
+
}
|
|
81840
|
+
dispose() {
|
|
81841
|
+
this.viewer.off("render", this.viewerRender);
|
|
81842
|
+
this.viewer.off("zoom", this.viewerZoom);
|
|
81843
|
+
this.controls.removeEventListener("walkspeedchange", this.walkspeedChange);
|
|
81844
|
+
this.controls.removeEventListener("change", this.controlsChange);
|
|
81845
|
+
this.controls.dispose();
|
|
81846
|
+
}
|
|
81847
|
+
}
|
|
81848
|
+
|
|
81849
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
81850
|
+
// Copyright (C) 2002-2025, Open Design Alliance (the "Alliance").
|
|
81851
|
+
// All rights reserved.
|
|
81852
|
+
//
|
|
81853
|
+
// This software and its documentation and related materials are owned by
|
|
81854
|
+
// the Alliance. The software may only be incorporated into application
|
|
81855
|
+
// programs owned by members of the Alliance, subject to a signed
|
|
81856
|
+
// Membership Agreement and Supplemental Software License Agreement with the
|
|
81857
|
+
// Alliance. The structure and organization of this software are the valuable
|
|
81858
|
+
// trade secrets of the Alliance and its suppliers. The software is also
|
|
81859
|
+
// protected by copyright law and international treaty provisions. Application
|
|
81860
|
+
// programs incorporating this software must include the following statement
|
|
81861
|
+
// with their copyright notices:
|
|
81862
|
+
//
|
|
81863
|
+
// This application incorporates Open Design Alliance software pursuant to a
|
|
81864
|
+
// license agreement with Open Design Alliance.
|
|
81865
|
+
// Open Design Alliance Copyright (C) 2002-2025 by Open Design Alliance.
|
|
81866
|
+
// All rights reserved.
|
|
81867
|
+
//
|
|
81868
|
+
// By use of this software, its documentation or related materials, you
|
|
81869
|
+
// acknowledge and accept the above terms.
|
|
81870
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
81871
|
+
class FlyControls extends Controls {
|
|
81551
81872
|
constructor(camera, canvas) {
|
|
81552
81873
|
super(camera, canvas);
|
|
81553
81874
|
this.movementSpeed = 0.2;
|
|
@@ -81590,14 +81911,14 @@ void main() {
|
|
|
81590
81911
|
case "Minus":
|
|
81591
81912
|
if (this.multiplier > 1) {
|
|
81592
81913
|
this.multiplier = this.multiplier - 1;
|
|
81593
|
-
this.dispatchEvent({ type: "
|
|
81914
|
+
this.dispatchEvent({ type: "flyspeedchange", data: this.multiplier });
|
|
81594
81915
|
}
|
|
81595
81916
|
break;
|
|
81596
81917
|
case "NumpadAdd":
|
|
81597
81918
|
case "Equal":
|
|
81598
81919
|
if (this.multiplier < 10) {
|
|
81599
81920
|
this.multiplier = this.multiplier + 1;
|
|
81600
|
-
this.dispatchEvent({ type: "
|
|
81921
|
+
this.dispatchEvent({ type: "flyspeedchange", data: this.multiplier });
|
|
81601
81922
|
}
|
|
81602
81923
|
break;
|
|
81603
81924
|
case "ArrowLeft":
|
|
@@ -81716,7 +82037,7 @@ void main() {
|
|
|
81716
82037
|
// By use of this software, its documentation or related materials, you
|
|
81717
82038
|
// acknowledge and accept the above terms.
|
|
81718
82039
|
///////////////////////////////////////////////////////////////////////////////
|
|
81719
|
-
class
|
|
82040
|
+
class FlyDragger {
|
|
81720
82041
|
constructor(viewer) {
|
|
81721
82042
|
this.updateControls = () => {
|
|
81722
82043
|
const size = this.viewer.extents.getSize(new Vector3());
|
|
@@ -81724,8 +82045,9 @@ void main() {
|
|
|
81724
82045
|
};
|
|
81725
82046
|
this.controlsChange = () => {
|
|
81726
82047
|
this.viewer.update();
|
|
82048
|
+
this.viewer.emitEvent({ type: "changecamera" });
|
|
81727
82049
|
};
|
|
81728
|
-
this.
|
|
82050
|
+
this.flyspeedChange = (event) => {
|
|
81729
82051
|
this.viewer.emitEvent(event);
|
|
81730
82052
|
};
|
|
81731
82053
|
this.viewerRender = () => {
|
|
@@ -81734,9 +82056,9 @@ void main() {
|
|
|
81734
82056
|
this.viewerZoom = () => {
|
|
81735
82057
|
this.controls.rotateDelta.set(0, 0);
|
|
81736
82058
|
};
|
|
81737
|
-
this.controls = new
|
|
82059
|
+
this.controls = new FlyControls(viewer.camera, viewer.canvas);
|
|
81738
82060
|
this.controls.addEventListener("change", this.controlsChange);
|
|
81739
|
-
this.controls.addEventListener("
|
|
82061
|
+
this.controls.addEventListener("flyspeedchange", this.flyspeedChange);
|
|
81740
82062
|
this.viewer = viewer;
|
|
81741
82063
|
this.viewer.on("render", this.viewerRender);
|
|
81742
82064
|
this.viewer.on("zoom", this.viewerZoom);
|
|
@@ -81745,7 +82067,7 @@ void main() {
|
|
|
81745
82067
|
dispose() {
|
|
81746
82068
|
this.viewer.off("render", this.viewerRender);
|
|
81747
82069
|
this.viewer.off("zoom", this.viewerZoom);
|
|
81748
|
-
this.controls.removeEventListener("
|
|
82070
|
+
this.controls.removeEventListener("flyspeedchange", this.flyspeedChange);
|
|
81749
82071
|
this.controls.removeEventListener("change", this.controlsChange);
|
|
81750
82072
|
this.controls.dispose();
|
|
81751
82073
|
}
|
|
@@ -81856,6 +82178,7 @@ void main() {
|
|
|
81856
82178
|
draggers.registerDragger("CuttingPlaneYAxis", (viewer) => new CuttingPlaneYAxisDragger(viewer));
|
|
81857
82179
|
draggers.registerDragger("CuttingPlaneZAxis", (viewer) => new CuttingPlaneZAxisDragger(viewer));
|
|
81858
82180
|
draggers.registerDragger("Walk", (viewer) => new WalkDragger(viewer));
|
|
82181
|
+
draggers.registerDragger("Fly", (viewer) => new FlyDragger(viewer));
|
|
81859
82182
|
|
|
81860
82183
|
///////////////////////////////////////////////////////////////////////////////
|
|
81861
82184
|
// Copyright (C) 2002-2025, Open Design Alliance (the "Alliance").
|
|
@@ -82529,7 +82852,7 @@ void main() {
|
|
|
82529
82852
|
const objects = [];
|
|
82530
82853
|
viewer.scene.traverseVisible((child) => {
|
|
82531
82854
|
var _a;
|
|
82532
|
-
if (handleSet.has((_a = child.userData) === null || _a ===
|
|
82855
|
+
if (handleSet.has((_a = child.userData) === null || _a === void 0 ? void 0 : _a.handle))
|
|
82533
82856
|
objects.push(child);
|
|
82534
82857
|
});
|
|
82535
82858
|
const extents = objects.reduce((result, object) => result.expandByObject(object), new Box3());
|
|
@@ -82805,7 +83128,7 @@ void main() {
|
|
|
82805
83128
|
const extents = new Box3();
|
|
82806
83129
|
this.viewer.models.forEach((model) => model.getExtents(extents));
|
|
82807
83130
|
this.viewer.extents.copy(extents);
|
|
82808
|
-
extents.getCenter(this.viewer.target);
|
|
83131
|
+
this.viewer.extents.getCenter(this.viewer.target);
|
|
82809
83132
|
};
|
|
82810
83133
|
this.viewer = viewer;
|
|
82811
83134
|
this.viewer.addEventListener("databasechunk", this.syncExtents);
|
|
@@ -82972,21 +83295,7 @@ void main() {
|
|
|
82972
83295
|
const { width, height } = entries[0].contentRect;
|
|
82973
83296
|
if (!width || !height)
|
|
82974
83297
|
return; // <- invisible viewer, or viewer with parent removed
|
|
82975
|
-
|
|
82976
|
-
const aspect = width / height;
|
|
82977
|
-
if (camera.isPerspectiveCamera) {
|
|
82978
|
-
camera.aspect = aspect;
|
|
82979
|
-
camera.updateProjectionMatrix();
|
|
82980
|
-
}
|
|
82981
|
-
if (camera.isOrthographicCamera) {
|
|
82982
|
-
camera.left = camera.bottom * aspect;
|
|
82983
|
-
camera.right = camera.top * aspect;
|
|
82984
|
-
camera.updateProjectionMatrix();
|
|
82985
|
-
}
|
|
82986
|
-
this.viewer.renderer.setSize(width, height, true);
|
|
82987
|
-
this.viewer.composer.setSize(width, height);
|
|
82988
|
-
this.viewer.update(true);
|
|
82989
|
-
this.viewer.emitEvent({ type: "resize", width, height });
|
|
83298
|
+
this.viewer.setSize(width, height);
|
|
82990
83299
|
};
|
|
82991
83300
|
this.viewer = viewer;
|
|
82992
83301
|
this.resizeObserver = new ResizeObserver(this.resizeViewer);
|
|
@@ -84307,9 +84616,9 @@ void main() {
|
|
|
84307
84616
|
}
|
|
84308
84617
|
viewerResize(event) {
|
|
84309
84618
|
var _a, _b, _c;
|
|
84310
|
-
(_a = this.renderTarget) === null || _a ===
|
|
84311
|
-
(_b = this.edgesMaterial) === null || _b ===
|
|
84312
|
-
(_c = this.lineGlowMaterial) === null || _c ===
|
|
84619
|
+
(_a = this.renderTarget) === null || _a === void 0 ? void 0 : _a.setSize(event.width, event.height);
|
|
84620
|
+
(_b = this.edgesMaterial) === null || _b === void 0 ? void 0 : _b.resolution.set(event.width, event.height);
|
|
84621
|
+
(_c = this.lineGlowMaterial) === null || _c === void 0 ? void 0 : _c.resolution.set(event.width, event.height);
|
|
84313
84622
|
}
|
|
84314
84623
|
}
|
|
84315
84624
|
|
|
@@ -84466,9 +84775,9 @@ void main() {
|
|
|
84466
84775
|
this.size = 160;
|
|
84467
84776
|
this.orthoCamera = new OrthographicCamera(-2, 2, 2, -2, 0, 4);
|
|
84468
84777
|
this.orthoCamera.position.set(0, 0, 2);
|
|
84469
|
-
const matRed = new MeshBasicMaterial({ toneMapped: false, color: "#
|
|
84470
|
-
const matGreen = new MeshBasicMaterial({ toneMapped: false, color: "#
|
|
84471
|
-
const matBlue = new MeshBasicMaterial({ toneMapped: false, color: "#
|
|
84778
|
+
const matRed = new MeshBasicMaterial({ toneMapped: false, color: "#dd0000" });
|
|
84779
|
+
const matGreen = new MeshBasicMaterial({ toneMapped: false, color: "#00dd00" });
|
|
84780
|
+
const matBlue = new MeshBasicMaterial({ toneMapped: false, color: "#0000dd" });
|
|
84472
84781
|
const spriteRed = this.getSpriteMaterial(matRed.color, "X");
|
|
84473
84782
|
const spriteGreen = this.getSpriteMaterial(matGreen.color, "Y");
|
|
84474
84783
|
const spriteBlue = this.getSpriteMaterial(matBlue.color, "Z");
|
|
@@ -89916,7 +90225,7 @@ void main() {
|
|
|
89916
90225
|
.replace(this.resourcePath, "")
|
|
89917
90226
|
.replace(/^(\.?\/)/, "");
|
|
89918
90227
|
const dataURL = this.dataURLs.get(key);
|
|
89919
|
-
return dataURL !== null && dataURL !==
|
|
90228
|
+
return dataURL !== null && dataURL !== void 0 ? dataURL : url;
|
|
89920
90229
|
});
|
|
89921
90230
|
}
|
|
89922
90231
|
dispose() {
|
|
@@ -90257,13 +90566,26 @@ void main() {
|
|
|
90257
90566
|
};
|
|
90258
90567
|
|
|
90259
90568
|
const GL_CONSTANTS = {
|
|
90569
|
+
FLOAT: 5126,
|
|
90570
|
+
//FLOAT_MAT2: 35674,
|
|
90571
|
+
FLOAT_MAT3: 35675,
|
|
90572
|
+
FLOAT_MAT4: 35676,
|
|
90573
|
+
FLOAT_VEC2: 35664,
|
|
90574
|
+
FLOAT_VEC3: 35665,
|
|
90575
|
+
FLOAT_VEC4: 35666,
|
|
90576
|
+
LINEAR: 9729,
|
|
90577
|
+
REPEAT: 10497,
|
|
90578
|
+
SAMPLER_2D: 35678,
|
|
90260
90579
|
POINTS: 0,
|
|
90261
90580
|
LINES: 1,
|
|
90262
90581
|
LINE_LOOP: 2,
|
|
90263
90582
|
LINE_STRIP: 3,
|
|
90264
90583
|
TRIANGLES: 4,
|
|
90265
90584
|
TRIANGLE_STRIP: 5,
|
|
90266
|
-
TRIANGLE_FAN: 6
|
|
90585
|
+
TRIANGLE_FAN: 6,
|
|
90586
|
+
UNSIGNED_BYTE: 5121,
|
|
90587
|
+
UNSIGNED_SHORT: 5123,
|
|
90588
|
+
};
|
|
90267
90589
|
|
|
90268
90590
|
const MAX_GAP = 128 * 1024; // 128 KB
|
|
90269
90591
|
const MAX_CHUNK = 30 * 1024 * 1024; // 100 MB
|
|
@@ -95304,7 +95626,7 @@ void main() {
|
|
|
95304
95626
|
}
|
|
95305
95627
|
removeEventListener(type, listener) {
|
|
95306
95628
|
if (this._listeners[type] === undefined) return this;
|
|
95307
|
-
const listeners = this._listeners[type].filter(
|
|
95629
|
+
const listeners = this._listeners[type].filter(x => x !== listener);
|
|
95308
95630
|
if (listeners.length !== 0) this._listeners[type] = listeners; else delete this._listeners[type];
|
|
95309
95631
|
return this;
|
|
95310
95632
|
}
|
|
@@ -95315,7 +95637,7 @@ void main() {
|
|
|
95315
95637
|
emitEvent(event) {
|
|
95316
95638
|
if (this._listeners[event.type] === undefined) return false;
|
|
95317
95639
|
const invoke = this._listeners[event.type].slice();
|
|
95318
|
-
invoke.forEach(
|
|
95640
|
+
invoke.forEach(listener => listener.call(this, event));
|
|
95319
95641
|
return true;
|
|
95320
95642
|
}
|
|
95321
95643
|
on(type, listener) {
|
|
@@ -95353,7 +95675,7 @@ void main() {
|
|
|
95353
95675
|
hasRequiredGlobal = 1;
|
|
95354
95676
|
(function (exports) {
|
|
95355
95677
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
95356
|
-
exports._registerNode = exports.Konva = exports.glob =
|
|
95678
|
+
exports._registerNode = exports.Konva = exports.glob = void 0;
|
|
95357
95679
|
const PI_OVER_180 = Math.PI / 180;
|
|
95358
95680
|
function detectBrowser() {
|
|
95359
95681
|
return (typeof window !== 'undefined' &&
|
|
@@ -95369,7 +95691,7 @@ void main() {
|
|
|
95369
95691
|
: {};
|
|
95370
95692
|
exports.Konva = {
|
|
95371
95693
|
_global: exports.glob,
|
|
95372
|
-
version: '9.3.
|
|
95694
|
+
version: '9.3.22',
|
|
95373
95695
|
isBrowser: detectBrowser(),
|
|
95374
95696
|
isUnminified: /param/.test(function (param) { }.toString()),
|
|
95375
95697
|
dblClickWindow: 400,
|
|
@@ -95401,7 +95723,7 @@ void main() {
|
|
|
95401
95723
|
},
|
|
95402
95724
|
isTransforming() {
|
|
95403
95725
|
var _a;
|
|
95404
|
-
return (_a = exports.Konva['Transformer']) === null || _a ===
|
|
95726
|
+
return (_a = exports.Konva['Transformer']) === null || _a === void 0 ? void 0 : _a.isTransforming();
|
|
95405
95727
|
},
|
|
95406
95728
|
isDragReady() {
|
|
95407
95729
|
return !!exports.Konva['DD'].node;
|
|
@@ -95430,7 +95752,7 @@ void main() {
|
|
|
95430
95752
|
hasRequiredUtil = 1;
|
|
95431
95753
|
(function (exports) {
|
|
95432
95754
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
95433
|
-
exports.Util = exports.Transform =
|
|
95755
|
+
exports.Util = exports.Transform = void 0;
|
|
95434
95756
|
const Global_1 = requireGlobal();
|
|
95435
95757
|
class Transform {
|
|
95436
95758
|
constructor(m = [1, 0, 0, 1, 0, 0]) {
|
|
@@ -96239,343 +96561,6 @@ void main() {
|
|
|
96239
96561
|
|
|
96240
96562
|
var Node = {};
|
|
96241
96563
|
|
|
96242
|
-
var Factory = {};
|
|
96243
|
-
|
|
96244
|
-
var Validators = {};
|
|
96245
|
-
|
|
96246
|
-
var hasRequiredValidators;
|
|
96247
|
-
|
|
96248
|
-
function requireValidators () {
|
|
96249
|
-
if (hasRequiredValidators) return Validators;
|
|
96250
|
-
hasRequiredValidators = 1;
|
|
96251
|
-
Object.defineProperty(Validators, "__esModule", { value: true });
|
|
96252
|
-
Validators.RGBComponent = RGBComponent;
|
|
96253
|
-
Validators.alphaComponent = alphaComponent;
|
|
96254
|
-
Validators.getNumberValidator = getNumberValidator;
|
|
96255
|
-
Validators.getNumberOrArrayOfNumbersValidator = getNumberOrArrayOfNumbersValidator;
|
|
96256
|
-
Validators.getNumberOrAutoValidator = getNumberOrAutoValidator;
|
|
96257
|
-
Validators.getStringValidator = getStringValidator;
|
|
96258
|
-
Validators.getStringOrGradientValidator = getStringOrGradientValidator;
|
|
96259
|
-
Validators.getFunctionValidator = getFunctionValidator;
|
|
96260
|
-
Validators.getNumberArrayValidator = getNumberArrayValidator;
|
|
96261
|
-
Validators.getBooleanValidator = getBooleanValidator;
|
|
96262
|
-
Validators.getComponentValidator = getComponentValidator;
|
|
96263
|
-
const Global_1 = requireGlobal();
|
|
96264
|
-
const Util_1 = requireUtil();
|
|
96265
|
-
function _formatValue(val) {
|
|
96266
|
-
if (Util_1.Util._isString(val)) {
|
|
96267
|
-
return '"' + val + '"';
|
|
96268
|
-
}
|
|
96269
|
-
if (Object.prototype.toString.call(val) === '[object Number]') {
|
|
96270
|
-
return val;
|
|
96271
|
-
}
|
|
96272
|
-
if (Util_1.Util._isBoolean(val)) {
|
|
96273
|
-
return val;
|
|
96274
|
-
}
|
|
96275
|
-
return Object.prototype.toString.call(val);
|
|
96276
|
-
}
|
|
96277
|
-
function RGBComponent(val) {
|
|
96278
|
-
if (val > 255) {
|
|
96279
|
-
return 255;
|
|
96280
|
-
}
|
|
96281
|
-
else if (val < 0) {
|
|
96282
|
-
return 0;
|
|
96283
|
-
}
|
|
96284
|
-
return Math.round(val);
|
|
96285
|
-
}
|
|
96286
|
-
function alphaComponent(val) {
|
|
96287
|
-
if (val > 1) {
|
|
96288
|
-
return 1;
|
|
96289
|
-
}
|
|
96290
|
-
else if (val < 0.0001) {
|
|
96291
|
-
return 0.0001;
|
|
96292
|
-
}
|
|
96293
|
-
return val;
|
|
96294
|
-
}
|
|
96295
|
-
function getNumberValidator() {
|
|
96296
|
-
if (Global_1.Konva.isUnminified) {
|
|
96297
|
-
return function (val, attr) {
|
|
96298
|
-
if (!Util_1.Util._isNumber(val)) {
|
|
96299
|
-
Util_1.Util.warn(_formatValue(val) +
|
|
96300
|
-
' is a not valid value for "' +
|
|
96301
|
-
attr +
|
|
96302
|
-
'" attribute. The value should be a number.');
|
|
96303
|
-
}
|
|
96304
|
-
return val;
|
|
96305
|
-
};
|
|
96306
|
-
}
|
|
96307
|
-
}
|
|
96308
|
-
function getNumberOrArrayOfNumbersValidator(noOfElements) {
|
|
96309
|
-
if (Global_1.Konva.isUnminified) {
|
|
96310
|
-
return function (val, attr) {
|
|
96311
|
-
let isNumber = Util_1.Util._isNumber(val);
|
|
96312
|
-
let isValidArray = Util_1.Util._isArray(val) && val.length == noOfElements;
|
|
96313
|
-
if (!isNumber && !isValidArray) {
|
|
96314
|
-
Util_1.Util.warn(_formatValue(val) +
|
|
96315
|
-
' is a not valid value for "' +
|
|
96316
|
-
attr +
|
|
96317
|
-
'" attribute. The value should be a number or Array<number>(' +
|
|
96318
|
-
noOfElements +
|
|
96319
|
-
')');
|
|
96320
|
-
}
|
|
96321
|
-
return val;
|
|
96322
|
-
};
|
|
96323
|
-
}
|
|
96324
|
-
}
|
|
96325
|
-
function getNumberOrAutoValidator() {
|
|
96326
|
-
if (Global_1.Konva.isUnminified) {
|
|
96327
|
-
return function (val, attr) {
|
|
96328
|
-
var isNumber = Util_1.Util._isNumber(val);
|
|
96329
|
-
var isAuto = val === 'auto';
|
|
96330
|
-
if (!(isNumber || isAuto)) {
|
|
96331
|
-
Util_1.Util.warn(_formatValue(val) +
|
|
96332
|
-
' is a not valid value for "' +
|
|
96333
|
-
attr +
|
|
96334
|
-
'" attribute. The value should be a number or "auto".');
|
|
96335
|
-
}
|
|
96336
|
-
return val;
|
|
96337
|
-
};
|
|
96338
|
-
}
|
|
96339
|
-
}
|
|
96340
|
-
function getStringValidator() {
|
|
96341
|
-
if (Global_1.Konva.isUnminified) {
|
|
96342
|
-
return function (val, attr) {
|
|
96343
|
-
if (!Util_1.Util._isString(val)) {
|
|
96344
|
-
Util_1.Util.warn(_formatValue(val) +
|
|
96345
|
-
' is a not valid value for "' +
|
|
96346
|
-
attr +
|
|
96347
|
-
'" attribute. The value should be a string.');
|
|
96348
|
-
}
|
|
96349
|
-
return val;
|
|
96350
|
-
};
|
|
96351
|
-
}
|
|
96352
|
-
}
|
|
96353
|
-
function getStringOrGradientValidator() {
|
|
96354
|
-
if (Global_1.Konva.isUnminified) {
|
|
96355
|
-
return function (val, attr) {
|
|
96356
|
-
const isString = Util_1.Util._isString(val);
|
|
96357
|
-
const isGradient = Object.prototype.toString.call(val) === '[object CanvasGradient]' ||
|
|
96358
|
-
(val && val['addColorStop']);
|
|
96359
|
-
if (!(isString || isGradient)) {
|
|
96360
|
-
Util_1.Util.warn(_formatValue(val) +
|
|
96361
|
-
' is a not valid value for "' +
|
|
96362
|
-
attr +
|
|
96363
|
-
'" attribute. The value should be a string or a native gradient.');
|
|
96364
|
-
}
|
|
96365
|
-
return val;
|
|
96366
|
-
};
|
|
96367
|
-
}
|
|
96368
|
-
}
|
|
96369
|
-
function getFunctionValidator() {
|
|
96370
|
-
if (Global_1.Konva.isUnminified) {
|
|
96371
|
-
return function (val, attr) {
|
|
96372
|
-
if (!Util_1.Util._isFunction(val)) {
|
|
96373
|
-
Util_1.Util.warn(_formatValue(val) +
|
|
96374
|
-
' is a not valid value for "' +
|
|
96375
|
-
attr +
|
|
96376
|
-
'" attribute. The value should be a function.');
|
|
96377
|
-
}
|
|
96378
|
-
return val;
|
|
96379
|
-
};
|
|
96380
|
-
}
|
|
96381
|
-
}
|
|
96382
|
-
function getNumberArrayValidator() {
|
|
96383
|
-
if (Global_1.Konva.isUnminified) {
|
|
96384
|
-
return function (val, attr) {
|
|
96385
|
-
const TypedArray = Int8Array ? Object.getPrototypeOf(Int8Array) : null;
|
|
96386
|
-
if (TypedArray && val instanceof TypedArray) {
|
|
96387
|
-
return val;
|
|
96388
|
-
}
|
|
96389
|
-
if (!Util_1.Util._isArray(val)) {
|
|
96390
|
-
Util_1.Util.warn(_formatValue(val) +
|
|
96391
|
-
' is a not valid value for "' +
|
|
96392
|
-
attr +
|
|
96393
|
-
'" attribute. The value should be a array of numbers.');
|
|
96394
|
-
}
|
|
96395
|
-
else {
|
|
96396
|
-
val.forEach(function (item) {
|
|
96397
|
-
if (!Util_1.Util._isNumber(item)) {
|
|
96398
|
-
Util_1.Util.warn('"' +
|
|
96399
|
-
attr +
|
|
96400
|
-
'" attribute has non numeric element ' +
|
|
96401
|
-
item +
|
|
96402
|
-
'. Make sure that all elements are numbers.');
|
|
96403
|
-
}
|
|
96404
|
-
});
|
|
96405
|
-
}
|
|
96406
|
-
return val;
|
|
96407
|
-
};
|
|
96408
|
-
}
|
|
96409
|
-
}
|
|
96410
|
-
function getBooleanValidator() {
|
|
96411
|
-
if (Global_1.Konva.isUnminified) {
|
|
96412
|
-
return function (val, attr) {
|
|
96413
|
-
var isBool = val === true || val === false;
|
|
96414
|
-
if (!isBool) {
|
|
96415
|
-
Util_1.Util.warn(_formatValue(val) +
|
|
96416
|
-
' is a not valid value for "' +
|
|
96417
|
-
attr +
|
|
96418
|
-
'" attribute. The value should be a boolean.');
|
|
96419
|
-
}
|
|
96420
|
-
return val;
|
|
96421
|
-
};
|
|
96422
|
-
}
|
|
96423
|
-
}
|
|
96424
|
-
function getComponentValidator(components) {
|
|
96425
|
-
if (Global_1.Konva.isUnminified) {
|
|
96426
|
-
return function (val, attr) {
|
|
96427
|
-
if (val === undefined || val === null) {
|
|
96428
|
-
return val;
|
|
96429
|
-
}
|
|
96430
|
-
if (!Util_1.Util.isObject(val)) {
|
|
96431
|
-
Util_1.Util.warn(_formatValue(val) +
|
|
96432
|
-
' is a not valid value for "' +
|
|
96433
|
-
attr +
|
|
96434
|
-
'" attribute. The value should be an object with properties ' +
|
|
96435
|
-
components);
|
|
96436
|
-
}
|
|
96437
|
-
return val;
|
|
96438
|
-
};
|
|
96439
|
-
}
|
|
96440
|
-
}
|
|
96441
|
-
return Validators;
|
|
96442
|
-
}
|
|
96443
|
-
|
|
96444
|
-
var hasRequiredFactory;
|
|
96445
|
-
|
|
96446
|
-
function requireFactory () {
|
|
96447
|
-
if (hasRequiredFactory) return Factory;
|
|
96448
|
-
hasRequiredFactory = 1;
|
|
96449
|
-
(function (exports) {
|
|
96450
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
96451
|
-
exports.Factory = undefined;
|
|
96452
|
-
const Util_1 = requireUtil();
|
|
96453
|
-
const Validators_1 = requireValidators();
|
|
96454
|
-
const GET = 'get';
|
|
96455
|
-
const SET = 'set';
|
|
96456
|
-
exports.Factory = {
|
|
96457
|
-
addGetterSetter(constructor, attr, def, validator, after) {
|
|
96458
|
-
exports.Factory.addGetter(constructor, attr, def);
|
|
96459
|
-
exports.Factory.addSetter(constructor, attr, validator, after);
|
|
96460
|
-
exports.Factory.addOverloadedGetterSetter(constructor, attr);
|
|
96461
|
-
},
|
|
96462
|
-
addGetter(constructor, attr, def) {
|
|
96463
|
-
var method = GET + Util_1.Util._capitalize(attr);
|
|
96464
|
-
constructor.prototype[method] =
|
|
96465
|
-
constructor.prototype[method] ||
|
|
96466
|
-
function () {
|
|
96467
|
-
const val = this.attrs[attr];
|
|
96468
|
-
return val === undefined ? def : val;
|
|
96469
|
-
};
|
|
96470
|
-
},
|
|
96471
|
-
addSetter(constructor, attr, validator, after) {
|
|
96472
|
-
var method = SET + Util_1.Util._capitalize(attr);
|
|
96473
|
-
if (!constructor.prototype[method]) {
|
|
96474
|
-
exports.Factory.overWriteSetter(constructor, attr, validator, after);
|
|
96475
|
-
}
|
|
96476
|
-
},
|
|
96477
|
-
overWriteSetter(constructor, attr, validator, after) {
|
|
96478
|
-
var method = SET + Util_1.Util._capitalize(attr);
|
|
96479
|
-
constructor.prototype[method] = function (val) {
|
|
96480
|
-
if (validator && val !== undefined && val !== null) {
|
|
96481
|
-
val = validator.call(this, val, attr);
|
|
96482
|
-
}
|
|
96483
|
-
this._setAttr(attr, val);
|
|
96484
|
-
if (after) {
|
|
96485
|
-
after.call(this);
|
|
96486
|
-
}
|
|
96487
|
-
return this;
|
|
96488
|
-
};
|
|
96489
|
-
},
|
|
96490
|
-
addComponentsGetterSetter(constructor, attr, components, validator, after) {
|
|
96491
|
-
const len = components.length, capitalize = Util_1.Util._capitalize, getter = GET + capitalize(attr), setter = SET + capitalize(attr);
|
|
96492
|
-
constructor.prototype[getter] = function () {
|
|
96493
|
-
const ret = {};
|
|
96494
|
-
for (let n = 0; n < len; n++) {
|
|
96495
|
-
const component = components[n];
|
|
96496
|
-
ret[component] = this.getAttr(attr + capitalize(component));
|
|
96497
|
-
}
|
|
96498
|
-
return ret;
|
|
96499
|
-
};
|
|
96500
|
-
const basicValidator = (0, Validators_1.getComponentValidator)(components);
|
|
96501
|
-
constructor.prototype[setter] = function (val) {
|
|
96502
|
-
const oldVal = this.attrs[attr];
|
|
96503
|
-
if (validator) {
|
|
96504
|
-
val = validator.call(this, val, attr);
|
|
96505
|
-
}
|
|
96506
|
-
if (basicValidator) {
|
|
96507
|
-
basicValidator.call(this, val, attr);
|
|
96508
|
-
}
|
|
96509
|
-
for (const key in val) {
|
|
96510
|
-
if (!val.hasOwnProperty(key)) {
|
|
96511
|
-
continue;
|
|
96512
|
-
}
|
|
96513
|
-
this._setAttr(attr + capitalize(key), val[key]);
|
|
96514
|
-
}
|
|
96515
|
-
if (!val) {
|
|
96516
|
-
components.forEach((component) => {
|
|
96517
|
-
this._setAttr(attr + capitalize(component), undefined);
|
|
96518
|
-
});
|
|
96519
|
-
}
|
|
96520
|
-
this._fireChangeEvent(attr, oldVal, val);
|
|
96521
|
-
if (after) {
|
|
96522
|
-
after.call(this);
|
|
96523
|
-
}
|
|
96524
|
-
return this;
|
|
96525
|
-
};
|
|
96526
|
-
exports.Factory.addOverloadedGetterSetter(constructor, attr);
|
|
96527
|
-
},
|
|
96528
|
-
addOverloadedGetterSetter(constructor, attr) {
|
|
96529
|
-
var capitalizedAttr = Util_1.Util._capitalize(attr), setter = SET + capitalizedAttr, getter = GET + capitalizedAttr;
|
|
96530
|
-
constructor.prototype[attr] = function () {
|
|
96531
|
-
if (arguments.length) {
|
|
96532
|
-
this[setter](arguments[0]);
|
|
96533
|
-
return this;
|
|
96534
|
-
}
|
|
96535
|
-
return this[getter]();
|
|
96536
|
-
};
|
|
96537
|
-
},
|
|
96538
|
-
addDeprecatedGetterSetter(constructor, attr, def, validator) {
|
|
96539
|
-
Util_1.Util.error('Adding deprecated ' + attr);
|
|
96540
|
-
const method = GET + Util_1.Util._capitalize(attr);
|
|
96541
|
-
const message = attr +
|
|
96542
|
-
' property is deprecated and will be removed soon. Look at Konva change log for more information.';
|
|
96543
|
-
constructor.prototype[method] = function () {
|
|
96544
|
-
Util_1.Util.error(message);
|
|
96545
|
-
const val = this.attrs[attr];
|
|
96546
|
-
return val === undefined ? def : val;
|
|
96547
|
-
};
|
|
96548
|
-
exports.Factory.addSetter(constructor, attr, validator, function () {
|
|
96549
|
-
Util_1.Util.error(message);
|
|
96550
|
-
});
|
|
96551
|
-
exports.Factory.addOverloadedGetterSetter(constructor, attr);
|
|
96552
|
-
},
|
|
96553
|
-
backCompat(constructor, methods) {
|
|
96554
|
-
Util_1.Util.each(methods, function (oldMethodName, newMethodName) {
|
|
96555
|
-
const method = constructor.prototype[newMethodName];
|
|
96556
|
-
const oldGetter = GET + Util_1.Util._capitalize(oldMethodName);
|
|
96557
|
-
const oldSetter = SET + Util_1.Util._capitalize(oldMethodName);
|
|
96558
|
-
function deprecated() {
|
|
96559
|
-
method.apply(this, arguments);
|
|
96560
|
-
Util_1.Util.error('"' +
|
|
96561
|
-
oldMethodName +
|
|
96562
|
-
'" method is deprecated and will be removed soon. Use ""' +
|
|
96563
|
-
newMethodName +
|
|
96564
|
-
'" instead.');
|
|
96565
|
-
}
|
|
96566
|
-
constructor.prototype[oldMethodName] = deprecated;
|
|
96567
|
-
constructor.prototype[oldGetter] = deprecated;
|
|
96568
|
-
constructor.prototype[oldSetter] = deprecated;
|
|
96569
|
-
});
|
|
96570
|
-
},
|
|
96571
|
-
afterSetFilter() {
|
|
96572
|
-
this._filterUpToDate = false;
|
|
96573
|
-
},
|
|
96574
|
-
};
|
|
96575
|
-
} (Factory));
|
|
96576
|
-
return Factory;
|
|
96577
|
-
}
|
|
96578
|
-
|
|
96579
96564
|
var Canvas = {};
|
|
96580
96565
|
|
|
96581
96566
|
var Context = {};
|
|
@@ -96586,7 +96571,7 @@ void main() {
|
|
|
96586
96571
|
if (hasRequiredContext) return Context;
|
|
96587
96572
|
hasRequiredContext = 1;
|
|
96588
96573
|
Object.defineProperty(Context, "__esModule", { value: true });
|
|
96589
|
-
Context.HitContext = Context.SceneContext = Context.Context =
|
|
96574
|
+
Context.HitContext = Context.SceneContext = Context.Context = void 0;
|
|
96590
96575
|
const Util_1 = requireUtil();
|
|
96591
96576
|
const Global_1 = requireGlobal();
|
|
96592
96577
|
function simplifyArray(arr) {
|
|
@@ -97075,7 +97060,7 @@ void main() {
|
|
|
97075
97060
|
}
|
|
97076
97061
|
_applyShadow(shape) {
|
|
97077
97062
|
var _a, _b, _c;
|
|
97078
|
-
const color = (_a = shape.getShadowRGBA()) !== null && _a !==
|
|
97063
|
+
const color = (_a = shape.getShadowRGBA()) !== null && _a !== void 0 ? _a : 'black', blur = (_b = shape.getShadowBlur()) !== null && _b !== void 0 ? _b : 5, offset = (_c = shape.getShadowOffset()) !== null && _c !== void 0 ? _c : {
|
|
97079
97064
|
x: 0,
|
|
97080
97065
|
y: 0,
|
|
97081
97066
|
}, scale = shape.getAbsoluteScale(), ratio = this.canvas.getPixelRatio(), scaleX = scale.x * ratio, scaleY = scale.y * ratio;
|
|
@@ -97134,12 +97119,10 @@ void main() {
|
|
|
97134
97119
|
if (hasRequiredCanvas) return Canvas;
|
|
97135
97120
|
hasRequiredCanvas = 1;
|
|
97136
97121
|
Object.defineProperty(Canvas, "__esModule", { value: true });
|
|
97137
|
-
Canvas.HitCanvas = Canvas.SceneCanvas = Canvas.Canvas =
|
|
97122
|
+
Canvas.HitCanvas = Canvas.SceneCanvas = Canvas.Canvas = void 0;
|
|
97138
97123
|
const Util_1 = requireUtil();
|
|
97139
97124
|
const Context_1 = requireContext();
|
|
97140
97125
|
const Global_1 = requireGlobal();
|
|
97141
|
-
const Factory_1 = requireFactory();
|
|
97142
|
-
const Validators_1 = requireValidators();
|
|
97143
97126
|
let _pixelRatio;
|
|
97144
97127
|
function getDevicePixelRatio() {
|
|
97145
97128
|
if (_pixelRatio) {
|
|
@@ -97228,7 +97211,6 @@ void main() {
|
|
|
97228
97211
|
}
|
|
97229
97212
|
};
|
|
97230
97213
|
Canvas.Canvas = Canvas$1;
|
|
97231
|
-
Factory_1.Factory.addGetterSetter(Canvas$1, 'pixelRatio', undefined, (0, Validators_1.getNumberValidator)());
|
|
97232
97214
|
class SceneCanvas extends Canvas$1 {
|
|
97233
97215
|
constructor(config = { width: 0, height: 0, willReadFrequently: false }) {
|
|
97234
97216
|
super(config);
|
|
@@ -97260,7 +97242,7 @@ void main() {
|
|
|
97260
97242
|
hasRequiredDragAndDrop = 1;
|
|
97261
97243
|
(function (exports) {
|
|
97262
97244
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
97263
|
-
exports.DD =
|
|
97245
|
+
exports.DD = void 0;
|
|
97264
97246
|
const Global_1 = requireGlobal();
|
|
97265
97247
|
const Util_1 = requireUtil();
|
|
97266
97248
|
exports.DD = {
|
|
@@ -97375,20 +97357,357 @@ void main() {
|
|
|
97375
97357
|
return DragAndDrop;
|
|
97376
97358
|
}
|
|
97377
97359
|
|
|
97360
|
+
var Factory = {};
|
|
97361
|
+
|
|
97362
|
+
var Validators = {};
|
|
97363
|
+
|
|
97364
|
+
var hasRequiredValidators;
|
|
97365
|
+
|
|
97366
|
+
function requireValidators () {
|
|
97367
|
+
if (hasRequiredValidators) return Validators;
|
|
97368
|
+
hasRequiredValidators = 1;
|
|
97369
|
+
Object.defineProperty(Validators, "__esModule", { value: true });
|
|
97370
|
+
Validators.RGBComponent = RGBComponent;
|
|
97371
|
+
Validators.alphaComponent = alphaComponent;
|
|
97372
|
+
Validators.getNumberValidator = getNumberValidator;
|
|
97373
|
+
Validators.getNumberOrArrayOfNumbersValidator = getNumberOrArrayOfNumbersValidator;
|
|
97374
|
+
Validators.getNumberOrAutoValidator = getNumberOrAutoValidator;
|
|
97375
|
+
Validators.getStringValidator = getStringValidator;
|
|
97376
|
+
Validators.getStringOrGradientValidator = getStringOrGradientValidator;
|
|
97377
|
+
Validators.getFunctionValidator = getFunctionValidator;
|
|
97378
|
+
Validators.getNumberArrayValidator = getNumberArrayValidator;
|
|
97379
|
+
Validators.getBooleanValidator = getBooleanValidator;
|
|
97380
|
+
Validators.getComponentValidator = getComponentValidator;
|
|
97381
|
+
const Global_1 = requireGlobal();
|
|
97382
|
+
const Util_1 = requireUtil();
|
|
97383
|
+
function _formatValue(val) {
|
|
97384
|
+
if (Util_1.Util._isString(val)) {
|
|
97385
|
+
return '"' + val + '"';
|
|
97386
|
+
}
|
|
97387
|
+
if (Object.prototype.toString.call(val) === '[object Number]') {
|
|
97388
|
+
return val;
|
|
97389
|
+
}
|
|
97390
|
+
if (Util_1.Util._isBoolean(val)) {
|
|
97391
|
+
return val;
|
|
97392
|
+
}
|
|
97393
|
+
return Object.prototype.toString.call(val);
|
|
97394
|
+
}
|
|
97395
|
+
function RGBComponent(val) {
|
|
97396
|
+
if (val > 255) {
|
|
97397
|
+
return 255;
|
|
97398
|
+
}
|
|
97399
|
+
else if (val < 0) {
|
|
97400
|
+
return 0;
|
|
97401
|
+
}
|
|
97402
|
+
return Math.round(val);
|
|
97403
|
+
}
|
|
97404
|
+
function alphaComponent(val) {
|
|
97405
|
+
if (val > 1) {
|
|
97406
|
+
return 1;
|
|
97407
|
+
}
|
|
97408
|
+
else if (val < 0.0001) {
|
|
97409
|
+
return 0.0001;
|
|
97410
|
+
}
|
|
97411
|
+
return val;
|
|
97412
|
+
}
|
|
97413
|
+
function getNumberValidator() {
|
|
97414
|
+
if (Global_1.Konva.isUnminified) {
|
|
97415
|
+
return function (val, attr) {
|
|
97416
|
+
if (!Util_1.Util._isNumber(val)) {
|
|
97417
|
+
Util_1.Util.warn(_formatValue(val) +
|
|
97418
|
+
' is a not valid value for "' +
|
|
97419
|
+
attr +
|
|
97420
|
+
'" attribute. The value should be a number.');
|
|
97421
|
+
}
|
|
97422
|
+
return val;
|
|
97423
|
+
};
|
|
97424
|
+
}
|
|
97425
|
+
}
|
|
97426
|
+
function getNumberOrArrayOfNumbersValidator(noOfElements) {
|
|
97427
|
+
if (Global_1.Konva.isUnminified) {
|
|
97428
|
+
return function (val, attr) {
|
|
97429
|
+
let isNumber = Util_1.Util._isNumber(val);
|
|
97430
|
+
let isValidArray = Util_1.Util._isArray(val) && val.length == noOfElements;
|
|
97431
|
+
if (!isNumber && !isValidArray) {
|
|
97432
|
+
Util_1.Util.warn(_formatValue(val) +
|
|
97433
|
+
' is a not valid value for "' +
|
|
97434
|
+
attr +
|
|
97435
|
+
'" attribute. The value should be a number or Array<number>(' +
|
|
97436
|
+
noOfElements +
|
|
97437
|
+
')');
|
|
97438
|
+
}
|
|
97439
|
+
return val;
|
|
97440
|
+
};
|
|
97441
|
+
}
|
|
97442
|
+
}
|
|
97443
|
+
function getNumberOrAutoValidator() {
|
|
97444
|
+
if (Global_1.Konva.isUnminified) {
|
|
97445
|
+
return function (val, attr) {
|
|
97446
|
+
const isNumber = Util_1.Util._isNumber(val);
|
|
97447
|
+
const isAuto = val === 'auto';
|
|
97448
|
+
if (!(isNumber || isAuto)) {
|
|
97449
|
+
Util_1.Util.warn(_formatValue(val) +
|
|
97450
|
+
' is a not valid value for "' +
|
|
97451
|
+
attr +
|
|
97452
|
+
'" attribute. The value should be a number or "auto".');
|
|
97453
|
+
}
|
|
97454
|
+
return val;
|
|
97455
|
+
};
|
|
97456
|
+
}
|
|
97457
|
+
}
|
|
97458
|
+
function getStringValidator() {
|
|
97459
|
+
if (Global_1.Konva.isUnminified) {
|
|
97460
|
+
return function (val, attr) {
|
|
97461
|
+
if (!Util_1.Util._isString(val)) {
|
|
97462
|
+
Util_1.Util.warn(_formatValue(val) +
|
|
97463
|
+
' is a not valid value for "' +
|
|
97464
|
+
attr +
|
|
97465
|
+
'" attribute. The value should be a string.');
|
|
97466
|
+
}
|
|
97467
|
+
return val;
|
|
97468
|
+
};
|
|
97469
|
+
}
|
|
97470
|
+
}
|
|
97471
|
+
function getStringOrGradientValidator() {
|
|
97472
|
+
if (Global_1.Konva.isUnminified) {
|
|
97473
|
+
return function (val, attr) {
|
|
97474
|
+
const isString = Util_1.Util._isString(val);
|
|
97475
|
+
const isGradient = Object.prototype.toString.call(val) === '[object CanvasGradient]' ||
|
|
97476
|
+
(val && val['addColorStop']);
|
|
97477
|
+
if (!(isString || isGradient)) {
|
|
97478
|
+
Util_1.Util.warn(_formatValue(val) +
|
|
97479
|
+
' is a not valid value for "' +
|
|
97480
|
+
attr +
|
|
97481
|
+
'" attribute. The value should be a string or a native gradient.');
|
|
97482
|
+
}
|
|
97483
|
+
return val;
|
|
97484
|
+
};
|
|
97485
|
+
}
|
|
97486
|
+
}
|
|
97487
|
+
function getFunctionValidator() {
|
|
97488
|
+
if (Global_1.Konva.isUnminified) {
|
|
97489
|
+
return function (val, attr) {
|
|
97490
|
+
if (!Util_1.Util._isFunction(val)) {
|
|
97491
|
+
Util_1.Util.warn(_formatValue(val) +
|
|
97492
|
+
' is a not valid value for "' +
|
|
97493
|
+
attr +
|
|
97494
|
+
'" attribute. The value should be a function.');
|
|
97495
|
+
}
|
|
97496
|
+
return val;
|
|
97497
|
+
};
|
|
97498
|
+
}
|
|
97499
|
+
}
|
|
97500
|
+
function getNumberArrayValidator() {
|
|
97501
|
+
if (Global_1.Konva.isUnminified) {
|
|
97502
|
+
return function (val, attr) {
|
|
97503
|
+
const TypedArray = Int8Array ? Object.getPrototypeOf(Int8Array) : null;
|
|
97504
|
+
if (TypedArray && val instanceof TypedArray) {
|
|
97505
|
+
return val;
|
|
97506
|
+
}
|
|
97507
|
+
if (!Util_1.Util._isArray(val)) {
|
|
97508
|
+
Util_1.Util.warn(_formatValue(val) +
|
|
97509
|
+
' is a not valid value for "' +
|
|
97510
|
+
attr +
|
|
97511
|
+
'" attribute. The value should be a array of numbers.');
|
|
97512
|
+
}
|
|
97513
|
+
else {
|
|
97514
|
+
val.forEach(function (item) {
|
|
97515
|
+
if (!Util_1.Util._isNumber(item)) {
|
|
97516
|
+
Util_1.Util.warn('"' +
|
|
97517
|
+
attr +
|
|
97518
|
+
'" attribute has non numeric element ' +
|
|
97519
|
+
item +
|
|
97520
|
+
'. Make sure that all elements are numbers.');
|
|
97521
|
+
}
|
|
97522
|
+
});
|
|
97523
|
+
}
|
|
97524
|
+
return val;
|
|
97525
|
+
};
|
|
97526
|
+
}
|
|
97527
|
+
}
|
|
97528
|
+
function getBooleanValidator() {
|
|
97529
|
+
if (Global_1.Konva.isUnminified) {
|
|
97530
|
+
return function (val, attr) {
|
|
97531
|
+
const isBool = val === true || val === false;
|
|
97532
|
+
if (!isBool) {
|
|
97533
|
+
Util_1.Util.warn(_formatValue(val) +
|
|
97534
|
+
' is a not valid value for "' +
|
|
97535
|
+
attr +
|
|
97536
|
+
'" attribute. The value should be a boolean.');
|
|
97537
|
+
}
|
|
97538
|
+
return val;
|
|
97539
|
+
};
|
|
97540
|
+
}
|
|
97541
|
+
}
|
|
97542
|
+
function getComponentValidator(components) {
|
|
97543
|
+
if (Global_1.Konva.isUnminified) {
|
|
97544
|
+
return function (val, attr) {
|
|
97545
|
+
if (val === undefined || val === null) {
|
|
97546
|
+
return val;
|
|
97547
|
+
}
|
|
97548
|
+
if (!Util_1.Util.isObject(val)) {
|
|
97549
|
+
Util_1.Util.warn(_formatValue(val) +
|
|
97550
|
+
' is a not valid value for "' +
|
|
97551
|
+
attr +
|
|
97552
|
+
'" attribute. The value should be an object with properties ' +
|
|
97553
|
+
components);
|
|
97554
|
+
}
|
|
97555
|
+
return val;
|
|
97556
|
+
};
|
|
97557
|
+
}
|
|
97558
|
+
}
|
|
97559
|
+
return Validators;
|
|
97560
|
+
}
|
|
97561
|
+
|
|
97562
|
+
var hasRequiredFactory;
|
|
97563
|
+
|
|
97564
|
+
function requireFactory () {
|
|
97565
|
+
if (hasRequiredFactory) return Factory;
|
|
97566
|
+
hasRequiredFactory = 1;
|
|
97567
|
+
(function (exports) {
|
|
97568
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
97569
|
+
exports.Factory = void 0;
|
|
97570
|
+
const Util_1 = requireUtil();
|
|
97571
|
+
const Validators_1 = requireValidators();
|
|
97572
|
+
const GET = 'get';
|
|
97573
|
+
const SET = 'set';
|
|
97574
|
+
exports.Factory = {
|
|
97575
|
+
addGetterSetter(constructor, attr, def, validator, after) {
|
|
97576
|
+
exports.Factory.addGetter(constructor, attr, def);
|
|
97577
|
+
exports.Factory.addSetter(constructor, attr, validator, after);
|
|
97578
|
+
exports.Factory.addOverloadedGetterSetter(constructor, attr);
|
|
97579
|
+
},
|
|
97580
|
+
addGetter(constructor, attr, def) {
|
|
97581
|
+
const method = GET + Util_1.Util._capitalize(attr);
|
|
97582
|
+
constructor.prototype[method] =
|
|
97583
|
+
constructor.prototype[method] ||
|
|
97584
|
+
function () {
|
|
97585
|
+
const val = this.attrs[attr];
|
|
97586
|
+
return val === undefined ? def : val;
|
|
97587
|
+
};
|
|
97588
|
+
},
|
|
97589
|
+
addSetter(constructor, attr, validator, after) {
|
|
97590
|
+
const method = SET + Util_1.Util._capitalize(attr);
|
|
97591
|
+
if (!constructor.prototype[method]) {
|
|
97592
|
+
exports.Factory.overWriteSetter(constructor, attr, validator, after);
|
|
97593
|
+
}
|
|
97594
|
+
},
|
|
97595
|
+
overWriteSetter(constructor, attr, validator, after) {
|
|
97596
|
+
const method = SET + Util_1.Util._capitalize(attr);
|
|
97597
|
+
constructor.prototype[method] = function (val) {
|
|
97598
|
+
if (validator && val !== undefined && val !== null) {
|
|
97599
|
+
val = validator.call(this, val, attr);
|
|
97600
|
+
}
|
|
97601
|
+
this._setAttr(attr, val);
|
|
97602
|
+
if (after) {
|
|
97603
|
+
after.call(this);
|
|
97604
|
+
}
|
|
97605
|
+
return this;
|
|
97606
|
+
};
|
|
97607
|
+
},
|
|
97608
|
+
addComponentsGetterSetter(constructor, attr, components, validator, after) {
|
|
97609
|
+
const len = components.length, capitalize = Util_1.Util._capitalize, getter = GET + capitalize(attr), setter = SET + capitalize(attr);
|
|
97610
|
+
constructor.prototype[getter] = function () {
|
|
97611
|
+
const ret = {};
|
|
97612
|
+
for (let n = 0; n < len; n++) {
|
|
97613
|
+
const component = components[n];
|
|
97614
|
+
ret[component] = this.getAttr(attr + capitalize(component));
|
|
97615
|
+
}
|
|
97616
|
+
return ret;
|
|
97617
|
+
};
|
|
97618
|
+
const basicValidator = (0, Validators_1.getComponentValidator)(components);
|
|
97619
|
+
constructor.prototype[setter] = function (val) {
|
|
97620
|
+
const oldVal = this.attrs[attr];
|
|
97621
|
+
if (validator) {
|
|
97622
|
+
val = validator.call(this, val, attr);
|
|
97623
|
+
}
|
|
97624
|
+
if (basicValidator) {
|
|
97625
|
+
basicValidator.call(this, val, attr);
|
|
97626
|
+
}
|
|
97627
|
+
for (const key in val) {
|
|
97628
|
+
if (!val.hasOwnProperty(key)) {
|
|
97629
|
+
continue;
|
|
97630
|
+
}
|
|
97631
|
+
this._setAttr(attr + capitalize(key), val[key]);
|
|
97632
|
+
}
|
|
97633
|
+
if (!val) {
|
|
97634
|
+
components.forEach((component) => {
|
|
97635
|
+
this._setAttr(attr + capitalize(component), undefined);
|
|
97636
|
+
});
|
|
97637
|
+
}
|
|
97638
|
+
this._fireChangeEvent(attr, oldVal, val);
|
|
97639
|
+
if (after) {
|
|
97640
|
+
after.call(this);
|
|
97641
|
+
}
|
|
97642
|
+
return this;
|
|
97643
|
+
};
|
|
97644
|
+
exports.Factory.addOverloadedGetterSetter(constructor, attr);
|
|
97645
|
+
},
|
|
97646
|
+
addOverloadedGetterSetter(constructor, attr) {
|
|
97647
|
+
const capitalizedAttr = Util_1.Util._capitalize(attr), setter = SET + capitalizedAttr, getter = GET + capitalizedAttr;
|
|
97648
|
+
constructor.prototype[attr] = function () {
|
|
97649
|
+
if (arguments.length) {
|
|
97650
|
+
this[setter](arguments[0]);
|
|
97651
|
+
return this;
|
|
97652
|
+
}
|
|
97653
|
+
return this[getter]();
|
|
97654
|
+
};
|
|
97655
|
+
},
|
|
97656
|
+
addDeprecatedGetterSetter(constructor, attr, def, validator) {
|
|
97657
|
+
Util_1.Util.error('Adding deprecated ' + attr);
|
|
97658
|
+
const method = GET + Util_1.Util._capitalize(attr);
|
|
97659
|
+
const message = attr +
|
|
97660
|
+
' property is deprecated and will be removed soon. Look at Konva change log for more information.';
|
|
97661
|
+
constructor.prototype[method] = function () {
|
|
97662
|
+
Util_1.Util.error(message);
|
|
97663
|
+
const val = this.attrs[attr];
|
|
97664
|
+
return val === undefined ? def : val;
|
|
97665
|
+
};
|
|
97666
|
+
exports.Factory.addSetter(constructor, attr, validator, function () {
|
|
97667
|
+
Util_1.Util.error(message);
|
|
97668
|
+
});
|
|
97669
|
+
exports.Factory.addOverloadedGetterSetter(constructor, attr);
|
|
97670
|
+
},
|
|
97671
|
+
backCompat(constructor, methods) {
|
|
97672
|
+
Util_1.Util.each(methods, function (oldMethodName, newMethodName) {
|
|
97673
|
+
const method = constructor.prototype[newMethodName];
|
|
97674
|
+
const oldGetter = GET + Util_1.Util._capitalize(oldMethodName);
|
|
97675
|
+
const oldSetter = SET + Util_1.Util._capitalize(oldMethodName);
|
|
97676
|
+
function deprecated() {
|
|
97677
|
+
method.apply(this, arguments);
|
|
97678
|
+
Util_1.Util.error('"' +
|
|
97679
|
+
oldMethodName +
|
|
97680
|
+
'" method is deprecated and will be removed soon. Use ""' +
|
|
97681
|
+
newMethodName +
|
|
97682
|
+
'" instead.');
|
|
97683
|
+
}
|
|
97684
|
+
constructor.prototype[oldMethodName] = deprecated;
|
|
97685
|
+
constructor.prototype[oldGetter] = deprecated;
|
|
97686
|
+
constructor.prototype[oldSetter] = deprecated;
|
|
97687
|
+
});
|
|
97688
|
+
},
|
|
97689
|
+
afterSetFilter() {
|
|
97690
|
+
this._filterUpToDate = false;
|
|
97691
|
+
},
|
|
97692
|
+
};
|
|
97693
|
+
} (Factory));
|
|
97694
|
+
return Factory;
|
|
97695
|
+
}
|
|
97696
|
+
|
|
97378
97697
|
var hasRequiredNode;
|
|
97379
97698
|
|
|
97380
97699
|
function requireNode () {
|
|
97381
97700
|
if (hasRequiredNode) return Node;
|
|
97382
97701
|
hasRequiredNode = 1;
|
|
97383
97702
|
Object.defineProperty(Node, "__esModule", { value: true });
|
|
97384
|
-
Node.Node =
|
|
97385
|
-
const Util_1 = requireUtil();
|
|
97386
|
-
const Factory_1 = requireFactory();
|
|
97703
|
+
Node.Node = void 0;
|
|
97387
97704
|
const Canvas_1 = requireCanvas();
|
|
97388
|
-
const Global_1 = requireGlobal();
|
|
97389
97705
|
const DragAndDrop_1 = requireDragAndDrop();
|
|
97706
|
+
const Factory_1 = requireFactory();
|
|
97707
|
+
const Global_1 = requireGlobal();
|
|
97708
|
+
const Util_1 = requireUtil();
|
|
97390
97709
|
const Validators_1 = requireValidators();
|
|
97391
|
-
const ABSOLUTE_OPACITY = 'absoluteOpacity', ALL_LISTENERS = 'allEventListeners', ABSOLUTE_TRANSFORM = 'absoluteTransform', ABSOLUTE_SCALE = 'absoluteScale', CANVAS = 'canvas', CHANGE = 'Change', CHILDREN = 'children', KONVA = 'konva', LISTENING = 'listening', MOUSEENTER = 'mouseenter', MOUSELEAVE = 'mouseleave', SET = 'set', SHAPE = 'Shape', SPACE = ' ', STAGE = 'stage', TRANSFORM = 'transform', UPPER_STAGE = 'Stage', VISIBLE = 'visible', TRANSFORM_CHANGE_STR = [
|
|
97710
|
+
const ABSOLUTE_OPACITY = 'absoluteOpacity', ALL_LISTENERS = 'allEventListeners', ABSOLUTE_TRANSFORM = 'absoluteTransform', ABSOLUTE_SCALE = 'absoluteScale', CANVAS = 'canvas', CHANGE = 'Change', CHILDREN = 'children', KONVA = 'konva', LISTENING = 'listening', MOUSEENTER = 'mouseenter', MOUSELEAVE = 'mouseleave', POINTERENTER = 'pointerenter', POINTERLEAVE = 'pointerleave', TOUCHENTER = 'touchenter', TOUCHLEAVE = 'touchleave', SET = 'set', SHAPE = 'Shape', SPACE = ' ', STAGE = 'stage', TRANSFORM = 'transform', UPPER_STAGE = 'Stage', VISIBLE = 'visible', TRANSFORM_CHANGE_STR = [
|
|
97392
97711
|
'xChange.konva',
|
|
97393
97712
|
'yChange.konva',
|
|
97394
97713
|
'scaleXChange.konva',
|
|
@@ -97467,8 +97786,8 @@ void main() {
|
|
|
97467
97786
|
}
|
|
97468
97787
|
clearCache() {
|
|
97469
97788
|
if (this._cache.has(CANVAS)) {
|
|
97470
|
-
const { scene, filter, hit } = this._cache.get(CANVAS);
|
|
97471
|
-
Util_1.Util.releaseCanvas(scene, filter, hit);
|
|
97789
|
+
const { scene, filter, hit, buffer } = this._cache.get(CANVAS);
|
|
97790
|
+
Util_1.Util.releaseCanvas(scene, filter, hit, buffer);
|
|
97472
97791
|
this._cache.delete(CANVAS);
|
|
97473
97792
|
}
|
|
97474
97793
|
this._clearSelfAndDescendantCache();
|
|
@@ -97512,6 +97831,11 @@ void main() {
|
|
|
97512
97831
|
width: width,
|
|
97513
97832
|
height: height,
|
|
97514
97833
|
}), sceneContext = cachedSceneCanvas.getContext(), hitContext = cachedHitCanvas.getContext();
|
|
97834
|
+
const bufferCanvas = new Canvas_1.SceneCanvas({
|
|
97835
|
+
width: cachedSceneCanvas.width / cachedSceneCanvas.pixelRatio + Math.abs(x),
|
|
97836
|
+
height: cachedSceneCanvas.height / cachedSceneCanvas.pixelRatio + Math.abs(y),
|
|
97837
|
+
pixelRatio: cachedSceneCanvas.pixelRatio,
|
|
97838
|
+
}), bufferContext = bufferCanvas.getContext();
|
|
97515
97839
|
cachedHitCanvas.isCache = true;
|
|
97516
97840
|
cachedSceneCanvas.isCache = true;
|
|
97517
97841
|
this._cache.delete(CANVAS);
|
|
@@ -97522,12 +97846,16 @@ void main() {
|
|
|
97522
97846
|
}
|
|
97523
97847
|
sceneContext.save();
|
|
97524
97848
|
hitContext.save();
|
|
97849
|
+
bufferContext.save();
|
|
97525
97850
|
sceneContext.translate(-x, -y);
|
|
97526
97851
|
hitContext.translate(-x, -y);
|
|
97852
|
+
bufferContext.translate(-x, -y);
|
|
97853
|
+
bufferCanvas.x = x;
|
|
97854
|
+
bufferCanvas.y = y;
|
|
97527
97855
|
this._isUnderCache = true;
|
|
97528
97856
|
this._clearSelfAndDescendantCache(ABSOLUTE_OPACITY);
|
|
97529
97857
|
this._clearSelfAndDescendantCache(ABSOLUTE_SCALE);
|
|
97530
|
-
this.drawScene(cachedSceneCanvas, this);
|
|
97858
|
+
this.drawScene(cachedSceneCanvas, this, bufferCanvas);
|
|
97531
97859
|
this.drawHit(cachedHitCanvas, this);
|
|
97532
97860
|
this._isUnderCache = false;
|
|
97533
97861
|
sceneContext.restore();
|
|
@@ -97546,6 +97874,7 @@ void main() {
|
|
|
97546
97874
|
scene: cachedSceneCanvas,
|
|
97547
97875
|
filter: cachedFilterCanvas,
|
|
97548
97876
|
hit: cachedHitCanvas,
|
|
97877
|
+
buffer: bufferCanvas,
|
|
97549
97878
|
x: x,
|
|
97550
97879
|
y: y,
|
|
97551
97880
|
});
|
|
@@ -97638,23 +97967,22 @@ void main() {
|
|
|
97638
97967
|
return sceneCanvas;
|
|
97639
97968
|
}
|
|
97640
97969
|
on(evtStr, handler) {
|
|
97641
|
-
|
|
97970
|
+
if (this._cache) {
|
|
97971
|
+
this._cache.delete(ALL_LISTENERS);
|
|
97972
|
+
}
|
|
97642
97973
|
if (arguments.length === 3) {
|
|
97643
97974
|
return this._delegate.apply(this, arguments);
|
|
97644
97975
|
}
|
|
97645
|
-
|
|
97646
|
-
for (n = 0; n <
|
|
97647
|
-
event = events[n];
|
|
97648
|
-
parts = event.split('.');
|
|
97649
|
-
baseEvent = parts[0];
|
|
97650
|
-
name = parts[1] || '';
|
|
97976
|
+
const events = evtStr.split(SPACE);
|
|
97977
|
+
for (let n = 0; n < events.length; n++) {
|
|
97978
|
+
const event = events[n];
|
|
97979
|
+
const parts = event.split('.');
|
|
97980
|
+
const baseEvent = parts[0];
|
|
97981
|
+
const name = parts[1] || '';
|
|
97651
97982
|
if (!this.eventListeners[baseEvent]) {
|
|
97652
97983
|
this.eventListeners[baseEvent] = [];
|
|
97653
97984
|
}
|
|
97654
|
-
this.eventListeners[baseEvent].push({
|
|
97655
|
-
name: name,
|
|
97656
|
-
handler: handler,
|
|
97657
|
-
});
|
|
97985
|
+
this.eventListeners[baseEvent].push({ name, handler });
|
|
97658
97986
|
}
|
|
97659
97987
|
return this;
|
|
97660
97988
|
}
|
|
@@ -98286,7 +98614,7 @@ void main() {
|
|
|
98286
98614
|
var _a, _b;
|
|
98287
98615
|
const m = this._cache.get(TRANSFORM) || new Util_1.Transform();
|
|
98288
98616
|
m.reset();
|
|
98289
|
-
const x = this.x(), y = this.y(), rotation = Global_1.Konva.getAngle(this.rotation()), scaleX = (_a = this.attrs.scaleX) !== null && _a !==
|
|
98617
|
+
const x = this.x(), y = this.y(), rotation = Global_1.Konva.getAngle(this.rotation()), scaleX = (_a = this.attrs.scaleX) !== null && _a !== void 0 ? _a : 1, scaleY = (_b = this.attrs.scaleY) !== null && _b !== void 0 ? _b : 1, skewX = this.attrs.skewX || 0, skewY = this.attrs.skewY || 0, offsetX = this.attrs.offsetX || 0, offsetY = this.attrs.offsetY || 0;
|
|
98290
98618
|
if (x !== 0 || y !== 0) {
|
|
98291
98619
|
m.translate(x, y);
|
|
98292
98620
|
}
|
|
@@ -98488,7 +98816,7 @@ void main() {
|
|
|
98488
98816
|
_requestDraw() {
|
|
98489
98817
|
if (Global_1.Konva.autoDrawEnabled) {
|
|
98490
98818
|
const drawNode = this.getLayer() || this.getStage();
|
|
98491
|
-
drawNode === null || drawNode ===
|
|
98819
|
+
drawNode === null || drawNode === void 0 ? void 0 : drawNode.batchDraw();
|
|
98492
98820
|
}
|
|
98493
98821
|
}
|
|
98494
98822
|
_setAttr(key, val) {
|
|
@@ -98522,14 +98850,22 @@ void main() {
|
|
|
98522
98850
|
if (evt && this.nodeType === SHAPE) {
|
|
98523
98851
|
evt.target = this;
|
|
98524
98852
|
}
|
|
98525
|
-
const
|
|
98853
|
+
const nonBubbling = [
|
|
98854
|
+
MOUSEENTER,
|
|
98855
|
+
MOUSELEAVE,
|
|
98856
|
+
POINTERENTER,
|
|
98857
|
+
POINTERLEAVE,
|
|
98858
|
+
TOUCHENTER,
|
|
98859
|
+
TOUCHLEAVE,
|
|
98860
|
+
];
|
|
98861
|
+
const shouldStop = nonBubbling.indexOf(eventType) !== -1 &&
|
|
98526
98862
|
((compareShape &&
|
|
98527
98863
|
(this === compareShape ||
|
|
98528
98864
|
(this.isAncestorOf && this.isAncestorOf(compareShape)))) ||
|
|
98529
98865
|
(this.nodeType === 'Stage' && !compareShape));
|
|
98530
98866
|
if (!shouldStop) {
|
|
98531
98867
|
this._fire(eventType, evt);
|
|
98532
|
-
const stopBubble = (eventType
|
|
98868
|
+
const stopBubble = nonBubbling.indexOf(eventType) !== -1 &&
|
|
98533
98869
|
compareShape &&
|
|
98534
98870
|
compareShape.isAncestorOf &&
|
|
98535
98871
|
compareShape.isAncestorOf(this) &&
|
|
@@ -98549,13 +98885,13 @@ void main() {
|
|
|
98549
98885
|
}
|
|
98550
98886
|
_getProtoListeners(eventType) {
|
|
98551
98887
|
var _a, _b, _c;
|
|
98552
|
-
const allListeners = (_a = this._cache.get(ALL_LISTENERS)) !== null && _a !==
|
|
98553
|
-
let events = allListeners === null || allListeners ===
|
|
98888
|
+
const allListeners = (_a = this._cache.get(ALL_LISTENERS)) !== null && _a !== void 0 ? _a : {};
|
|
98889
|
+
let events = allListeners === null || allListeners === void 0 ? void 0 : allListeners[eventType];
|
|
98554
98890
|
if (events === undefined) {
|
|
98555
98891
|
events = [];
|
|
98556
98892
|
let obj = Object.getPrototypeOf(this);
|
|
98557
98893
|
while (obj) {
|
|
98558
|
-
const hierarchyEvents = (_c = (_b = obj.eventListeners) === null || _b ===
|
|
98894
|
+
const hierarchyEvents = (_c = (_b = obj.eventListeners) === null || _b === void 0 ? void 0 : _b[eventType]) !== null && _c !== void 0 ? _c : [];
|
|
98559
98895
|
events.push(...hierarchyEvents);
|
|
98560
98896
|
obj = Object.getPrototypeOf(obj);
|
|
98561
98897
|
}
|
|
@@ -98570,13 +98906,13 @@ void main() {
|
|
|
98570
98906
|
evt.type = eventType;
|
|
98571
98907
|
const topListeners = this._getProtoListeners(eventType);
|
|
98572
98908
|
if (topListeners) {
|
|
98573
|
-
for (
|
|
98909
|
+
for (let i = 0; i < topListeners.length; i++) {
|
|
98574
98910
|
topListeners[i].handler.call(this, evt);
|
|
98575
98911
|
}
|
|
98576
98912
|
}
|
|
98577
98913
|
const selfListeners = this.eventListeners[eventType];
|
|
98578
98914
|
if (selfListeners) {
|
|
98579
|
-
for (
|
|
98915
|
+
for (let i = 0; i < selfListeners.length; i++) {
|
|
98580
98916
|
selfListeners[i].handler.call(this, evt);
|
|
98581
98917
|
}
|
|
98582
98918
|
}
|
|
@@ -98821,7 +99157,7 @@ void main() {
|
|
|
98821
99157
|
if (hasRequiredContainer) return Container;
|
|
98822
99158
|
hasRequiredContainer = 1;
|
|
98823
99159
|
Object.defineProperty(Container, "__esModule", { value: true });
|
|
98824
|
-
Container.Container =
|
|
99160
|
+
Container.Container = void 0;
|
|
98825
99161
|
const Factory_1 = requireFactory();
|
|
98826
99162
|
const Node_1 = requireNode();
|
|
98827
99163
|
const Validators_1 = requireValidators();
|
|
@@ -98831,17 +99167,11 @@ void main() {
|
|
|
98831
99167
|
this.children = [];
|
|
98832
99168
|
}
|
|
98833
99169
|
getChildren(filterFunc) {
|
|
98834
|
-
if (!filterFunc) {
|
|
98835
|
-
return this.children || [];
|
|
98836
|
-
}
|
|
98837
99170
|
const children = this.children || [];
|
|
98838
|
-
|
|
98839
|
-
|
|
98840
|
-
|
|
98841
|
-
|
|
98842
|
-
}
|
|
98843
|
-
});
|
|
98844
|
-
return results;
|
|
99171
|
+
if (filterFunc) {
|
|
99172
|
+
return children.filter(filterFunc);
|
|
99173
|
+
}
|
|
99174
|
+
return children;
|
|
98845
99175
|
}
|
|
98846
99176
|
hasChildren() {
|
|
98847
99177
|
return this.getChildren().length > 0;
|
|
@@ -98978,13 +99308,13 @@ void main() {
|
|
|
98978
99308
|
if (this.isCached()) {
|
|
98979
99309
|
return;
|
|
98980
99310
|
}
|
|
98981
|
-
(_a = this.children) === null || _a ===
|
|
99311
|
+
(_a = this.children) === null || _a === void 0 ? void 0 : _a.forEach(function (node) {
|
|
98982
99312
|
node._clearSelfAndDescendantCache(attr);
|
|
98983
99313
|
});
|
|
98984
99314
|
}
|
|
98985
99315
|
_setChildrenIndices() {
|
|
98986
99316
|
var _a;
|
|
98987
|
-
(_a = this.children) === null || _a ===
|
|
99317
|
+
(_a = this.children) === null || _a === void 0 ? void 0 : _a.forEach(function (child, n) {
|
|
98988
99318
|
child.index = n;
|
|
98989
99319
|
});
|
|
98990
99320
|
this._requestDraw();
|
|
@@ -99055,7 +99385,7 @@ void main() {
|
|
|
99055
99385
|
context.save();
|
|
99056
99386
|
context._applyGlobalCompositeOperation(this);
|
|
99057
99387
|
}
|
|
99058
|
-
(_a = this.children) === null || _a ===
|
|
99388
|
+
(_a = this.children) === null || _a === void 0 ? void 0 : _a.forEach(function (child) {
|
|
99059
99389
|
child[drawMethod](canvas, top, bufferCanvas);
|
|
99060
99390
|
});
|
|
99061
99391
|
if (hasComposition) {
|
|
@@ -99077,7 +99407,7 @@ void main() {
|
|
|
99077
99407
|
height: 0,
|
|
99078
99408
|
};
|
|
99079
99409
|
const that = this;
|
|
99080
|
-
(_a = this.children) === null || _a ===
|
|
99410
|
+
(_a = this.children) === null || _a === void 0 ? void 0 : _a.forEach(function (child) {
|
|
99081
99411
|
if (!child.visible()) {
|
|
99082
99412
|
return;
|
|
99083
99413
|
}
|
|
@@ -99209,7 +99539,7 @@ void main() {
|
|
|
99209
99539
|
hasRequiredStage = 1;
|
|
99210
99540
|
(function (exports) {
|
|
99211
99541
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
99212
|
-
exports.Stage = exports.stages =
|
|
99542
|
+
exports.Stage = exports.stages = void 0;
|
|
99213
99543
|
const Util_1 = requireUtil();
|
|
99214
99544
|
const Factory_1 = requireFactory();
|
|
99215
99545
|
const Container_1 = requireContainer();
|
|
@@ -99235,6 +99565,7 @@ void main() {
|
|
|
99235
99565
|
[POINTERMOVE, '_pointermove'],
|
|
99236
99566
|
[POINTERUP, '_pointerup'],
|
|
99237
99567
|
[POINTERCANCEL, '_pointercancel'],
|
|
99568
|
+
[POINTERLEAVE, '_pointerleave'],
|
|
99238
99569
|
[LOSTPOINTERCAPTURE, '_lostpointercapture'],
|
|
99239
99570
|
];
|
|
99240
99571
|
const EVENTS_MAP = {
|
|
@@ -99336,12 +99667,12 @@ void main() {
|
|
|
99336
99667
|
}
|
|
99337
99668
|
setContainer(container) {
|
|
99338
99669
|
if (typeof container === STRING) {
|
|
99670
|
+
let id;
|
|
99339
99671
|
if (container.charAt(0) === '.') {
|
|
99340
99672
|
const className = container.slice(1);
|
|
99341
99673
|
container = document.getElementsByClassName(className)[0];
|
|
99342
99674
|
}
|
|
99343
99675
|
else {
|
|
99344
|
-
var id;
|
|
99345
99676
|
if (container.charAt(0) !== '#') {
|
|
99346
99677
|
id = container;
|
|
99347
99678
|
}
|
|
@@ -99926,7 +100257,7 @@ void main() {
|
|
|
99926
100257
|
hasRequiredShape = 1;
|
|
99927
100258
|
(function (exports) {
|
|
99928
100259
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
99929
|
-
exports.Shape = exports.shapes =
|
|
100260
|
+
exports.Shape = exports.shapes = void 0;
|
|
99930
100261
|
const Global_1 = requireGlobal();
|
|
99931
100262
|
const Util_1 = requireUtil();
|
|
99932
100263
|
const Factory_1 = requireFactory();
|
|
@@ -100159,7 +100490,7 @@ void main() {
|
|
|
100159
100490
|
}
|
|
100160
100491
|
_useBufferCanvas(forceFill) {
|
|
100161
100492
|
var _a;
|
|
100162
|
-
const perfectDrawEnabled = (_a = this.attrs.perfectDrawEnabled) !== null && _a !==
|
|
100493
|
+
const perfectDrawEnabled = (_a = this.attrs.perfectDrawEnabled) !== null && _a !== void 0 ? _a : true;
|
|
100163
100494
|
if (!perfectDrawEnabled) {
|
|
100164
100495
|
return false;
|
|
100165
100496
|
}
|
|
@@ -100244,8 +100575,8 @@ void main() {
|
|
|
100244
100575
|
}
|
|
100245
100576
|
drawScene(can, top, bufferCanvas) {
|
|
100246
100577
|
const layer = this.getLayer();
|
|
100247
|
-
|
|
100248
|
-
|
|
100578
|
+
const canvas = can || layer.getCanvas(), context = canvas.getContext(), cachedCanvas = this._getCanvasCache(), drawFunc = this.getSceneFunc(), hasShadow = this.hasShadow();
|
|
100579
|
+
let stage;
|
|
100249
100580
|
const cachingSelf = top === this;
|
|
100250
100581
|
if (!this.isVisible() && !cachingSelf) {
|
|
100251
100582
|
return this;
|
|
@@ -100262,14 +100593,14 @@ void main() {
|
|
|
100262
100593
|
return this;
|
|
100263
100594
|
}
|
|
100264
100595
|
context.save();
|
|
100265
|
-
if (this._useBufferCanvas() &&
|
|
100596
|
+
if (this._useBufferCanvas() && true) {
|
|
100266
100597
|
stage = this.getStage();
|
|
100267
100598
|
const bc = bufferCanvas || stage.bufferCanvas;
|
|
100268
|
-
bufferContext = bc.getContext();
|
|
100599
|
+
const bufferContext = bc.getContext();
|
|
100269
100600
|
bufferContext.clear();
|
|
100270
100601
|
bufferContext.save();
|
|
100271
100602
|
bufferContext._applyLineJoin(this);
|
|
100272
|
-
|
|
100603
|
+
const o = this.getAbsoluteTransform(top).getMatrix();
|
|
100273
100604
|
bufferContext.transform(o[0], o[1], o[2], o[3], o[4], o[5]);
|
|
100274
100605
|
drawFunc.call(this, bufferContext, this);
|
|
100275
100606
|
bufferContext.restore();
|
|
@@ -100279,12 +100610,12 @@ void main() {
|
|
|
100279
100610
|
}
|
|
100280
100611
|
context._applyOpacity(this);
|
|
100281
100612
|
context._applyGlobalCompositeOperation(this);
|
|
100282
|
-
context.drawImage(bc._canvas, 0, 0, bc.width / ratio, bc.height / ratio);
|
|
100613
|
+
context.drawImage(bc._canvas, bc.x || 0, bc.y || 0, bc.width / ratio, bc.height / ratio);
|
|
100283
100614
|
}
|
|
100284
100615
|
else {
|
|
100285
100616
|
context._applyLineJoin(this);
|
|
100286
100617
|
if (!cachingSelf) {
|
|
100287
|
-
|
|
100618
|
+
const o = this.getAbsoluteTransform(top).getMatrix();
|
|
100288
100619
|
context.transform(o[0], o[1], o[2], o[3], o[4], o[5]);
|
|
100289
100620
|
context._applyOpacity(this);
|
|
100290
100621
|
context._applyGlobalCompositeOperation(this);
|
|
@@ -100479,7 +100810,7 @@ void main() {
|
|
|
100479
100810
|
if (hasRequiredLayer) return Layer;
|
|
100480
100811
|
hasRequiredLayer = 1;
|
|
100481
100812
|
Object.defineProperty(Layer, "__esModule", { value: true });
|
|
100482
|
-
Layer.Layer =
|
|
100813
|
+
Layer.Layer = void 0;
|
|
100483
100814
|
const Util_1 = requireUtil();
|
|
100484
100815
|
const Container_1 = requireContainer();
|
|
100485
100816
|
const Node_1 = requireNode();
|
|
@@ -100724,7 +101055,7 @@ void main() {
|
|
|
100724
101055
|
}
|
|
100725
101056
|
return {};
|
|
100726
101057
|
}
|
|
100727
|
-
drawScene(can, top) {
|
|
101058
|
+
drawScene(can, top, bufferCanvas) {
|
|
100728
101059
|
const layer = this.getLayer(), canvas = can || (layer && layer.getCanvas());
|
|
100729
101060
|
this._fire(BEFORE_DRAW, {
|
|
100730
101061
|
node: this,
|
|
@@ -100732,7 +101063,7 @@ void main() {
|
|
|
100732
101063
|
if (this.clearBeforeDraw()) {
|
|
100733
101064
|
canvas.getContext().clear();
|
|
100734
101065
|
}
|
|
100735
|
-
Container_1.Container.prototype.drawScene.call(this, canvas, top);
|
|
101066
|
+
Container_1.Container.prototype.drawScene.call(this, canvas, top, bufferCanvas);
|
|
100736
101067
|
this._fire(DRAW, {
|
|
100737
101068
|
node: this,
|
|
100738
101069
|
});
|
|
@@ -100797,7 +101128,7 @@ void main() {
|
|
|
100797
101128
|
if (hasRequiredFastLayer) return FastLayer;
|
|
100798
101129
|
hasRequiredFastLayer = 1;
|
|
100799
101130
|
Object.defineProperty(FastLayer, "__esModule", { value: true });
|
|
100800
|
-
FastLayer.FastLayer =
|
|
101131
|
+
FastLayer.FastLayer = void 0;
|
|
100801
101132
|
const Util_1 = requireUtil();
|
|
100802
101133
|
const Layer_1 = requireLayer();
|
|
100803
101134
|
const Global_1 = requireGlobal();
|
|
@@ -100822,7 +101153,7 @@ void main() {
|
|
|
100822
101153
|
if (hasRequiredGroup) return Group;
|
|
100823
101154
|
hasRequiredGroup = 1;
|
|
100824
101155
|
Object.defineProperty(Group, "__esModule", { value: true });
|
|
100825
|
-
Group.Group =
|
|
101156
|
+
Group.Group = void 0;
|
|
100826
101157
|
const Util_1 = requireUtil();
|
|
100827
101158
|
const Container_1 = requireContainer();
|
|
100828
101159
|
const Global_1 = requireGlobal();
|
|
@@ -100848,7 +101179,7 @@ void main() {
|
|
|
100848
101179
|
if (hasRequiredAnimation) return Animation;
|
|
100849
101180
|
hasRequiredAnimation = 1;
|
|
100850
101181
|
Object.defineProperty(Animation, "__esModule", { value: true });
|
|
100851
|
-
Animation.Animation =
|
|
101182
|
+
Animation.Animation = void 0;
|
|
100852
101183
|
const Global_1 = requireGlobal();
|
|
100853
101184
|
const Util_1 = requireUtil();
|
|
100854
101185
|
const now = (function () {
|
|
@@ -101004,7 +101335,7 @@ void main() {
|
|
|
101004
101335
|
hasRequiredTween = 1;
|
|
101005
101336
|
(function (exports) {
|
|
101006
101337
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
101007
|
-
exports.Easings = exports.Tween =
|
|
101338
|
+
exports.Easings = exports.Tween = void 0;
|
|
101008
101339
|
const Util_1 = requireUtil();
|
|
101009
101340
|
const Animation_1 = requireAnimation();
|
|
101010
101341
|
const Node_1 = requireNode();
|
|
@@ -101360,10 +101691,21 @@ void main() {
|
|
|
101360
101691
|
destroy() {
|
|
101361
101692
|
const nodeId = this.node._id, thisId = this._id, attrs = Tween.tweens[nodeId];
|
|
101362
101693
|
this.pause();
|
|
101694
|
+
if (this.anim) {
|
|
101695
|
+
this.anim.stop();
|
|
101696
|
+
}
|
|
101363
101697
|
for (const key in attrs) {
|
|
101364
101698
|
delete Tween.tweens[nodeId][key];
|
|
101365
101699
|
}
|
|
101366
101700
|
delete Tween.attrs[nodeId][thisId];
|
|
101701
|
+
if (Tween.tweens[nodeId]) {
|
|
101702
|
+
if (Object.keys(Tween.tweens[nodeId]).length === 0) {
|
|
101703
|
+
delete Tween.tweens[nodeId];
|
|
101704
|
+
}
|
|
101705
|
+
if (Object.keys(Tween.attrs[nodeId]).length === 0) {
|
|
101706
|
+
delete Tween.attrs[nodeId];
|
|
101707
|
+
}
|
|
101708
|
+
}
|
|
101367
101709
|
}
|
|
101368
101710
|
}
|
|
101369
101711
|
exports.Tween = Tween;
|
|
@@ -101537,7 +101879,7 @@ void main() {
|
|
|
101537
101879
|
hasRequired_CoreInternals = 1;
|
|
101538
101880
|
(function (exports) {
|
|
101539
101881
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
101540
|
-
exports.Konva =
|
|
101882
|
+
exports.Konva = void 0;
|
|
101541
101883
|
const Global_1 = requireGlobal();
|
|
101542
101884
|
const Util_1 = requireUtil();
|
|
101543
101885
|
const Node_1 = requireNode();
|
|
@@ -101584,7 +101926,7 @@ void main() {
|
|
|
101584
101926
|
if (hasRequiredArc) return Arc;
|
|
101585
101927
|
hasRequiredArc = 1;
|
|
101586
101928
|
Object.defineProperty(Arc, "__esModule", { value: true });
|
|
101587
|
-
Arc.Arc =
|
|
101929
|
+
Arc.Arc = void 0;
|
|
101588
101930
|
const Factory_1 = requireFactory();
|
|
101589
101931
|
const Shape_1 = requireShape();
|
|
101590
101932
|
const Global_1 = requireGlobal();
|
|
@@ -101635,7 +101977,12 @@ void main() {
|
|
|
101635
101977
|
Arc.Arc = Arc$1;
|
|
101636
101978
|
Arc$1.prototype._centroid = true;
|
|
101637
101979
|
Arc$1.prototype.className = 'Arc';
|
|
101638
|
-
Arc$1.prototype._attrsAffectingSize = [
|
|
101980
|
+
Arc$1.prototype._attrsAffectingSize = [
|
|
101981
|
+
'innerRadius',
|
|
101982
|
+
'outerRadius',
|
|
101983
|
+
'angle',
|
|
101984
|
+
'clockwise',
|
|
101985
|
+
];
|
|
101639
101986
|
(0, Global_2._registerNode)(Arc$1);
|
|
101640
101987
|
Factory_1.Factory.addGetterSetter(Arc$1, 'innerRadius', 0, (0, Validators_1.getNumberValidator)());
|
|
101641
101988
|
Factory_1.Factory.addGetterSetter(Arc$1, 'outerRadius', 0, (0, Validators_1.getNumberValidator)());
|
|
@@ -101654,7 +102001,7 @@ void main() {
|
|
|
101654
102001
|
if (hasRequiredLine) return Line;
|
|
101655
102002
|
hasRequiredLine = 1;
|
|
101656
102003
|
Object.defineProperty(Line, "__esModule", { value: true });
|
|
101657
|
-
Line.Line =
|
|
102004
|
+
Line.Line = void 0;
|
|
101658
102005
|
const Factory_1 = requireFactory();
|
|
101659
102006
|
const Global_1 = requireGlobal();
|
|
101660
102007
|
const Shape_1 = requireShape();
|
|
@@ -101687,15 +102034,16 @@ void main() {
|
|
|
101687
102034
|
});
|
|
101688
102035
|
}
|
|
101689
102036
|
_sceneFunc(context) {
|
|
101690
|
-
|
|
102037
|
+
const points = this.points(), length = points.length, tension = this.tension(), closed = this.closed(), bezier = this.bezier();
|
|
101691
102038
|
if (!length) {
|
|
101692
102039
|
return;
|
|
101693
102040
|
}
|
|
102041
|
+
let n = 0;
|
|
101694
102042
|
context.beginPath();
|
|
101695
102043
|
context.moveTo(points[0], points[1]);
|
|
101696
102044
|
if (tension !== 0 && length > 4) {
|
|
101697
|
-
tp = this.getTensionPoints();
|
|
101698
|
-
len = tp.length;
|
|
102045
|
+
const tp = this.getTensionPoints();
|
|
102046
|
+
const len = tp.length;
|
|
101699
102047
|
n = closed ? 0 : 4;
|
|
101700
102048
|
if (!closed) {
|
|
101701
102049
|
context.quadraticCurveTo(tp[0], tp[1], tp[2], tp[3]);
|
|
@@ -101825,7 +102173,7 @@ void main() {
|
|
|
101825
102173
|
hasRequiredBezierFunctions = 1;
|
|
101826
102174
|
(function (exports) {
|
|
101827
102175
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
101828
|
-
exports.t2length = exports.getQuadraticArcLength = exports.getCubicArcLength = exports.binomialCoefficients = exports.cValues = exports.tValues =
|
|
102176
|
+
exports.t2length = exports.getQuadraticArcLength = exports.getCubicArcLength = exports.binomialCoefficients = exports.cValues = exports.tValues = void 0;
|
|
101829
102177
|
exports.tValues = [
|
|
101830
102178
|
[],
|
|
101831
102179
|
[],
|
|
@@ -102623,10 +102971,10 @@ void main() {
|
|
|
102623
102971
|
if (hasRequiredPath) return Path;
|
|
102624
102972
|
hasRequiredPath = 1;
|
|
102625
102973
|
Object.defineProperty(Path, "__esModule", { value: true });
|
|
102626
|
-
Path.Path =
|
|
102974
|
+
Path.Path = void 0;
|
|
102627
102975
|
const Factory_1 = requireFactory();
|
|
102628
|
-
const Shape_1 = requireShape();
|
|
102629
102976
|
const Global_1 = requireGlobal();
|
|
102977
|
+
const Shape_1 = requireShape();
|
|
102630
102978
|
const BezierFunctions_1 = requireBezierFunctions();
|
|
102631
102979
|
let Path$1 = class Path extends Shape_1.Shape {
|
|
102632
102980
|
constructor(config) {
|
|
@@ -102663,10 +103011,10 @@ void main() {
|
|
|
102663
103011
|
context.quadraticCurveTo(p[0], p[1], p[2], p[3]);
|
|
102664
103012
|
break;
|
|
102665
103013
|
case 'A':
|
|
102666
|
-
|
|
102667
|
-
|
|
102668
|
-
|
|
102669
|
-
|
|
103014
|
+
const cx = p[0], cy = p[1], rx = p[2], ry = p[3], theta = p[4], dTheta = p[5], psi = p[6], fs = p[7];
|
|
103015
|
+
const r = rx > ry ? rx : ry;
|
|
103016
|
+
const scaleX = rx > ry ? 1 : rx / ry;
|
|
103017
|
+
const scaleY = rx > ry ? ry / rx : 1;
|
|
102670
103018
|
context.translate(cx, cy);
|
|
102671
103019
|
context.rotate(psi);
|
|
102672
103020
|
context.scale(scaleX, scaleY);
|
|
@@ -102779,11 +103127,20 @@ void main() {
|
|
|
102779
103127
|
};
|
|
102780
103128
|
}
|
|
102781
103129
|
if (length < 0.01) {
|
|
102782
|
-
|
|
102783
|
-
|
|
102784
|
-
|
|
102785
|
-
|
|
102786
|
-
|
|
103130
|
+
const cmd = dataArray[i].command;
|
|
103131
|
+
if (cmd === 'M') {
|
|
103132
|
+
points = dataArray[i].points.slice(0, 2);
|
|
103133
|
+
return {
|
|
103134
|
+
x: points[0],
|
|
103135
|
+
y: points[1],
|
|
103136
|
+
};
|
|
103137
|
+
}
|
|
103138
|
+
else {
|
|
103139
|
+
return {
|
|
103140
|
+
x: dataArray[i].start.x,
|
|
103141
|
+
y: dataArray[i].start.y,
|
|
103142
|
+
};
|
|
103143
|
+
}
|
|
102787
103144
|
}
|
|
102788
103145
|
const cp = dataArray[i];
|
|
102789
103146
|
const p = cp.points;
|
|
@@ -102799,15 +103156,16 @@ void main() {
|
|
|
102799
103156
|
return (0, BezierFunctions_1.getQuadraticArcLength)([cp.start.x, p[0], p[2]], [cp.start.y, p[1], p[3]], i);
|
|
102800
103157
|
}), cp.start.x, cp.start.y, p[0], p[1], p[2], p[3]);
|
|
102801
103158
|
case 'A':
|
|
102802
|
-
|
|
103159
|
+
const cx = p[0], cy = p[1], rx = p[2], ry = p[3], dTheta = p[5], psi = p[6];
|
|
103160
|
+
let theta = p[4];
|
|
102803
103161
|
theta += (dTheta * length) / cp.pathLength;
|
|
102804
103162
|
return Path.getPointOnEllipticalArc(cx, cy, rx, ry, theta, psi);
|
|
102805
103163
|
}
|
|
102806
103164
|
return null;
|
|
102807
103165
|
}
|
|
102808
103166
|
static getPointOnLine(dist, P1x, P1y, P2x, P2y, fromX, fromY) {
|
|
102809
|
-
fromX = fromX !== null && fromX !==
|
|
102810
|
-
fromY = fromY !== null && fromY !==
|
|
103167
|
+
fromX = fromX !== null && fromX !== void 0 ? fromX : P1x;
|
|
103168
|
+
fromY = fromY !== null && fromY !== void 0 ? fromY : P1y;
|
|
102811
103169
|
const len = this.getLineLength(P1x, P1y, P2x, P2y);
|
|
102812
103170
|
if (len < 1e-10) {
|
|
102813
103171
|
return { x: P1x, y: P1y };
|
|
@@ -102845,10 +103203,7 @@ void main() {
|
|
|
102845
103203
|
}
|
|
102846
103204
|
const x = P4x * CB1(pct) + P3x * CB2(pct) + P2x * CB3(pct) + P1x * CB4(pct);
|
|
102847
103205
|
const y = P4y * CB1(pct) + P3y * CB2(pct) + P2y * CB3(pct) + P1y * CB4(pct);
|
|
102848
|
-
return {
|
|
102849
|
-
x: x,
|
|
102850
|
-
y: y,
|
|
102851
|
-
};
|
|
103206
|
+
return { x, y };
|
|
102852
103207
|
}
|
|
102853
103208
|
static getPointOnQuadraticBezier(pct, P1x, P1y, P2x, P2y, P3x, P3y) {
|
|
102854
103209
|
function QB1(t) {
|
|
@@ -102862,10 +103217,7 @@ void main() {
|
|
|
102862
103217
|
}
|
|
102863
103218
|
const x = P3x * QB1(pct) + P2x * QB2(pct) + P1x * QB3(pct);
|
|
102864
103219
|
const y = P3y * QB1(pct) + P2y * QB2(pct) + P1y * QB3(pct);
|
|
102865
|
-
return {
|
|
102866
|
-
x: x,
|
|
102867
|
-
y: y,
|
|
102868
|
-
};
|
|
103220
|
+
return { x, y };
|
|
102869
103221
|
}
|
|
102870
103222
|
static getPointOnEllipticalArc(cx, cy, rx, ry, theta, psi) {
|
|
102871
103223
|
const cosPsi = Math.cos(psi), sinPsi = Math.sin(psi);
|
|
@@ -102906,7 +103258,7 @@ void main() {
|
|
|
102906
103258
|
'A',
|
|
102907
103259
|
];
|
|
102908
103260
|
cs = cs.replace(new RegExp(' ', 'g'), ',');
|
|
102909
|
-
for (
|
|
103261
|
+
for (let n = 0; n < cc.length; n++) {
|
|
102910
103262
|
cs = cs.replace(new RegExp(cc[n], 'g'), '|' + cc[n]);
|
|
102911
103263
|
}
|
|
102912
103264
|
const arr = cs.split('|');
|
|
@@ -102916,7 +103268,7 @@ void main() {
|
|
|
102916
103268
|
let cpy = 0;
|
|
102917
103269
|
const re = /([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:e[-+]?\d+)?)/gi;
|
|
102918
103270
|
let match;
|
|
102919
|
-
for (n = 1; n < arr.length; n++) {
|
|
103271
|
+
for (let n = 1; n < arr.length; n++) {
|
|
102920
103272
|
let str = arr[n];
|
|
102921
103273
|
let c = str.charAt(0);
|
|
102922
103274
|
str = str.slice(1);
|
|
@@ -102945,8 +103297,8 @@ void main() {
|
|
|
102945
103297
|
let cmd = '';
|
|
102946
103298
|
let points = [];
|
|
102947
103299
|
const startX = cpx, startY = cpy;
|
|
102948
|
-
|
|
102949
|
-
|
|
103300
|
+
let prevCmd, ctlPtx, ctlPty;
|
|
103301
|
+
let rx, ry, psi, fa, fs, x1, y1;
|
|
102950
103302
|
switch (c) {
|
|
102951
103303
|
case 'l':
|
|
102952
103304
|
cpx += p.shift();
|
|
@@ -102960,8 +103312,8 @@ void main() {
|
|
|
102960
103312
|
points.push(cpx, cpy);
|
|
102961
103313
|
break;
|
|
102962
103314
|
case 'm':
|
|
102963
|
-
|
|
102964
|
-
|
|
103315
|
+
const dx = p.shift();
|
|
103316
|
+
const dy = p.shift();
|
|
102965
103317
|
cpx += dx;
|
|
102966
103318
|
cpy += dy;
|
|
102967
103319
|
cmd = 'M';
|
|
@@ -103144,10 +103496,10 @@ void main() {
|
|
|
103144
103496
|
return (0, BezierFunctions_1.getQuadraticArcLength)([x, points[0], points[2]], [y, points[1], points[3]], 1);
|
|
103145
103497
|
case 'A':
|
|
103146
103498
|
len = 0.0;
|
|
103147
|
-
|
|
103148
|
-
|
|
103149
|
-
|
|
103150
|
-
|
|
103499
|
+
const start = points[4];
|
|
103500
|
+
const dTheta = points[5];
|
|
103501
|
+
const end = points[4] + dTheta;
|
|
103502
|
+
let inc = Math.PI / 180.0;
|
|
103151
103503
|
if (Math.abs(start - end) < inc) {
|
|
103152
103504
|
inc = Math.abs(start - end);
|
|
103153
103505
|
}
|
|
@@ -103236,7 +103588,7 @@ void main() {
|
|
|
103236
103588
|
if (hasRequiredArrow) return Arrow;
|
|
103237
103589
|
hasRequiredArrow = 1;
|
|
103238
103590
|
Object.defineProperty(Arrow, "__esModule", { value: true });
|
|
103239
|
-
Arrow.Arrow =
|
|
103591
|
+
Arrow.Arrow = void 0;
|
|
103240
103592
|
const Factory_1 = requireFactory();
|
|
103241
103593
|
const Line_1 = requireLine();
|
|
103242
103594
|
const Validators_1 = requireValidators();
|
|
@@ -103348,7 +103700,7 @@ void main() {
|
|
|
103348
103700
|
if (hasRequiredCircle) return Circle;
|
|
103349
103701
|
hasRequiredCircle = 1;
|
|
103350
103702
|
Object.defineProperty(Circle, "__esModule", { value: true });
|
|
103351
|
-
Circle.Circle =
|
|
103703
|
+
Circle.Circle = void 0;
|
|
103352
103704
|
const Factory_1 = requireFactory();
|
|
103353
103705
|
const Shape_1 = requireShape();
|
|
103354
103706
|
const Validators_1 = requireValidators();
|
|
@@ -103394,7 +103746,7 @@ void main() {
|
|
|
103394
103746
|
if (hasRequiredEllipse) return Ellipse;
|
|
103395
103747
|
hasRequiredEllipse = 1;
|
|
103396
103748
|
Object.defineProperty(Ellipse, "__esModule", { value: true });
|
|
103397
|
-
Ellipse.Ellipse =
|
|
103749
|
+
Ellipse.Ellipse = void 0;
|
|
103398
103750
|
const Factory_1 = requireFactory();
|
|
103399
103751
|
const Shape_1 = requireShape();
|
|
103400
103752
|
const Validators_1 = requireValidators();
|
|
@@ -103444,7 +103796,7 @@ void main() {
|
|
|
103444
103796
|
if (hasRequiredImage) return Image$1;
|
|
103445
103797
|
hasRequiredImage = 1;
|
|
103446
103798
|
Object.defineProperty(Image$1, "__esModule", { value: true });
|
|
103447
|
-
Image$1.Image =
|
|
103799
|
+
Image$1.Image = void 0;
|
|
103448
103800
|
const Util_1 = requireUtil();
|
|
103449
103801
|
const Factory_1 = requireFactory();
|
|
103450
103802
|
const Shape_1 = requireShape();
|
|
@@ -103453,7 +103805,11 @@ void main() {
|
|
|
103453
103805
|
class Image extends Shape_1.Shape {
|
|
103454
103806
|
constructor(attrs) {
|
|
103455
103807
|
super(attrs);
|
|
103456
|
-
this.
|
|
103808
|
+
this._loadListener = () => {
|
|
103809
|
+
this._requestDraw();
|
|
103810
|
+
};
|
|
103811
|
+
this.on('imageChange.konva', (props) => {
|
|
103812
|
+
this._removeImageLoad(props.oldVal);
|
|
103457
103813
|
this._setImageLoad();
|
|
103458
103814
|
});
|
|
103459
103815
|
this._setImageLoad();
|
|
@@ -103467,11 +103823,19 @@ void main() {
|
|
|
103467
103823
|
return;
|
|
103468
103824
|
}
|
|
103469
103825
|
if (image && image['addEventListener']) {
|
|
103470
|
-
image['addEventListener']('load',
|
|
103471
|
-
|
|
103472
|
-
|
|
103826
|
+
image['addEventListener']('load', this._loadListener);
|
|
103827
|
+
}
|
|
103828
|
+
}
|
|
103829
|
+
_removeImageLoad(image) {
|
|
103830
|
+
if (image && image['removeEventListener']) {
|
|
103831
|
+
image['removeEventListener']('load', this._loadListener);
|
|
103473
103832
|
}
|
|
103474
103833
|
}
|
|
103834
|
+
destroy() {
|
|
103835
|
+
this._removeImageLoad(this.image());
|
|
103836
|
+
super.destroy();
|
|
103837
|
+
return this;
|
|
103838
|
+
}
|
|
103475
103839
|
_useBufferCanvas() {
|
|
103476
103840
|
const hasCornerRadius = !!this.cornerRadius();
|
|
103477
103841
|
const hasShadow = this.hasShadow();
|
|
@@ -103535,11 +103899,11 @@ void main() {
|
|
|
103535
103899
|
}
|
|
103536
103900
|
getWidth() {
|
|
103537
103901
|
var _a, _b;
|
|
103538
|
-
return (_a = this.attrs.width) !== null && _a !==
|
|
103902
|
+
return (_a = this.attrs.width) !== null && _a !== void 0 ? _a : (_b = this.image()) === null || _b === void 0 ? void 0 : _b.width;
|
|
103539
103903
|
}
|
|
103540
103904
|
getHeight() {
|
|
103541
103905
|
var _a, _b;
|
|
103542
|
-
return (_a = this.attrs.height) !== null && _a !==
|
|
103906
|
+
return (_a = this.attrs.height) !== null && _a !== void 0 ? _a : (_b = this.image()) === null || _b === void 0 ? void 0 : _b.height;
|
|
103543
103907
|
}
|
|
103544
103908
|
static fromURL(url, callback, onError = null) {
|
|
103545
103909
|
const img = Util_1.Util.createImageElement();
|
|
@@ -103575,7 +103939,7 @@ void main() {
|
|
|
103575
103939
|
if (hasRequiredLabel) return Label;
|
|
103576
103940
|
hasRequiredLabel = 1;
|
|
103577
103941
|
Object.defineProperty(Label, "__esModule", { value: true });
|
|
103578
|
-
Label.Tag = Label.Label =
|
|
103942
|
+
Label.Tag = Label.Label = void 0;
|
|
103579
103943
|
const Factory_1 = requireFactory();
|
|
103580
103944
|
const Shape_1 = requireShape();
|
|
103581
103945
|
const Group_1 = requireGroup();
|
|
@@ -103762,7 +104126,7 @@ void main() {
|
|
|
103762
104126
|
if (hasRequiredRect) return Rect;
|
|
103763
104127
|
hasRequiredRect = 1;
|
|
103764
104128
|
Object.defineProperty(Rect, "__esModule", { value: true });
|
|
103765
|
-
Rect.Rect =
|
|
104129
|
+
Rect.Rect = void 0;
|
|
103766
104130
|
const Factory_1 = requireFactory();
|
|
103767
104131
|
const Shape_1 = requireShape();
|
|
103768
104132
|
const Global_1 = requireGlobal();
|
|
@@ -103797,7 +104161,7 @@ void main() {
|
|
|
103797
104161
|
if (hasRequiredRegularPolygon) return RegularPolygon;
|
|
103798
104162
|
hasRequiredRegularPolygon = 1;
|
|
103799
104163
|
Object.defineProperty(RegularPolygon, "__esModule", { value: true });
|
|
103800
|
-
RegularPolygon.RegularPolygon =
|
|
104164
|
+
RegularPolygon.RegularPolygon = void 0;
|
|
103801
104165
|
const Factory_1 = requireFactory();
|
|
103802
104166
|
const Shape_1 = requireShape();
|
|
103803
104167
|
const Validators_1 = requireValidators();
|
|
@@ -103875,7 +104239,7 @@ void main() {
|
|
|
103875
104239
|
if (hasRequiredRing) return Ring;
|
|
103876
104240
|
hasRequiredRing = 1;
|
|
103877
104241
|
Object.defineProperty(Ring, "__esModule", { value: true });
|
|
103878
|
-
Ring.Ring =
|
|
104242
|
+
Ring.Ring = void 0;
|
|
103879
104243
|
const Factory_1 = requireFactory();
|
|
103880
104244
|
const Shape_1 = requireShape();
|
|
103881
104245
|
const Validators_1 = requireValidators();
|
|
@@ -103921,7 +104285,7 @@ void main() {
|
|
|
103921
104285
|
if (hasRequiredSprite) return Sprite;
|
|
103922
104286
|
hasRequiredSprite = 1;
|
|
103923
104287
|
Object.defineProperty(Sprite, "__esModule", { value: true });
|
|
103924
|
-
Sprite.Sprite =
|
|
104288
|
+
Sprite.Sprite = void 0;
|
|
103925
104289
|
const Factory_1 = requireFactory();
|
|
103926
104290
|
const Shape_1 = requireShape();
|
|
103927
104291
|
const Animation_1 = requireAnimation();
|
|
@@ -104042,7 +104406,7 @@ void main() {
|
|
|
104042
104406
|
if (hasRequiredStar) return Star;
|
|
104043
104407
|
hasRequiredStar = 1;
|
|
104044
104408
|
Object.defineProperty(Star, "__esModule", { value: true });
|
|
104045
|
-
Star.Star =
|
|
104409
|
+
Star.Star = void 0;
|
|
104046
104410
|
const Factory_1 = requireFactory();
|
|
104047
104411
|
const Shape_1 = requireShape();
|
|
104048
104412
|
const Validators_1 = requireValidators();
|
|
@@ -104093,7 +104457,7 @@ void main() {
|
|
|
104093
104457
|
if (hasRequiredText) return Text;
|
|
104094
104458
|
hasRequiredText = 1;
|
|
104095
104459
|
Object.defineProperty(Text, "__esModule", { value: true });
|
|
104096
|
-
Text.Text =
|
|
104460
|
+
Text.Text = void 0;
|
|
104097
104461
|
Text.stringToArray = stringToArray;
|
|
104098
104462
|
const Util_1 = requireUtil();
|
|
104099
104463
|
const Factory_1 = requireFactory();
|
|
@@ -104206,8 +104570,6 @@ void main() {
|
|
|
104206
104570
|
(metrics.fontBoundingBoxAscent - metrics.fontBoundingBoxDescent) / 2 +
|
|
104207
104571
|
lineHeightPx / 2;
|
|
104208
104572
|
}
|
|
104209
|
-
var lineTranslateX = 0;
|
|
104210
|
-
var lineTranslateY = 0;
|
|
104211
104573
|
if (direction === RTL) {
|
|
104212
104574
|
context.setAttr('direction', direction);
|
|
104213
104575
|
}
|
|
@@ -104222,9 +104584,9 @@ void main() {
|
|
|
104222
104584
|
}
|
|
104223
104585
|
context.translate(padding, alignY + padding);
|
|
104224
104586
|
for (n = 0; n < textArrLen; n++) {
|
|
104225
|
-
|
|
104226
|
-
|
|
104227
|
-
|
|
104587
|
+
let lineTranslateX = 0;
|
|
104588
|
+
let lineTranslateY = 0;
|
|
104589
|
+
const obj = textArr[n], text = obj.text, width = obj.width, lastLine = obj.lastInParagraph;
|
|
104228
104590
|
context.save();
|
|
104229
104591
|
if (align === RIGHT) {
|
|
104230
104592
|
lineTranslateX += totalWidth - width - padding * 2;
|
|
@@ -104241,9 +104603,7 @@ void main() {
|
|
|
104241
104603
|
const x = lineTranslateX;
|
|
104242
104604
|
const y = translateY + lineTranslateY + yOffset;
|
|
104243
104605
|
context.moveTo(x, y);
|
|
104244
|
-
|
|
104245
|
-
lineWidth =
|
|
104246
|
-
align === JUSTIFY && !lastLine ? totalWidth - padding * 2 : width;
|
|
104606
|
+
const lineWidth = align === JUSTIFY && !lastLine ? totalWidth - padding * 2 : width;
|
|
104247
104607
|
context.lineTo(x + Math.round(lineWidth), y);
|
|
104248
104608
|
context.lineWidth = fontSize / 15;
|
|
104249
104609
|
const gradient = this._getLinearGradient();
|
|
@@ -104256,9 +104616,7 @@ void main() {
|
|
|
104256
104616
|
context.beginPath();
|
|
104257
104617
|
const yOffset = Global_1.Konva._fixTextRendering ? -Math.round(fontSize / 4) : 0;
|
|
104258
104618
|
context.moveTo(lineTranslateX, translateY + lineTranslateY + yOffset);
|
|
104259
|
-
|
|
104260
|
-
lineWidth =
|
|
104261
|
-
align === JUSTIFY && !lastLine ? totalWidth - padding * 2 : width;
|
|
104619
|
+
const lineWidth = align === JUSTIFY && !lastLine ? totalWidth - padding * 2 : width;
|
|
104262
104620
|
context.lineTo(lineTranslateX + Math.round(lineWidth), translateY + lineTranslateY + yOffset);
|
|
104263
104621
|
context.lineWidth = fontSize / 15;
|
|
104264
104622
|
const gradient = this._getLinearGradient();
|
|
@@ -104267,7 +104625,7 @@ void main() {
|
|
|
104267
104625
|
context.restore();
|
|
104268
104626
|
}
|
|
104269
104627
|
if (direction !== RTL && (letterSpacing !== 0 || align === JUSTIFY)) {
|
|
104270
|
-
spacesNumber = text.split(' ').length - 1;
|
|
104628
|
+
const spacesNumber = text.split(' ').length - 1;
|
|
104271
104629
|
const array = stringToArray(text);
|
|
104272
104630
|
for (let li = 0; li < array.length; li++) {
|
|
104273
104631
|
const letter = array[li];
|
|
@@ -104339,17 +104697,17 @@ void main() {
|
|
|
104339
104697
|
_context.restore();
|
|
104340
104698
|
const scaleFactor = fontSize / 100;
|
|
104341
104699
|
return {
|
|
104342
|
-
actualBoundingBoxAscent: (_a = metrics.actualBoundingBoxAscent) !== null && _a !==
|
|
104343
|
-
actualBoundingBoxDescent: (_b = metrics.actualBoundingBoxDescent) !== null && _b !==
|
|
104344
|
-
actualBoundingBoxLeft: (_c = metrics.actualBoundingBoxLeft) !== null && _c !==
|
|
104345
|
-
actualBoundingBoxRight: (_d = metrics.actualBoundingBoxRight) !== null && _d !==
|
|
104346
|
-
alphabeticBaseline: (_e = metrics.alphabeticBaseline) !== null && _e !==
|
|
104347
|
-
emHeightAscent: (_f = metrics.emHeightAscent) !== null && _f !==
|
|
104348
|
-
emHeightDescent: (_g = metrics.emHeightDescent) !== null && _g !==
|
|
104349
|
-
fontBoundingBoxAscent: (_h = metrics.fontBoundingBoxAscent) !== null && _h !==
|
|
104350
|
-
fontBoundingBoxDescent: (_j = metrics.fontBoundingBoxDescent) !== null && _j !==
|
|
104351
|
-
hangingBaseline: (_k = metrics.hangingBaseline) !== null && _k !==
|
|
104352
|
-
ideographicBaseline: (_l = metrics.ideographicBaseline) !== null && _l !==
|
|
104700
|
+
actualBoundingBoxAscent: (_a = metrics.actualBoundingBoxAscent) !== null && _a !== void 0 ? _a : 71.58203125 * scaleFactor,
|
|
104701
|
+
actualBoundingBoxDescent: (_b = metrics.actualBoundingBoxDescent) !== null && _b !== void 0 ? _b : 0,
|
|
104702
|
+
actualBoundingBoxLeft: (_c = metrics.actualBoundingBoxLeft) !== null && _c !== void 0 ? _c : -7.421875 * scaleFactor,
|
|
104703
|
+
actualBoundingBoxRight: (_d = metrics.actualBoundingBoxRight) !== null && _d !== void 0 ? _d : 75.732421875 * scaleFactor,
|
|
104704
|
+
alphabeticBaseline: (_e = metrics.alphabeticBaseline) !== null && _e !== void 0 ? _e : 0,
|
|
104705
|
+
emHeightAscent: (_f = metrics.emHeightAscent) !== null && _f !== void 0 ? _f : 100 * scaleFactor,
|
|
104706
|
+
emHeightDescent: (_g = metrics.emHeightDescent) !== null && _g !== void 0 ? _g : -20 * scaleFactor,
|
|
104707
|
+
fontBoundingBoxAscent: (_h = metrics.fontBoundingBoxAscent) !== null && _h !== void 0 ? _h : 91 * scaleFactor,
|
|
104708
|
+
fontBoundingBoxDescent: (_j = metrics.fontBoundingBoxDescent) !== null && _j !== void 0 ? _j : 21 * scaleFactor,
|
|
104709
|
+
hangingBaseline: (_k = metrics.hangingBaseline) !== null && _k !== void 0 ? _k : 72.80000305175781 * scaleFactor,
|
|
104710
|
+
ideographicBaseline: (_l = metrics.ideographicBaseline) !== null && _l !== void 0 ? _l : -21 * scaleFactor,
|
|
104353
104711
|
width: metrics.width,
|
|
104354
104712
|
height: fontSize,
|
|
104355
104713
|
};
|
|
@@ -104393,8 +104751,14 @@ void main() {
|
|
|
104393
104751
|
while (line.length > 0) {
|
|
104394
104752
|
let low = 0, high = stringToArray(line).length, match = '', matchWidth = 0;
|
|
104395
104753
|
while (low < high) {
|
|
104396
|
-
const mid = (low + high) >>> 1, lineArray = stringToArray(line), substr = lineArray.slice(0, mid + 1).join(''), substrWidth = this._getTextWidth(substr)
|
|
104397
|
-
|
|
104754
|
+
const mid = (low + high) >>> 1, lineArray = stringToArray(line), substr = lineArray.slice(0, mid + 1).join(''), substrWidth = this._getTextWidth(substr);
|
|
104755
|
+
const shouldConsiderEllipsis = shouldAddEllipsis &&
|
|
104756
|
+
fixedHeight &&
|
|
104757
|
+
currentHeightPx + lineHeightPx > maxHeightPx;
|
|
104758
|
+
const effectiveWidth = shouldConsiderEllipsis
|
|
104759
|
+
? substrWidth + additionalWidth
|
|
104760
|
+
: substrWidth;
|
|
104761
|
+
if (effectiveWidth <= maxWidth) {
|
|
104398
104762
|
low = mid + 1;
|
|
104399
104763
|
match = substr;
|
|
104400
104764
|
matchWidth = substrWidth;
|
|
@@ -104541,7 +104905,7 @@ void main() {
|
|
|
104541
104905
|
if (hasRequiredTextPath) return TextPath;
|
|
104542
104906
|
hasRequiredTextPath = 1;
|
|
104543
104907
|
Object.defineProperty(TextPath, "__esModule", { value: true });
|
|
104544
|
-
TextPath.TextPath =
|
|
104908
|
+
TextPath.TextPath = void 0;
|
|
104545
104909
|
const Util_1 = requireUtil();
|
|
104546
104910
|
const Factory_1 = requireFactory();
|
|
104547
104911
|
const Shape_1 = requireShape();
|
|
@@ -104791,7 +105155,7 @@ void main() {
|
|
|
104791
105155
|
if (hasRequiredTransformer) return Transformer;
|
|
104792
105156
|
hasRequiredTransformer = 1;
|
|
104793
105157
|
Object.defineProperty(Transformer, "__esModule", { value: true });
|
|
104794
|
-
Transformer.Transformer =
|
|
105158
|
+
Transformer.Transformer = void 0;
|
|
104795
105159
|
const Util_1 = requireUtil();
|
|
104796
105160
|
const Factory_1 = requireFactory();
|
|
104797
105161
|
const Node_1 = requireNode();
|
|
@@ -104988,10 +105352,12 @@ void main() {
|
|
|
104988
105352
|
this.update();
|
|
104989
105353
|
}
|
|
104990
105354
|
};
|
|
104991
|
-
|
|
104992
|
-
|
|
104993
|
-
|
|
104994
|
-
|
|
105355
|
+
if (node._attrsAffectingSize.length) {
|
|
105356
|
+
const additionalEvents = node._attrsAffectingSize
|
|
105357
|
+
.map((prop) => prop + 'Change.' + this._getEventNamespace())
|
|
105358
|
+
.join(' ');
|
|
105359
|
+
node.on(additionalEvents, onChange);
|
|
105360
|
+
}
|
|
104995
105361
|
node.on(TRANSFORM_CHANGE_STR.map((e) => e + `.${this._getEventNamespace()}`).join(' '), onChange);
|
|
104996
105362
|
node.on(`absoluteTransformChange.${this._getEventNamespace()}`, onChange);
|
|
104997
105363
|
this._proxyDrag(node);
|
|
@@ -105310,10 +105676,10 @@ void main() {
|
|
|
105310
105676
|
else {
|
|
105311
105677
|
keepProportion = this.keepRatio() || e.shiftKey;
|
|
105312
105678
|
}
|
|
105313
|
-
|
|
105679
|
+
let centeredScaling = this.centeredScaling() || e.altKey;
|
|
105314
105680
|
if (this._movingAnchorName === 'top-left') {
|
|
105315
105681
|
if (keepProportion) {
|
|
105316
|
-
|
|
105682
|
+
const comparePoint = centeredScaling
|
|
105317
105683
|
? {
|
|
105318
105684
|
x: this.width() / 2,
|
|
105319
105685
|
y: this.height() / 2,
|
|
@@ -105324,8 +105690,8 @@ void main() {
|
|
|
105324
105690
|
};
|
|
105325
105691
|
newHypotenuse = Math.sqrt(Math.pow(comparePoint.x - anchorNode.x(), 2) +
|
|
105326
105692
|
Math.pow(comparePoint.y - anchorNode.y(), 2));
|
|
105327
|
-
|
|
105328
|
-
|
|
105693
|
+
const reverseX = this.findOne('.top-left').x() > comparePoint.x ? -1 : 1;
|
|
105694
|
+
const reverseY = this.findOne('.top-left').y() > comparePoint.y ? -1 : 1;
|
|
105329
105695
|
x = newHypotenuse * this.cos * reverseX;
|
|
105330
105696
|
y = newHypotenuse * this.sin * reverseY;
|
|
105331
105697
|
this.findOne('.top-left').x(comparePoint.x - x);
|
|
@@ -105337,7 +105703,7 @@ void main() {
|
|
|
105337
105703
|
}
|
|
105338
105704
|
else if (this._movingAnchorName === 'top-right') {
|
|
105339
105705
|
if (keepProportion) {
|
|
105340
|
-
|
|
105706
|
+
const comparePoint = centeredScaling
|
|
105341
105707
|
? {
|
|
105342
105708
|
x: this.width() / 2,
|
|
105343
105709
|
y: this.height() / 2,
|
|
@@ -105348,8 +105714,8 @@ void main() {
|
|
|
105348
105714
|
};
|
|
105349
105715
|
newHypotenuse = Math.sqrt(Math.pow(anchorNode.x() - comparePoint.x, 2) +
|
|
105350
105716
|
Math.pow(comparePoint.y - anchorNode.y(), 2));
|
|
105351
|
-
|
|
105352
|
-
|
|
105717
|
+
const reverseX = this.findOne('.top-right').x() < comparePoint.x ? -1 : 1;
|
|
105718
|
+
const reverseY = this.findOne('.top-right').y() > comparePoint.y ? -1 : 1;
|
|
105353
105719
|
x = newHypotenuse * this.cos * reverseX;
|
|
105354
105720
|
y = newHypotenuse * this.sin * reverseY;
|
|
105355
105721
|
this.findOne('.top-right').x(comparePoint.x + x);
|
|
@@ -105367,7 +105733,7 @@ void main() {
|
|
|
105367
105733
|
}
|
|
105368
105734
|
else if (this._movingAnchorName === 'bottom-left') {
|
|
105369
105735
|
if (keepProportion) {
|
|
105370
|
-
|
|
105736
|
+
const comparePoint = centeredScaling
|
|
105371
105737
|
? {
|
|
105372
105738
|
x: this.width() / 2,
|
|
105373
105739
|
y: this.height() / 2,
|
|
@@ -105378,8 +105744,8 @@ void main() {
|
|
|
105378
105744
|
};
|
|
105379
105745
|
newHypotenuse = Math.sqrt(Math.pow(comparePoint.x - anchorNode.x(), 2) +
|
|
105380
105746
|
Math.pow(anchorNode.y() - comparePoint.y, 2));
|
|
105381
|
-
|
|
105382
|
-
|
|
105747
|
+
const reverseX = comparePoint.x < anchorNode.x() ? -1 : 1;
|
|
105748
|
+
const reverseY = anchorNode.y() < comparePoint.y ? -1 : 1;
|
|
105383
105749
|
x = newHypotenuse * this.cos * reverseX;
|
|
105384
105750
|
y = newHypotenuse * this.sin * reverseY;
|
|
105385
105751
|
anchorNode.x(comparePoint.x - x);
|
|
@@ -105394,7 +105760,7 @@ void main() {
|
|
|
105394
105760
|
}
|
|
105395
105761
|
else if (this._movingAnchorName === 'bottom-right') {
|
|
105396
105762
|
if (keepProportion) {
|
|
105397
|
-
|
|
105763
|
+
const comparePoint = centeredScaling
|
|
105398
105764
|
? {
|
|
105399
105765
|
x: this.width() / 2,
|
|
105400
105766
|
y: this.height() / 2,
|
|
@@ -105405,8 +105771,8 @@ void main() {
|
|
|
105405
105771
|
};
|
|
105406
105772
|
newHypotenuse = Math.sqrt(Math.pow(anchorNode.x() - comparePoint.x, 2) +
|
|
105407
105773
|
Math.pow(anchorNode.y() - comparePoint.y, 2));
|
|
105408
|
-
|
|
105409
|
-
|
|
105774
|
+
const reverseX = this.findOne('.bottom-right').x() < comparePoint.x ? -1 : 1;
|
|
105775
|
+
const reverseY = this.findOne('.bottom-right').y() < comparePoint.y ? -1 : 1;
|
|
105410
105776
|
x = newHypotenuse * this.cos * reverseX;
|
|
105411
105777
|
y = newHypotenuse * this.sin * reverseY;
|
|
105412
105778
|
this.findOne('.bottom-right').x(comparePoint.x + x);
|
|
@@ -105417,7 +105783,7 @@ void main() {
|
|
|
105417
105783
|
console.error(new Error('Wrong position argument of selection resizer: ' +
|
|
105418
105784
|
this._movingAnchorName));
|
|
105419
105785
|
}
|
|
105420
|
-
|
|
105786
|
+
centeredScaling = this.centeredScaling() || e.altKey;
|
|
105421
105787
|
if (centeredScaling) {
|
|
105422
105788
|
const topLeft = this.findOne('.top-left');
|
|
105423
105789
|
const bottomRight = this.findOne('.bottom-right');
|
|
@@ -105466,12 +105832,12 @@ void main() {
|
|
|
105466
105832
|
const node = this.getNode();
|
|
105467
105833
|
activeTransformersCount--;
|
|
105468
105834
|
this._fire('transformend', { evt: e, target: node });
|
|
105469
|
-
(_a = this.getLayer()) === null || _a ===
|
|
105835
|
+
(_a = this.getLayer()) === null || _a === void 0 ? void 0 : _a.batchDraw();
|
|
105470
105836
|
if (node) {
|
|
105471
105837
|
this._nodes.forEach((target) => {
|
|
105472
105838
|
var _a;
|
|
105473
105839
|
target._fire('transformend', { evt: e, target });
|
|
105474
|
-
(_a = target.getLayer()) === null || _a ===
|
|
105840
|
+
(_a = target.getLayer()) === null || _a === void 0 ? void 0 : _a.batchDraw();
|
|
105475
105841
|
});
|
|
105476
105842
|
}
|
|
105477
105843
|
this._movingAnchorName = null;
|
|
@@ -105584,7 +105950,7 @@ void main() {
|
|
|
105584
105950
|
.multiply(localTransform);
|
|
105585
105951
|
const attrs = newLocalTransform.decompose();
|
|
105586
105952
|
node.setAttrs(attrs);
|
|
105587
|
-
(_a = node.getLayer()) === null || _a ===
|
|
105953
|
+
(_a = node.getLayer()) === null || _a === void 0 ? void 0 : _a.batchDraw();
|
|
105588
105954
|
});
|
|
105589
105955
|
this.rotation(Util_1.Util._getRotation(newAttrs.rotation));
|
|
105590
105956
|
this._nodes.forEach((node) => {
|
|
@@ -105699,7 +106065,7 @@ void main() {
|
|
|
105699
106065
|
styleFunc(node);
|
|
105700
106066
|
});
|
|
105701
106067
|
}
|
|
105702
|
-
(_a = this.getLayer()) === null || _a ===
|
|
106068
|
+
(_a = this.getLayer()) === null || _a === void 0 ? void 0 : _a.batchDraw();
|
|
105703
106069
|
}
|
|
105704
106070
|
isTransforming() {
|
|
105705
106071
|
return this._transforming;
|
|
@@ -105806,7 +106172,7 @@ void main() {
|
|
|
105806
106172
|
if (hasRequiredWedge) return Wedge;
|
|
105807
106173
|
hasRequiredWedge = 1;
|
|
105808
106174
|
Object.defineProperty(Wedge, "__esModule", { value: true });
|
|
105809
|
-
Wedge.Wedge =
|
|
106175
|
+
Wedge.Wedge = void 0;
|
|
105810
106176
|
const Factory_1 = requireFactory();
|
|
105811
106177
|
const Shape_1 = requireShape();
|
|
105812
106178
|
const Global_1 = requireGlobal();
|
|
@@ -105857,7 +106223,7 @@ void main() {
|
|
|
105857
106223
|
if (hasRequiredBlur) return Blur;
|
|
105858
106224
|
hasRequiredBlur = 1;
|
|
105859
106225
|
Object.defineProperty(Blur, "__esModule", { value: true });
|
|
105860
|
-
Blur.Blur =
|
|
106226
|
+
Blur.Blur = void 0;
|
|
105861
106227
|
const Factory_1 = requireFactory();
|
|
105862
106228
|
const Node_1 = requireNode();
|
|
105863
106229
|
const Validators_1 = requireValidators();
|
|
@@ -105905,10 +106271,10 @@ void main() {
|
|
|
105905
106271
|
];
|
|
105906
106272
|
function filterGaussBlurRGBA(imageData, radius) {
|
|
105907
106273
|
const pixels = imageData.data, width = imageData.width, height = imageData.height;
|
|
105908
|
-
let
|
|
106274
|
+
let p, yi, yw, r_sum, g_sum, b_sum, a_sum, r_out_sum, g_out_sum, b_out_sum, a_out_sum, r_in_sum, g_in_sum, b_in_sum, a_in_sum, pr, pg, pb, pa, rbs;
|
|
105909
106275
|
const div = radius + radius + 1, widthMinus1 = width - 1, heightMinus1 = height - 1, radiusPlus1 = radius + 1, sumFactor = (radiusPlus1 * (radiusPlus1 + 1)) / 2, stackStart = new BlurStack(), mul_sum = mul_table[radius], shg_sum = shg_table[radius];
|
|
105910
106276
|
let stackEnd = null, stack = stackStart, stackIn = null, stackOut = null;
|
|
105911
|
-
for (i = 1; i < div; i++) {
|
|
106277
|
+
for (let i = 1; i < div; i++) {
|
|
105912
106278
|
stack = stack.next = new BlurStack();
|
|
105913
106279
|
if (i === radiusPlus1) {
|
|
105914
106280
|
stackEnd = stack;
|
|
@@ -105916,7 +106282,7 @@ void main() {
|
|
|
105916
106282
|
}
|
|
105917
106283
|
stack.next = stackStart;
|
|
105918
106284
|
yw = yi = 0;
|
|
105919
|
-
for (y = 0; y < height; y++) {
|
|
106285
|
+
for (let y = 0; y < height; y++) {
|
|
105920
106286
|
r_in_sum =
|
|
105921
106287
|
g_in_sum =
|
|
105922
106288
|
b_in_sum =
|
|
@@ -105935,14 +106301,14 @@ void main() {
|
|
|
105935
106301
|
b_sum += sumFactor * pb;
|
|
105936
106302
|
a_sum += sumFactor * pa;
|
|
105937
106303
|
stack = stackStart;
|
|
105938
|
-
for (i = 0; i < radiusPlus1; i++) {
|
|
106304
|
+
for (let i = 0; i < radiusPlus1; i++) {
|
|
105939
106305
|
stack.r = pr;
|
|
105940
106306
|
stack.g = pg;
|
|
105941
106307
|
stack.b = pb;
|
|
105942
106308
|
stack.a = pa;
|
|
105943
106309
|
stack = stack.next;
|
|
105944
106310
|
}
|
|
105945
|
-
for (i = 1; i < radiusPlus1; i++) {
|
|
106311
|
+
for (let i = 1; i < radiusPlus1; i++) {
|
|
105946
106312
|
p = yi + ((widthMinus1 < i ? widthMinus1 : i) << 2);
|
|
105947
106313
|
r_sum += (stack.r = pr = pixels[p]) * (rbs = radiusPlus1 - i);
|
|
105948
106314
|
g_sum += (stack.g = pg = pixels[p + 1]) * rbs;
|
|
@@ -105956,7 +106322,7 @@ void main() {
|
|
|
105956
106322
|
}
|
|
105957
106323
|
stackIn = stackStart;
|
|
105958
106324
|
stackOut = stackEnd;
|
|
105959
|
-
for (x = 0; x < width; x++) {
|
|
106325
|
+
for (let x = 0; x < width; x++) {
|
|
105960
106326
|
pixels[yi + 3] = pa = (a_sum * mul_sum) >> shg_sum;
|
|
105961
106327
|
if (pa !== 0) {
|
|
105962
106328
|
pa = 255 / pa;
|
|
@@ -105998,7 +106364,7 @@ void main() {
|
|
|
105998
106364
|
}
|
|
105999
106365
|
yw += width;
|
|
106000
106366
|
}
|
|
106001
|
-
for (x = 0; x < width; x++) {
|
|
106367
|
+
for (let x = 0; x < width; x++) {
|
|
106002
106368
|
g_in_sum =
|
|
106003
106369
|
b_in_sum =
|
|
106004
106370
|
a_in_sum =
|
|
@@ -106018,15 +106384,15 @@ void main() {
|
|
|
106018
106384
|
b_sum += sumFactor * pb;
|
|
106019
106385
|
a_sum += sumFactor * pa;
|
|
106020
106386
|
stack = stackStart;
|
|
106021
|
-
for (i = 0; i < radiusPlus1; i++) {
|
|
106387
|
+
for (let i = 0; i < radiusPlus1; i++) {
|
|
106022
106388
|
stack.r = pr;
|
|
106023
106389
|
stack.g = pg;
|
|
106024
106390
|
stack.b = pb;
|
|
106025
106391
|
stack.a = pa;
|
|
106026
106392
|
stack = stack.next;
|
|
106027
106393
|
}
|
|
106028
|
-
yp = width;
|
|
106029
|
-
for (i = 1; i <= radius; i++) {
|
|
106394
|
+
let yp = width;
|
|
106395
|
+
for (let i = 1; i <= radius; i++) {
|
|
106030
106396
|
yi = (yp + x) << 2;
|
|
106031
106397
|
r_sum += (stack.r = pr = pixels[yi]) * (rbs = radiusPlus1 - i);
|
|
106032
106398
|
g_sum += (stack.g = pg = pixels[yi + 1]) * rbs;
|
|
@@ -106044,7 +106410,7 @@ void main() {
|
|
|
106044
106410
|
yi = x;
|
|
106045
106411
|
stackIn = stackStart;
|
|
106046
106412
|
stackOut = stackEnd;
|
|
106047
|
-
for (y = 0; y < height; y++) {
|
|
106413
|
+
for (let y = 0; y < height; y++) {
|
|
106048
106414
|
p = yi << 2;
|
|
106049
106415
|
pixels[p + 3] = pa = (a_sum * mul_sum) >> shg_sum;
|
|
106050
106416
|
if (pa > 0) {
|
|
@@ -106105,7 +106471,7 @@ void main() {
|
|
|
106105
106471
|
if (hasRequiredBrighten) return Brighten;
|
|
106106
106472
|
hasRequiredBrighten = 1;
|
|
106107
106473
|
Object.defineProperty(Brighten, "__esModule", { value: true });
|
|
106108
|
-
Brighten.Brighten =
|
|
106474
|
+
Brighten.Brighten = void 0;
|
|
106109
106475
|
const Factory_1 = requireFactory();
|
|
106110
106476
|
const Node_1 = requireNode();
|
|
106111
106477
|
const Validators_1 = requireValidators();
|
|
@@ -106130,7 +106496,7 @@ void main() {
|
|
|
106130
106496
|
if (hasRequiredContrast) return Contrast;
|
|
106131
106497
|
hasRequiredContrast = 1;
|
|
106132
106498
|
Object.defineProperty(Contrast, "__esModule", { value: true });
|
|
106133
|
-
Contrast.Contrast =
|
|
106499
|
+
Contrast.Contrast = void 0;
|
|
106134
106500
|
const Factory_1 = requireFactory();
|
|
106135
106501
|
const Node_1 = requireNode();
|
|
106136
106502
|
const Validators_1 = requireValidators();
|
|
@@ -106178,7 +106544,7 @@ void main() {
|
|
|
106178
106544
|
if (hasRequiredEmboss) return Emboss;
|
|
106179
106545
|
hasRequiredEmboss = 1;
|
|
106180
106546
|
Object.defineProperty(Emboss, "__esModule", { value: true });
|
|
106181
|
-
Emboss.Emboss =
|
|
106547
|
+
Emboss.Emboss = void 0;
|
|
106182
106548
|
const Factory_1 = requireFactory();
|
|
106183
106549
|
const Node_1 = requireNode();
|
|
106184
106550
|
const Util_1 = requireUtil();
|
|
@@ -106294,7 +106660,7 @@ void main() {
|
|
|
106294
106660
|
if (hasRequiredEnhance) return Enhance;
|
|
106295
106661
|
hasRequiredEnhance = 1;
|
|
106296
106662
|
Object.defineProperty(Enhance, "__esModule", { value: true });
|
|
106297
|
-
Enhance.Enhance =
|
|
106663
|
+
Enhance.Enhance = void 0;
|
|
106298
106664
|
const Factory_1 = requireFactory();
|
|
106299
106665
|
const Node_1 = requireNode();
|
|
106300
106666
|
const Validators_1 = requireValidators();
|
|
@@ -106352,7 +106718,7 @@ void main() {
|
|
|
106352
106718
|
bMax = 255;
|
|
106353
106719
|
bMin = 0;
|
|
106354
106720
|
}
|
|
106355
|
-
let
|
|
106721
|
+
let rGoalMax, rGoalMin, gGoalMax, gGoalMin, bGoalMax, bGoalMin;
|
|
106356
106722
|
if (enhanceAmount > 0) {
|
|
106357
106723
|
rGoalMax = rMax + enhanceAmount * (255 - rMax);
|
|
106358
106724
|
rGoalMin = rMin - enhanceAmount * (rMin - 0);
|
|
@@ -106362,13 +106728,13 @@ void main() {
|
|
|
106362
106728
|
bGoalMin = bMin - enhanceAmount * (bMin - 0);
|
|
106363
106729
|
}
|
|
106364
106730
|
else {
|
|
106365
|
-
rMid = (rMax + rMin) * 0.5;
|
|
106731
|
+
const rMid = (rMax + rMin) * 0.5;
|
|
106366
106732
|
rGoalMax = rMax + enhanceAmount * (rMax - rMid);
|
|
106367
106733
|
rGoalMin = rMin + enhanceAmount * (rMin - rMid);
|
|
106368
|
-
gMid = (gMax + gMin) * 0.5;
|
|
106734
|
+
const gMid = (gMax + gMin) * 0.5;
|
|
106369
106735
|
gGoalMax = gMax + enhanceAmount * (gMax - gMid);
|
|
106370
106736
|
gGoalMin = gMin + enhanceAmount * (gMin - gMid);
|
|
106371
|
-
bMid = (bMax + bMin) * 0.5;
|
|
106737
|
+
const bMid = (bMax + bMin) * 0.5;
|
|
106372
106738
|
bGoalMax = bMax + enhanceAmount * (bMax - bMid);
|
|
106373
106739
|
bGoalMin = bMin + enhanceAmount * (bMin - bMid);
|
|
106374
106740
|
}
|
|
@@ -106391,7 +106757,7 @@ void main() {
|
|
|
106391
106757
|
if (hasRequiredGrayscale) return Grayscale;
|
|
106392
106758
|
hasRequiredGrayscale = 1;
|
|
106393
106759
|
Object.defineProperty(Grayscale, "__esModule", { value: true });
|
|
106394
|
-
Grayscale.Grayscale =
|
|
106760
|
+
Grayscale.Grayscale = void 0;
|
|
106395
106761
|
const Grayscale$1 = function (imageData) {
|
|
106396
106762
|
const data = imageData.data, len = data.length;
|
|
106397
106763
|
for (let i = 0; i < len; i += 4) {
|
|
@@ -106413,7 +106779,7 @@ void main() {
|
|
|
106413
106779
|
if (hasRequiredHSL) return HSL;
|
|
106414
106780
|
hasRequiredHSL = 1;
|
|
106415
106781
|
Object.defineProperty(HSL, "__esModule", { value: true });
|
|
106416
|
-
HSL.HSL =
|
|
106782
|
+
HSL.HSL = void 0;
|
|
106417
106783
|
const Factory_1 = requireFactory();
|
|
106418
106784
|
const Node_1 = requireNode();
|
|
106419
106785
|
const Validators_1 = requireValidators();
|
|
@@ -106450,7 +106816,7 @@ void main() {
|
|
|
106450
106816
|
if (hasRequiredHSV) return HSV;
|
|
106451
106817
|
hasRequiredHSV = 1;
|
|
106452
106818
|
Object.defineProperty(HSV, "__esModule", { value: true });
|
|
106453
|
-
HSV.HSV =
|
|
106819
|
+
HSV.HSV = void 0;
|
|
106454
106820
|
const Factory_1 = requireFactory();
|
|
106455
106821
|
const Node_1 = requireNode();
|
|
106456
106822
|
const Validators_1 = requireValidators();
|
|
@@ -106460,12 +106826,11 @@ void main() {
|
|
|
106460
106826
|
const rr = 0.299 * v + 0.701 * vsu + 0.167 * vsw, rg = 0.587 * v - 0.587 * vsu + 0.33 * vsw, rb = 0.114 * v - 0.114 * vsu - 0.497 * vsw;
|
|
106461
106827
|
const gr = 0.299 * v - 0.299 * vsu - 0.328 * vsw, gg = 0.587 * v + 0.413 * vsu + 0.035 * vsw, gb = 0.114 * v - 0.114 * vsu + 0.293 * vsw;
|
|
106462
106828
|
const br = 0.299 * v - 0.3 * vsu + 1.25 * vsw, bg = 0.587 * v - 0.586 * vsu - 1.05 * vsw, bb = 0.114 * v + 0.886 * vsu - 0.2 * vsw;
|
|
106463
|
-
let r, g, b, a;
|
|
106464
106829
|
for (let i = 0; i < nPixels; i += 4) {
|
|
106465
|
-
r = data[i + 0];
|
|
106466
|
-
g = data[i + 1];
|
|
106467
|
-
b = data[i + 2];
|
|
106468
|
-
a = data[i + 3];
|
|
106830
|
+
const r = data[i + 0];
|
|
106831
|
+
const g = data[i + 1];
|
|
106832
|
+
const b = data[i + 2];
|
|
106833
|
+
const a = data[i + 3];
|
|
106469
106834
|
data[i + 0] = rr * r + rg * g + rb * b;
|
|
106470
106835
|
data[i + 1] = gr * r + gg * g + gb * b;
|
|
106471
106836
|
data[i + 2] = br * r + bg * g + bb * b;
|
|
@@ -106487,7 +106852,7 @@ void main() {
|
|
|
106487
106852
|
if (hasRequiredInvert) return Invert;
|
|
106488
106853
|
hasRequiredInvert = 1;
|
|
106489
106854
|
Object.defineProperty(Invert, "__esModule", { value: true });
|
|
106490
|
-
Invert.Invert =
|
|
106855
|
+
Invert.Invert = void 0;
|
|
106491
106856
|
const Invert$1 = function (imageData) {
|
|
106492
106857
|
const data = imageData.data, len = data.length;
|
|
106493
106858
|
for (let i = 0; i < len; i += 4) {
|
|
@@ -106508,7 +106873,7 @@ void main() {
|
|
|
106508
106873
|
if (hasRequiredKaleidoscope) return Kaleidoscope;
|
|
106509
106874
|
hasRequiredKaleidoscope = 1;
|
|
106510
106875
|
Object.defineProperty(Kaleidoscope, "__esModule", { value: true });
|
|
106511
|
-
Kaleidoscope.Kaleidoscope =
|
|
106876
|
+
Kaleidoscope.Kaleidoscope = void 0;
|
|
106512
106877
|
const Factory_1 = requireFactory();
|
|
106513
106878
|
const Node_1 = requireNode();
|
|
106514
106879
|
const Util_1 = requireUtil();
|
|
@@ -106654,7 +107019,7 @@ void main() {
|
|
|
106654
107019
|
if (hasRequiredMask) return Mask;
|
|
106655
107020
|
hasRequiredMask = 1;
|
|
106656
107021
|
Object.defineProperty(Mask, "__esModule", { value: true });
|
|
106657
|
-
Mask.Mask =
|
|
107022
|
+
Mask.Mask = void 0;
|
|
106658
107023
|
const Factory_1 = requireFactory();
|
|
106659
107024
|
const Node_1 = requireNode();
|
|
106660
107025
|
const Validators_1 = requireValidators();
|
|
@@ -106808,7 +107173,7 @@ void main() {
|
|
|
106808
107173
|
if (hasRequiredNoise) return Noise;
|
|
106809
107174
|
hasRequiredNoise = 1;
|
|
106810
107175
|
Object.defineProperty(Noise, "__esModule", { value: true });
|
|
106811
|
-
Noise.Noise =
|
|
107176
|
+
Noise.Noise = void 0;
|
|
106812
107177
|
const Factory_1 = requireFactory();
|
|
106813
107178
|
const Node_1 = requireNode();
|
|
106814
107179
|
const Validators_1 = requireValidators();
|
|
@@ -106833,37 +107198,37 @@ void main() {
|
|
|
106833
107198
|
if (hasRequiredPixelate) return Pixelate;
|
|
106834
107199
|
hasRequiredPixelate = 1;
|
|
106835
107200
|
Object.defineProperty(Pixelate, "__esModule", { value: true });
|
|
106836
|
-
Pixelate.Pixelate =
|
|
107201
|
+
Pixelate.Pixelate = void 0;
|
|
106837
107202
|
const Factory_1 = requireFactory();
|
|
106838
107203
|
const Util_1 = requireUtil();
|
|
106839
107204
|
const Node_1 = requireNode();
|
|
106840
107205
|
const Validators_1 = requireValidators();
|
|
106841
107206
|
const Pixelate$1 = function (imageData) {
|
|
106842
|
-
let pixelSize = Math.ceil(this.pixelSize()), width = imageData.width, height = imageData.height,
|
|
107207
|
+
let pixelSize = Math.ceil(this.pixelSize()), width = imageData.width, height = imageData.height, nBinsX = Math.ceil(width / pixelSize), nBinsY = Math.ceil(height / pixelSize), data = imageData.data;
|
|
106843
107208
|
if (pixelSize <= 0) {
|
|
106844
107209
|
Util_1.Util.error('pixelSize value can not be <= 0');
|
|
106845
107210
|
return;
|
|
106846
107211
|
}
|
|
106847
|
-
for (xBin = 0; xBin < nBinsX; xBin += 1) {
|
|
106848
|
-
for (yBin = 0; yBin < nBinsY; yBin += 1) {
|
|
106849
|
-
red = 0;
|
|
106850
|
-
green = 0;
|
|
106851
|
-
blue = 0;
|
|
106852
|
-
alpha = 0;
|
|
106853
|
-
xBinStart = xBin * pixelSize;
|
|
106854
|
-
xBinEnd = xBinStart + pixelSize;
|
|
106855
|
-
yBinStart = yBin * pixelSize;
|
|
106856
|
-
yBinEnd = yBinStart + pixelSize;
|
|
106857
|
-
pixelsInBin = 0;
|
|
106858
|
-
for (x = xBinStart; x < xBinEnd; x += 1) {
|
|
107212
|
+
for (let xBin = 0; xBin < nBinsX; xBin += 1) {
|
|
107213
|
+
for (let yBin = 0; yBin < nBinsY; yBin += 1) {
|
|
107214
|
+
let red = 0;
|
|
107215
|
+
let green = 0;
|
|
107216
|
+
let blue = 0;
|
|
107217
|
+
let alpha = 0;
|
|
107218
|
+
const xBinStart = xBin * pixelSize;
|
|
107219
|
+
const xBinEnd = xBinStart + pixelSize;
|
|
107220
|
+
const yBinStart = yBin * pixelSize;
|
|
107221
|
+
const yBinEnd = yBinStart + pixelSize;
|
|
107222
|
+
let pixelsInBin = 0;
|
|
107223
|
+
for (let x = xBinStart; x < xBinEnd; x += 1) {
|
|
106859
107224
|
if (x >= width) {
|
|
106860
107225
|
continue;
|
|
106861
107226
|
}
|
|
106862
|
-
for (y = yBinStart; y < yBinEnd; y += 1) {
|
|
107227
|
+
for (let y = yBinStart; y < yBinEnd; y += 1) {
|
|
106863
107228
|
if (y >= height) {
|
|
106864
107229
|
continue;
|
|
106865
107230
|
}
|
|
106866
|
-
i = (width * y + x) * 4;
|
|
107231
|
+
const i = (width * y + x) * 4;
|
|
106867
107232
|
red += data[i + 0];
|
|
106868
107233
|
green += data[i + 1];
|
|
106869
107234
|
blue += data[i + 2];
|
|
@@ -106875,15 +107240,15 @@ void main() {
|
|
|
106875
107240
|
green = green / pixelsInBin;
|
|
106876
107241
|
blue = blue / pixelsInBin;
|
|
106877
107242
|
alpha = alpha / pixelsInBin;
|
|
106878
|
-
for (x = xBinStart; x < xBinEnd; x += 1) {
|
|
107243
|
+
for (let x = xBinStart; x < xBinEnd; x += 1) {
|
|
106879
107244
|
if (x >= width) {
|
|
106880
107245
|
continue;
|
|
106881
107246
|
}
|
|
106882
|
-
for (y = yBinStart; y < yBinEnd; y += 1) {
|
|
107247
|
+
for (let y = yBinStart; y < yBinEnd; y += 1) {
|
|
106883
107248
|
if (y >= height) {
|
|
106884
107249
|
continue;
|
|
106885
107250
|
}
|
|
106886
|
-
i = (width * y + x) * 4;
|
|
107251
|
+
const i = (width * y + x) * 4;
|
|
106887
107252
|
data[i + 0] = red;
|
|
106888
107253
|
data[i + 1] = green;
|
|
106889
107254
|
data[i + 2] = blue;
|
|
@@ -106906,7 +107271,7 @@ void main() {
|
|
|
106906
107271
|
if (hasRequiredPosterize) return Posterize;
|
|
106907
107272
|
hasRequiredPosterize = 1;
|
|
106908
107273
|
Object.defineProperty(Posterize, "__esModule", { value: true });
|
|
106909
|
-
Posterize.Posterize =
|
|
107274
|
+
Posterize.Posterize = void 0;
|
|
106910
107275
|
const Factory_1 = requireFactory();
|
|
106911
107276
|
const Node_1 = requireNode();
|
|
106912
107277
|
const Validators_1 = requireValidators();
|
|
@@ -106929,7 +107294,7 @@ void main() {
|
|
|
106929
107294
|
if (hasRequiredRGB) return RGB;
|
|
106930
107295
|
hasRequiredRGB = 1;
|
|
106931
107296
|
Object.defineProperty(RGB, "__esModule", { value: true });
|
|
106932
|
-
RGB.RGB =
|
|
107297
|
+
RGB.RGB = void 0;
|
|
106933
107298
|
const Factory_1 = requireFactory();
|
|
106934
107299
|
const Node_1 = requireNode();
|
|
106935
107300
|
const Validators_1 = requireValidators();
|
|
@@ -106980,7 +107345,7 @@ void main() {
|
|
|
106980
107345
|
if (hasRequiredRGBA) return RGBA;
|
|
106981
107346
|
hasRequiredRGBA = 1;
|
|
106982
107347
|
Object.defineProperty(RGBA, "__esModule", { value: true });
|
|
106983
|
-
RGBA.RGBA =
|
|
107348
|
+
RGBA.RGBA = void 0;
|
|
106984
107349
|
const Factory_1 = requireFactory();
|
|
106985
107350
|
const Node_1 = requireNode();
|
|
106986
107351
|
const Validators_1 = requireValidators();
|
|
@@ -107042,7 +107407,7 @@ void main() {
|
|
|
107042
107407
|
if (hasRequiredSepia) return Sepia;
|
|
107043
107408
|
hasRequiredSepia = 1;
|
|
107044
107409
|
Object.defineProperty(Sepia, "__esModule", { value: true });
|
|
107045
|
-
Sepia.Sepia =
|
|
107410
|
+
Sepia.Sepia = void 0;
|
|
107046
107411
|
const Sepia$1 = function (imageData) {
|
|
107047
107412
|
const data = imageData.data, nPixels = data.length;
|
|
107048
107413
|
for (let i = 0; i < nPixels; i += 4) {
|
|
@@ -107066,7 +107431,7 @@ void main() {
|
|
|
107066
107431
|
if (hasRequiredSolarize) return Solarize;
|
|
107067
107432
|
hasRequiredSolarize = 1;
|
|
107068
107433
|
Object.defineProperty(Solarize, "__esModule", { value: true });
|
|
107069
|
-
Solarize.Solarize =
|
|
107434
|
+
Solarize.Solarize = void 0;
|
|
107070
107435
|
const Solarize$1 = function (imageData) {
|
|
107071
107436
|
const data = imageData.data, w = imageData.width, h = imageData.height, w4 = w * 4;
|
|
107072
107437
|
let y = h;
|
|
@@ -107105,7 +107470,7 @@ void main() {
|
|
|
107105
107470
|
if (hasRequiredThreshold) return Threshold;
|
|
107106
107471
|
hasRequiredThreshold = 1;
|
|
107107
107472
|
Object.defineProperty(Threshold, "__esModule", { value: true });
|
|
107108
|
-
Threshold.Threshold =
|
|
107473
|
+
Threshold.Threshold = void 0;
|
|
107109
107474
|
const Factory_1 = requireFactory();
|
|
107110
107475
|
const Node_1 = requireNode();
|
|
107111
107476
|
const Validators_1 = requireValidators();
|
|
@@ -107126,7 +107491,7 @@ void main() {
|
|
|
107126
107491
|
if (hasRequired_FullInternals) return _FullInternals;
|
|
107127
107492
|
hasRequired_FullInternals = 1;
|
|
107128
107493
|
Object.defineProperty(_FullInternals, "__esModule", { value: true });
|
|
107129
|
-
_FullInternals.Konva =
|
|
107494
|
+
_FullInternals.Konva = void 0;
|
|
107130
107495
|
const _CoreInternals_1 = require_CoreInternals();
|
|
107131
107496
|
const Arc_1 = requireArc();
|
|
107132
107497
|
const Arrow_1 = requireArrow();
|
|
@@ -107314,7 +107679,7 @@ void main() {
|
|
|
107314
107679
|
} ];
|
|
107315
107680
|
const konvaPoints = [];
|
|
107316
107681
|
const wcsPoints = [];
|
|
107317
|
-
params.points.forEach(
|
|
107682
|
+
params.points.forEach(point => {
|
|
107318
107683
|
konvaPoints.push(point.x, point.y);
|
|
107319
107684
|
const wcsPoint = this._worldTransformer.screenToWorld({
|
|
107320
107685
|
x: point.x,
|
|
@@ -107325,10 +107690,10 @@ void main() {
|
|
|
107325
107690
|
y: wcsPoint.y,
|
|
107326
107691
|
z: wcsPoint.z
|
|
107327
107692
|
});
|
|
107328
|
-
})
|
|
107693
|
+
});
|
|
107329
107694
|
this._ref = new Konva.Line({
|
|
107330
|
-
stroke: (_a = params.color) !== null && _a !==
|
|
107331
|
-
strokeWidth: (_b = params.width) !== null && _b !==
|
|
107695
|
+
stroke: (_a = params.color) !== null && _a !== void 0 ? _a : "#ff0000",
|
|
107696
|
+
strokeWidth: (_b = params.width) !== null && _b !== void 0 ? _b : 4,
|
|
107332
107697
|
globalCompositeOperation: "source-over",
|
|
107333
107698
|
lineCap: "round",
|
|
107334
107699
|
lineJoin: "round",
|
|
@@ -107338,11 +107703,11 @@ void main() {
|
|
|
107338
107703
|
dash: LineTypeSpecs.get(params.type) || []
|
|
107339
107704
|
});
|
|
107340
107705
|
this._ref.setAttr("wcsPoints", wcsPoints);
|
|
107341
|
-
this._ref.on("transform",
|
|
107706
|
+
this._ref.on("transform", e => {
|
|
107342
107707
|
const attrs = e.target.attrs;
|
|
107343
107708
|
if (attrs.rotation !== this._ref.rotation()) this._ref.rotation(attrs.rotation);
|
|
107344
|
-
})
|
|
107345
|
-
this._ref.on("transformend", (
|
|
107709
|
+
});
|
|
107710
|
+
this._ref.on("transformend", () => {
|
|
107346
107711
|
const absoluteTransform = this._ref.getAbsoluteTransform();
|
|
107347
107712
|
const wcsPoints = [];
|
|
107348
107713
|
const points = this._ref.points();
|
|
@@ -107363,8 +107728,8 @@ void main() {
|
|
|
107363
107728
|
});
|
|
107364
107729
|
}
|
|
107365
107730
|
this._ref.setAttr("wcsPoints", wcsPoints);
|
|
107366
|
-
})
|
|
107367
|
-
this._ref.on("dragend", (
|
|
107731
|
+
});
|
|
107732
|
+
this._ref.on("dragend", () => {
|
|
107368
107733
|
const absoluteTransform = this._ref.getAbsoluteTransform();
|
|
107369
107734
|
const wcsPoints = [];
|
|
107370
107735
|
const points = this._ref.points();
|
|
@@ -107385,7 +107750,7 @@ void main() {
|
|
|
107385
107750
|
});
|
|
107386
107751
|
}
|
|
107387
107752
|
this._ref.setAttr("wcsPoints", wcsPoints);
|
|
107388
|
-
})
|
|
107753
|
+
});
|
|
107389
107754
|
this._ref.id(this._ref._id.toString());
|
|
107390
107755
|
}
|
|
107391
107756
|
ref() {
|
|
@@ -107456,11 +107821,11 @@ void main() {
|
|
|
107456
107821
|
addPoints(points) {
|
|
107457
107822
|
let newPoints = this._ref.points();
|
|
107458
107823
|
const wcsPoints = this._ref.getAttr("wcsPoints");
|
|
107459
|
-
points.forEach(
|
|
107824
|
+
points.forEach(point => {
|
|
107460
107825
|
newPoints = newPoints.concat([ point.x, point.y ]);
|
|
107461
107826
|
const wcsPoint = this._worldTransformer.screenToWorld(point);
|
|
107462
107827
|
wcsPoints.push(wcsPoint);
|
|
107463
|
-
})
|
|
107828
|
+
});
|
|
107464
107829
|
this._ref.points(newPoints);
|
|
107465
107830
|
}
|
|
107466
107831
|
updateScreenCoordinates() {
|
|
@@ -107468,7 +107833,7 @@ void main() {
|
|
|
107468
107833
|
const points = [];
|
|
107469
107834
|
let invert = this._ref.getAbsoluteTransform().copy();
|
|
107470
107835
|
invert = invert.invert();
|
|
107471
|
-
wcsPoints.forEach(
|
|
107836
|
+
wcsPoints.forEach(point => {
|
|
107472
107837
|
let screenPoint = this._worldTransformer.worldToScreen(point);
|
|
107473
107838
|
screenPoint = invert.point({
|
|
107474
107839
|
x: screenPoint.x,
|
|
@@ -107476,7 +107841,7 @@ void main() {
|
|
|
107476
107841
|
});
|
|
107477
107842
|
points.push(screenPoint.x);
|
|
107478
107843
|
points.push(screenPoint.y);
|
|
107479
|
-
})
|
|
107844
|
+
});
|
|
107480
107845
|
this._ref.points([]);
|
|
107481
107846
|
this._ref.points(points);
|
|
107482
107847
|
this._ref.clearCache();
|
|
@@ -107509,19 +107874,19 @@ void main() {
|
|
|
107509
107874
|
x: params.position.x,
|
|
107510
107875
|
y: params.position.y,
|
|
107511
107876
|
text: params.text,
|
|
107512
|
-
fontSize: (_a = params.fontSize) !== null && _a !==
|
|
107877
|
+
fontSize: (_a = params.fontSize) !== null && _a !== void 0 ? _a : 34,
|
|
107513
107878
|
fontFamily: this.TEXT_FONT_FAMILY,
|
|
107514
|
-
fill: (_b = params.color) !== null && _b !==
|
|
107879
|
+
fill: (_b = params.color) !== null && _b !== void 0 ? _b : "#ff0000",
|
|
107515
107880
|
align: "left",
|
|
107516
107881
|
draggable: true,
|
|
107517
|
-
rotation: (_c = params.rotation) !== null && _c !==
|
|
107882
|
+
rotation: (_c = params.rotation) !== null && _c !== void 0 ? _c : 0
|
|
107518
107883
|
});
|
|
107519
107884
|
this._ref.width(this._ref.getTextWidth());
|
|
107520
107885
|
this._ref.setAttr("wcsStart", this._worldTransformer.screenToWorld({
|
|
107521
107886
|
x: params.position.x,
|
|
107522
107887
|
y: params.position.y
|
|
107523
107888
|
}));
|
|
107524
|
-
this._ref.on("transform",
|
|
107889
|
+
this._ref.on("transform", e => {
|
|
107525
107890
|
const attrs = e.target.attrs;
|
|
107526
107891
|
if (attrs.rotation !== this._ref.rotation()) this._ref.rotation(attrs.rotation);
|
|
107527
107892
|
const scaleByX = Math.abs(attrs.scaleX - 1) > 1e-5;
|
|
@@ -107543,8 +107908,8 @@ void main() {
|
|
|
107543
107908
|
x: 1,
|
|
107544
107909
|
y: 1
|
|
107545
107910
|
});
|
|
107546
|
-
})
|
|
107547
|
-
this._ref.on("transformend",
|
|
107911
|
+
});
|
|
107912
|
+
this._ref.on("transformend", e => {
|
|
107548
107913
|
const attrs = e.target.attrs;
|
|
107549
107914
|
if (attrs.rotation !== this._ref.rotation()) this._ref.rotation(attrs.rotation);
|
|
107550
107915
|
const absoluteTransform = this._ref.getStage().getAbsoluteTransform();
|
|
@@ -107553,15 +107918,15 @@ void main() {
|
|
|
107553
107918
|
y: this._ref.y()
|
|
107554
107919
|
});
|
|
107555
107920
|
this._ref.setAttr("wcsStart", this._worldTransformer.screenToWorld(position));
|
|
107556
|
-
})
|
|
107557
|
-
this._ref.on("dragend", (
|
|
107921
|
+
});
|
|
107922
|
+
this._ref.on("dragend", () => {
|
|
107558
107923
|
const absoluteTransform = this._ref.getStage().getAbsoluteTransform();
|
|
107559
107924
|
const position = absoluteTransform.point({
|
|
107560
107925
|
x: this._ref.x(),
|
|
107561
107926
|
y: this._ref.y()
|
|
107562
107927
|
});
|
|
107563
107928
|
this._ref.setAttr("wcsStart", this._worldTransformer.screenToWorld(position));
|
|
107564
|
-
})
|
|
107929
|
+
});
|
|
107565
107930
|
this._ref.id(this._ref._id.toString());
|
|
107566
107931
|
}
|
|
107567
107932
|
ref() {
|
|
@@ -107685,15 +108050,15 @@ void main() {
|
|
|
107685
108050
|
}
|
|
107686
108051
|
}
|
|
107687
108052
|
this._ref = new Konva.Rect({
|
|
107688
|
-
stroke: (_a = params.color) !== null && _a !==
|
|
107689
|
-
strokeWidth: (_b = params.lineWidth) !== null && _b !==
|
|
108053
|
+
stroke: (_a = params.color) !== null && _a !== void 0 ? _a : "#ff0000",
|
|
108054
|
+
strokeWidth: (_b = params.lineWidth) !== null && _b !== void 0 ? _b : 4,
|
|
107690
108055
|
globalCompositeOperation: "source-over",
|
|
107691
108056
|
lineCap: "round",
|
|
107692
108057
|
lineJoin: "round",
|
|
107693
108058
|
x: params.position.x,
|
|
107694
108059
|
y: params.position.y,
|
|
107695
|
-
width: (_c = params.width) !== null && _c !==
|
|
107696
|
-
height: (_d = params.height) !== null && _d !==
|
|
108060
|
+
width: (_c = params.width) !== null && _c !== void 0 ? _c : 200,
|
|
108061
|
+
height: (_d = params.height) !== null && _d !== void 0 ? _d : 200,
|
|
107697
108062
|
draggable: true,
|
|
107698
108063
|
strokeScaleEnabled: false
|
|
107699
108064
|
});
|
|
@@ -107705,7 +108070,7 @@ void main() {
|
|
|
107705
108070
|
x: params.position2.x,
|
|
107706
108071
|
y: params.position2.y
|
|
107707
108072
|
}));
|
|
107708
|
-
this._ref.on("transform",
|
|
108073
|
+
this._ref.on("transform", e => {
|
|
107709
108074
|
const attrs = e.target.attrs;
|
|
107710
108075
|
const scaleByX = Math.abs(attrs.scaleX - 1) > 1e-5;
|
|
107711
108076
|
const scaleByY = Math.abs(attrs.scaleY - 1) > 1e-5;
|
|
@@ -107727,8 +108092,8 @@ void main() {
|
|
|
107727
108092
|
x: 1,
|
|
107728
108093
|
y: 1
|
|
107729
108094
|
});
|
|
107730
|
-
})
|
|
107731
|
-
this._ref.on("transformend",
|
|
108095
|
+
});
|
|
108096
|
+
this._ref.on("transformend", e => {
|
|
107732
108097
|
const attrs = e.target.attrs;
|
|
107733
108098
|
if (attrs.rotation !== this._ref.rotation()) this._ref.rotation(attrs.rotation);
|
|
107734
108099
|
const absoluteTransform = this._ref.getStage().getAbsoluteTransform();
|
|
@@ -107741,8 +108106,8 @@ void main() {
|
|
|
107741
108106
|
x: position.x + this._ref.width(),
|
|
107742
108107
|
y: position.y + this._ref.height()
|
|
107743
108108
|
}));
|
|
107744
|
-
})
|
|
107745
|
-
this._ref.on("dragend", (
|
|
108109
|
+
});
|
|
108110
|
+
this._ref.on("dragend", () => {
|
|
107746
108111
|
const absoluteTransform = this._ref.getStage().getAbsoluteTransform();
|
|
107747
108112
|
const position = absoluteTransform.point({
|
|
107748
108113
|
x: this._ref.x(),
|
|
@@ -107753,7 +108118,7 @@ void main() {
|
|
|
107753
108118
|
x: position.x + this._ref.width(),
|
|
107754
108119
|
y: position.y + this._ref.height()
|
|
107755
108120
|
}));
|
|
107756
|
-
})
|
|
108121
|
+
});
|
|
107757
108122
|
this._ref.id(this._ref._id.toString());
|
|
107758
108123
|
}
|
|
107759
108124
|
getPosition() {
|
|
@@ -107894,7 +108259,7 @@ void main() {
|
|
|
107894
108259
|
y: 0
|
|
107895
108260
|
};
|
|
107896
108261
|
if (params.position2) {
|
|
107897
|
-
(_a = params.radius) !== null && _a !==
|
|
108262
|
+
(_a = params.radius) !== null && _a !== void 0 ? _a : params.radius = {
|
|
107898
108263
|
x: 0,
|
|
107899
108264
|
y: 0
|
|
107900
108265
|
};
|
|
@@ -107907,8 +108272,8 @@ void main() {
|
|
|
107907
108272
|
};
|
|
107908
108273
|
}
|
|
107909
108274
|
this._ref = new Konva.Ellipse({
|
|
107910
|
-
stroke: (_b = params.color) !== null && _b !==
|
|
107911
|
-
strokeWidth: (_c = params.lineWidth) !== null && _c !==
|
|
108275
|
+
stroke: (_b = params.color) !== null && _b !== void 0 ? _b : "#ff0000",
|
|
108276
|
+
strokeWidth: (_c = params.lineWidth) !== null && _c !== void 0 ? _c : 4,
|
|
107912
108277
|
globalCompositeOperation: "source-over",
|
|
107913
108278
|
lineCap: "round",
|
|
107914
108279
|
lineJoin: "round",
|
|
@@ -107931,7 +108296,7 @@ void main() {
|
|
|
107931
108296
|
x: this._ref.x(),
|
|
107932
108297
|
y: this._ref.y() + params.radius.y
|
|
107933
108298
|
}));
|
|
107934
|
-
this._ref.on("transform",
|
|
108299
|
+
this._ref.on("transform", e => {
|
|
107935
108300
|
const attrs = e.target.attrs;
|
|
107936
108301
|
if (attrs.rotation !== this._ref.rotation()) this._ref.rotation(attrs.rotation);
|
|
107937
108302
|
const scaleByX = Math.abs(attrs.scaleX - 1) > 1e-5;
|
|
@@ -107966,8 +108331,8 @@ void main() {
|
|
|
107966
108331
|
x: 1,
|
|
107967
108332
|
y: 1
|
|
107968
108333
|
});
|
|
107969
|
-
})
|
|
107970
|
-
this._ref.on("transformend", (
|
|
108334
|
+
});
|
|
108335
|
+
this._ref.on("transformend", () => {
|
|
107971
108336
|
const absoluteTransform = this._ref.getStage().getAbsoluteTransform();
|
|
107972
108337
|
const position = absoluteTransform.point({
|
|
107973
108338
|
x: this._ref.x(),
|
|
@@ -107984,8 +108349,8 @@ void main() {
|
|
|
107984
108349
|
y: this._ref.y() + this._ref.radiusY()
|
|
107985
108350
|
});
|
|
107986
108351
|
this._ref.setAttr("wcsRadiusY", this._worldTransformer.screenToWorld(radiusY));
|
|
107987
|
-
})
|
|
107988
|
-
this._ref.on("dragend", (
|
|
108352
|
+
});
|
|
108353
|
+
this._ref.on("dragend", () => {
|
|
107989
108354
|
const absoluteTransform = this._ref.getStage().getAbsoluteTransform();
|
|
107990
108355
|
const position = absoluteTransform.point({
|
|
107991
108356
|
x: this._ref.x(),
|
|
@@ -108002,7 +108367,7 @@ void main() {
|
|
|
108002
108367
|
y: this._ref.y() + this._ref.radiusY()
|
|
108003
108368
|
});
|
|
108004
108369
|
this._ref.setAttr("wcsRadiusY", this._worldTransformer.screenToWorld(radiusY));
|
|
108005
|
-
})
|
|
108370
|
+
});
|
|
108006
108371
|
this._ref.id(this._ref._id.toString());
|
|
108007
108372
|
}
|
|
108008
108373
|
getPosition() {
|
|
@@ -108127,8 +108492,8 @@ void main() {
|
|
|
108127
108492
|
y: 100
|
|
108128
108493
|
};
|
|
108129
108494
|
this._ref = new Konva.Arrow({
|
|
108130
|
-
stroke: (_a = params.color) !== null && _a !==
|
|
108131
|
-
fill: (_b = params.color) !== null && _b !==
|
|
108495
|
+
stroke: (_a = params.color) !== null && _a !== void 0 ? _a : "#ff0000",
|
|
108496
|
+
fill: (_b = params.color) !== null && _b !== void 0 ? _b : "#ff0000",
|
|
108132
108497
|
strokeWidth: 4,
|
|
108133
108498
|
globalCompositeOperation: "source-over",
|
|
108134
108499
|
lineCap: "round",
|
|
@@ -108145,7 +108510,7 @@ void main() {
|
|
|
108145
108510
|
x: params.end.x,
|
|
108146
108511
|
y: params.end.y
|
|
108147
108512
|
}));
|
|
108148
|
-
this._ref.on("transformend",
|
|
108513
|
+
this._ref.on("transformend", e => {
|
|
108149
108514
|
const attrs = e.target.attrs;
|
|
108150
108515
|
if (attrs.rotation !== this._ref.rotation()) this._ref.rotation(attrs.rotation);
|
|
108151
108516
|
const points = this._ref.points();
|
|
@@ -108160,8 +108525,8 @@ void main() {
|
|
|
108160
108525
|
});
|
|
108161
108526
|
this._ref.setAttr("wcsStart", this._worldTransformer.screenToWorld(transformStart));
|
|
108162
108527
|
this._ref.setAttr("wcsEnd", this._worldTransformer.screenToWorld(transformEnd));
|
|
108163
|
-
})
|
|
108164
|
-
this._ref.on("dragend",
|
|
108528
|
+
});
|
|
108529
|
+
this._ref.on("dragend", e => {
|
|
108165
108530
|
const points = this._ref.points();
|
|
108166
108531
|
const absoluteTransform = e.target.getAbsoluteTransform();
|
|
108167
108532
|
const transformStart = absoluteTransform.point({
|
|
@@ -108174,7 +108539,7 @@ void main() {
|
|
|
108174
108539
|
});
|
|
108175
108540
|
this._ref.setAttr("wcsStart", this._worldTransformer.screenToWorld(transformStart));
|
|
108176
108541
|
this._ref.setAttr("wcsEnd", this._worldTransformer.screenToWorld(transformEnd));
|
|
108177
|
-
})
|
|
108542
|
+
});
|
|
108178
108543
|
this._ref.id(this._ref._id.toString());
|
|
108179
108544
|
}
|
|
108180
108545
|
ref() {
|
|
@@ -108361,15 +108726,15 @@ void main() {
|
|
|
108361
108726
|
x: params.position.x,
|
|
108362
108727
|
y: params.position.y,
|
|
108363
108728
|
image: this._canvasImage,
|
|
108364
|
-
width: (_a = params.width) !== null && _a !==
|
|
108365
|
-
height: (_b = params.height) !== null && _b !==
|
|
108729
|
+
width: (_a = params.width) !== null && _a !== void 0 ? _a : 0,
|
|
108730
|
+
height: (_b = params.height) !== null && _b !== void 0 ? _b : 0,
|
|
108366
108731
|
draggable: true
|
|
108367
108732
|
});
|
|
108368
108733
|
this._ref.setAttr("wcsStart", this._worldTransformer.screenToWorld({
|
|
108369
108734
|
x: params.position.x,
|
|
108370
108735
|
y: params.position.y
|
|
108371
108736
|
}));
|
|
108372
|
-
this._ref.on("transform",
|
|
108737
|
+
this._ref.on("transform", e => {
|
|
108373
108738
|
const attrs = e.target.attrs;
|
|
108374
108739
|
if (attrs.rotation !== this._ref.rotation()) this._ref.rotation(attrs.rotation);
|
|
108375
108740
|
const scaleByX = Math.abs(attrs.scaleX - 1) > 1e-5;
|
|
@@ -108398,8 +108763,8 @@ void main() {
|
|
|
108398
108763
|
x: 1,
|
|
108399
108764
|
y: 1
|
|
108400
108765
|
});
|
|
108401
|
-
})
|
|
108402
|
-
this._ref.on("transformend", (
|
|
108766
|
+
});
|
|
108767
|
+
this._ref.on("transformend", () => {
|
|
108403
108768
|
const absoluteTransform = this._ref.getStage().getAbsoluteTransform();
|
|
108404
108769
|
const position = absoluteTransform.point({
|
|
108405
108770
|
x: this._ref.x(),
|
|
@@ -108410,8 +108775,8 @@ void main() {
|
|
|
108410
108775
|
x: position.x + this._ref.width(),
|
|
108411
108776
|
y: position.y + this._ref.height()
|
|
108412
108777
|
}));
|
|
108413
|
-
})
|
|
108414
|
-
this._ref.on("dragend", (
|
|
108778
|
+
});
|
|
108779
|
+
this._ref.on("dragend", () => {
|
|
108415
108780
|
const absoluteTransform = this._ref.getStage().getAbsoluteTransform();
|
|
108416
108781
|
const position = absoluteTransform.point({
|
|
108417
108782
|
x: this._ref.x(),
|
|
@@ -108422,7 +108787,7 @@ void main() {
|
|
|
108422
108787
|
x: position.x + this._ref.width(),
|
|
108423
108788
|
y: position.y + this._ref.height()
|
|
108424
108789
|
}));
|
|
108425
|
-
})
|
|
108790
|
+
});
|
|
108426
108791
|
this._ref.id(this._ref._id.toString());
|
|
108427
108792
|
}
|
|
108428
108793
|
getSrc() {
|
|
@@ -108576,10 +108941,10 @@ void main() {
|
|
|
108576
108941
|
this._ref = new Konva.Shape({
|
|
108577
108942
|
x: params.position.x,
|
|
108578
108943
|
y: params.position.y,
|
|
108579
|
-
width: (_a = params.width) !== null && _a !==
|
|
108580
|
-
height: (_b = params.height) !== null && _b !==
|
|
108581
|
-
stroke: (_c = params.color) !== null && _c !==
|
|
108582
|
-
strokeWidth: (_d = params.lineWidth) !== null && _d !==
|
|
108944
|
+
width: (_a = params.width) !== null && _a !== void 0 ? _a : 200,
|
|
108945
|
+
height: (_b = params.height) !== null && _b !== void 0 ? _b : 200,
|
|
108946
|
+
stroke: (_c = params.color) !== null && _c !== void 0 ? _c : "#ff0000",
|
|
108947
|
+
strokeWidth: (_d = params.lineWidth) !== null && _d !== void 0 ? _d : 4,
|
|
108583
108948
|
draggable: true,
|
|
108584
108949
|
strokeScaleEnabled: false,
|
|
108585
108950
|
globalCompositeOperation: "source-over",
|
|
@@ -108665,7 +109030,7 @@ void main() {
|
|
|
108665
109030
|
x: params.position2.x,
|
|
108666
109031
|
y: params.position2.y
|
|
108667
109032
|
}));
|
|
108668
|
-
this._ref.on("transform",
|
|
109033
|
+
this._ref.on("transform", e => {
|
|
108669
109034
|
const attrs = e.target.attrs;
|
|
108670
109035
|
const scaleByX = Math.abs(attrs.scaleX - 1) > 1e-5;
|
|
108671
109036
|
const scaleByY = Math.abs(attrs.scaleY - 1) > 1e-5;
|
|
@@ -108685,8 +109050,8 @@ void main() {
|
|
|
108685
109050
|
x: 1,
|
|
108686
109051
|
y: 1
|
|
108687
109052
|
});
|
|
108688
|
-
})
|
|
108689
|
-
this._ref.on("transformend",
|
|
109053
|
+
});
|
|
109054
|
+
this._ref.on("transformend", e => {
|
|
108690
109055
|
const attrs = e.target.attrs;
|
|
108691
109056
|
if (attrs.rotation !== this._ref.rotation()) this._ref.rotation(attrs.rotation);
|
|
108692
109057
|
const absoluteTransform = this._ref.getStage().getAbsoluteTransform();
|
|
@@ -108699,8 +109064,8 @@ void main() {
|
|
|
108699
109064
|
x: position.x + this._ref.width(),
|
|
108700
109065
|
y: position.y + this._ref.height()
|
|
108701
109066
|
}));
|
|
108702
|
-
})
|
|
108703
|
-
this._ref.on("dragend", (
|
|
109067
|
+
});
|
|
109068
|
+
this._ref.on("dragend", () => {
|
|
108704
109069
|
const absoluteTransform = this._ref.getStage().getAbsoluteTransform();
|
|
108705
109070
|
const position = absoluteTransform.point({
|
|
108706
109071
|
x: this._ref.x(),
|
|
@@ -108711,7 +109076,7 @@ void main() {
|
|
|
108711
109076
|
x: position.x + this._ref.width(),
|
|
108712
109077
|
y: position.y + this._ref.height()
|
|
108713
109078
|
}));
|
|
108714
|
-
})
|
|
109079
|
+
});
|
|
108715
109080
|
this._ref.getSelfRect = () => ({
|
|
108716
109081
|
x: 0 - ARC_RADIUS,
|
|
108717
109082
|
y: 0 - ARC_RADIUS,
|
|
@@ -108860,10 +109225,10 @@ void main() {
|
|
|
108860
109225
|
if (timeout) {
|
|
108861
109226
|
clearTimeout(timeout);
|
|
108862
109227
|
}
|
|
108863
|
-
timeout = setTimeout((
|
|
109228
|
+
timeout = setTimeout(() => {
|
|
108864
109229
|
timeout = null;
|
|
108865
109230
|
func(...args);
|
|
108866
|
-
}
|
|
109231
|
+
}, wait);
|
|
108867
109232
|
};
|
|
108868
109233
|
}
|
|
108869
109234
|
|
|
@@ -108876,7 +109241,7 @@ void main() {
|
|
|
108876
109241
|
this.fontSize = 34;
|
|
108877
109242
|
this.changeActiveDragger = event => {
|
|
108878
109243
|
const draggerName = event.data;
|
|
108879
|
-
this._markupContainer.className = this._container.className.split(" ").filter(
|
|
109244
|
+
this._markupContainer.className = this._container.className.split(" ").filter(x => !x.startsWith("oda-cursor-")).filter(x => x).concat(`oda-cursor-${draggerName.toLowerCase()}`).join(" ");
|
|
108880
109245
|
this.removeTextInput();
|
|
108881
109246
|
this.removeImageInput();
|
|
108882
109247
|
this.enableEditMode(draggerName);
|
|
@@ -108888,9 +109253,9 @@ void main() {
|
|
|
108888
109253
|
if (!this._konvaStage) return;
|
|
108889
109254
|
this._konvaStage.width(width);
|
|
108890
109255
|
this._konvaStage.height(height);
|
|
108891
|
-
this.getObjects().forEach(
|
|
109256
|
+
this.getObjects().forEach(markupObject => {
|
|
108892
109257
|
markupObject.updateScreenCoordinates();
|
|
108893
|
-
})
|
|
109258
|
+
});
|
|
108894
109259
|
};
|
|
108895
109260
|
this.resizeViewer = event => {
|
|
108896
109261
|
const {width: width, height: height} = event;
|
|
@@ -108898,19 +109263,19 @@ void main() {
|
|
|
108898
109263
|
if (!this._konvaStage) return;
|
|
108899
109264
|
this._konvaStage.width(width);
|
|
108900
109265
|
this._konvaStage.height(height);
|
|
108901
|
-
this.getObjects().forEach(
|
|
109266
|
+
this.getObjects().forEach(markupObject => {
|
|
108902
109267
|
markupObject.updateScreenCoordinates();
|
|
108903
|
-
})
|
|
109268
|
+
});
|
|
108904
109269
|
};
|
|
108905
109270
|
this.pan = () => {
|
|
108906
|
-
this.getObjects().forEach(
|
|
109271
|
+
this.getObjects().forEach(markupObject => {
|
|
108907
109272
|
markupObject.updateScreenCoordinates();
|
|
108908
|
-
})
|
|
109273
|
+
});
|
|
108909
109274
|
};
|
|
108910
109275
|
this.zoomAt = () => {
|
|
108911
|
-
this.getObjects().forEach(
|
|
109276
|
+
this.getObjects().forEach(markupObject => {
|
|
108912
109277
|
markupObject.updateScreenCoordinates();
|
|
108913
|
-
})
|
|
109278
|
+
});
|
|
108914
109279
|
};
|
|
108915
109280
|
this.redirectToViewer = event => {
|
|
108916
109281
|
if (this._viewer) this._viewer.emit(event);
|
|
@@ -108925,7 +109290,7 @@ void main() {
|
|
|
108925
109290
|
initialize(container, containerEvents, viewer, worldTransformer) {
|
|
108926
109291
|
if (!Konva) throw new Error('Markup error: Konva is not initialized. Forgot to add <script src="https://unpkg.com/konva@9/konva.min.js"><\/script> to your page?');
|
|
108927
109292
|
this._viewer = viewer;
|
|
108928
|
-
this._worldTransformer = worldTransformer !== null && worldTransformer !==
|
|
109293
|
+
this._worldTransformer = worldTransformer !== null && worldTransformer !== void 0 ? worldTransformer : new WorldTransform;
|
|
108929
109294
|
this._container = container;
|
|
108930
109295
|
this._markupContainer = document.createElement("div");
|
|
108931
109296
|
this._markupContainer.id = "markup-container";
|
|
@@ -108953,9 +109318,9 @@ void main() {
|
|
|
108953
109318
|
this._viewer.removeEventListener("changeactivedragger", this.changeActiveDragger);
|
|
108954
109319
|
}
|
|
108955
109320
|
this.destroyKonva();
|
|
108956
|
-
(_a = this._resizeObserver) === null || _a ===
|
|
109321
|
+
(_a = this._resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
108957
109322
|
this._resizeObserver = undefined;
|
|
108958
|
-
(_b = this._markupContainer) === null || _b ===
|
|
109323
|
+
(_b = this._markupContainer) === null || _b === void 0 ? void 0 : _b.remove();
|
|
108959
109324
|
this._markupContainer = undefined;
|
|
108960
109325
|
this._container = undefined;
|
|
108961
109326
|
this._viewer = undefined;
|
|
@@ -108967,7 +109332,7 @@ void main() {
|
|
|
108967
109332
|
this.removeTextInput();
|
|
108968
109333
|
this.removeImageInput();
|
|
108969
109334
|
this.clearSelected();
|
|
108970
|
-
this.getObjects().forEach(
|
|
109335
|
+
this.getObjects().forEach(obj => obj.delete());
|
|
108971
109336
|
}
|
|
108972
109337
|
getMarkupColor() {
|
|
108973
109338
|
return this._markupColor.asRGB();
|
|
@@ -108986,17 +109351,17 @@ void main() {
|
|
|
108986
109351
|
colorizeAllMarkup(r, g, b) {
|
|
108987
109352
|
this.setMarkupColor(r, g, b);
|
|
108988
109353
|
const hexColor = new MarkupColor(r, g, b).asHex();
|
|
108989
|
-
this.getObjects().filter(
|
|
109354
|
+
this.getObjects().filter(obj => {
|
|
108990
109355
|
var _a;
|
|
108991
|
-
return (_a = obj.setColor) === null || _a ===
|
|
108992
|
-
})
|
|
109356
|
+
return (_a = obj.setColor) === null || _a === void 0 ? void 0 : _a.call(obj, hexColor);
|
|
109357
|
+
});
|
|
108993
109358
|
}
|
|
108994
109359
|
colorizeSelectedMarkups(r, g, b) {
|
|
108995
109360
|
const hexColor = new MarkupColor(r, g, b).asHex();
|
|
108996
|
-
this.getSelectedObjects().filter(
|
|
109361
|
+
this.getSelectedObjects().filter(obj => {
|
|
108997
109362
|
var _a;
|
|
108998
|
-
return (_a = obj.setColor) === null || _a ===
|
|
108999
|
-
})
|
|
109363
|
+
return (_a = obj.setColor) === null || _a === void 0 ? void 0 : _a.call(obj, hexColor);
|
|
109364
|
+
});
|
|
109000
109365
|
}
|
|
109001
109366
|
setViewpoint(viewpoint) {
|
|
109002
109367
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
@@ -109011,51 +109376,51 @@ void main() {
|
|
|
109011
109376
|
x: 0,
|
|
109012
109377
|
y: 0
|
|
109013
109378
|
});
|
|
109014
|
-
const markupColor = ((_a = viewpoint.custom_fields) === null || _a ===
|
|
109379
|
+
const markupColor = ((_a = viewpoint.custom_fields) === null || _a === void 0 ? void 0 : _a.markup_color) || {
|
|
109015
109380
|
r: 255,
|
|
109016
109381
|
g: 0,
|
|
109017
109382
|
b: 0
|
|
109018
109383
|
};
|
|
109019
109384
|
this.setMarkupColor(markupColor.r, markupColor.g, markupColor.b);
|
|
109020
|
-
(_b = viewpoint.lines) === null || _b ===
|
|
109385
|
+
(_b = viewpoint.lines) === null || _b === void 0 ? void 0 : _b.forEach(line => {
|
|
109021
109386
|
const linePoints = [];
|
|
109022
|
-
line.points.forEach(
|
|
109387
|
+
line.points.forEach(point => {
|
|
109023
109388
|
const screenPoint = this._worldTransformer.worldToScreen(point);
|
|
109024
109389
|
linePoints.push(screenPoint.x);
|
|
109025
109390
|
linePoints.push(screenPoint.y);
|
|
109026
|
-
})
|
|
109391
|
+
});
|
|
109027
109392
|
this.addLine(linePoints, line.color, line.type, line.width, line.id);
|
|
109028
|
-
})
|
|
109029
|
-
(_c = viewpoint.texts) === null || _c ===
|
|
109393
|
+
});
|
|
109394
|
+
(_c = viewpoint.texts) === null || _c === void 0 ? void 0 : _c.forEach(text => {
|
|
109030
109395
|
const screenPoint = this._worldTransformer.worldToScreen(text.position);
|
|
109031
109396
|
this.addText(text.text, screenPoint, text.angle, text.color, text.text_size, text.font_size, text.id);
|
|
109032
|
-
})
|
|
109033
|
-
(_d = viewpoint.rectangles) === null || _d ===
|
|
109397
|
+
});
|
|
109398
|
+
(_d = viewpoint.rectangles) === null || _d === void 0 ? void 0 : _d.forEach(rect => {
|
|
109034
109399
|
const screenPoint = this._worldTransformer.worldToScreen(rect.position);
|
|
109035
109400
|
const screenPoint2 = rect.position2 ? this._worldTransformer.worldToScreen(rect.position2) : null;
|
|
109036
109401
|
this.addRectangle(screenPoint, screenPoint2, rect.width, rect.height, rect.line_width, rect.color, rect.id);
|
|
109037
|
-
})
|
|
109038
|
-
(_e = viewpoint.ellipses) === null || _e ===
|
|
109402
|
+
});
|
|
109403
|
+
(_e = viewpoint.ellipses) === null || _e === void 0 ? void 0 : _e.forEach(ellipse => {
|
|
109039
109404
|
const screenPoint = this._worldTransformer.worldToScreen(ellipse.position);
|
|
109040
109405
|
const screenPoint2 = ellipse.position2 ? this._worldTransformer.worldToScreen(ellipse.position2) : null;
|
|
109041
109406
|
const screenPoint3 = ellipse.position3 ? this._worldTransformer.worldToScreen(ellipse.position3) : null;
|
|
109042
109407
|
this.addEllipse(screenPoint, screenPoint2, screenPoint3, ellipse.radius, ellipse.line_width, ellipse.color, ellipse.id);
|
|
109043
|
-
})
|
|
109044
|
-
(_f = viewpoint.arrows) === null || _f ===
|
|
109408
|
+
});
|
|
109409
|
+
(_f = viewpoint.arrows) === null || _f === void 0 ? void 0 : _f.forEach(arrow => {
|
|
109045
109410
|
const startPoint = this._worldTransformer.worldToScreen(arrow.start);
|
|
109046
109411
|
const endPoint = this._worldTransformer.worldToScreen(arrow.end);
|
|
109047
109412
|
this.addArrow(startPoint, endPoint, arrow.color, arrow.id);
|
|
109048
|
-
})
|
|
109049
|
-
(_g = viewpoint.clouds) === null || _g ===
|
|
109413
|
+
});
|
|
109414
|
+
(_g = viewpoint.clouds) === null || _g === void 0 ? void 0 : _g.forEach(cloud => {
|
|
109050
109415
|
const screenPoint = this._worldTransformer.worldToScreen(cloud.position);
|
|
109051
109416
|
const screenPoint2 = cloud.position2 ? this._worldTransformer.worldToScreen(cloud.position2) : null;
|
|
109052
109417
|
this.addCloud(screenPoint, screenPoint2, cloud.width, cloud.height, cloud.line_width, cloud.color, cloud.id);
|
|
109053
|
-
})
|
|
109054
|
-
(_h = viewpoint.images) === null || _h ===
|
|
109418
|
+
});
|
|
109419
|
+
(_h = viewpoint.images) === null || _h === void 0 ? void 0 : _h.forEach(image => {
|
|
109055
109420
|
const screenPoint = this._worldTransformer.worldToScreen(image.position);
|
|
109056
109421
|
const screenPoint2 = image.position2 ? this._worldTransformer.worldToScreen(image.position2) : null;
|
|
109057
109422
|
this.addImage(screenPoint, screenPoint2, image.src, image.width, image.height, image.id);
|
|
109058
|
-
})
|
|
109423
|
+
});
|
|
109059
109424
|
}
|
|
109060
109425
|
getViewpoint(viewpoint) {
|
|
109061
109426
|
if (!viewpoint) viewpoint = {};
|
|
@@ -109097,23 +109462,23 @@ void main() {
|
|
|
109097
109462
|
}
|
|
109098
109463
|
getObjects() {
|
|
109099
109464
|
const objects = [];
|
|
109100
|
-
Object.keys(MarkupMode2Konva).forEach(
|
|
109465
|
+
Object.keys(MarkupMode2Konva).forEach(type => {
|
|
109101
109466
|
const konvaShape = MarkupMode2Konva[type];
|
|
109102
|
-
this.konvaLayerFind(type).forEach(
|
|
109103
|
-
})
|
|
109467
|
+
this.konvaLayerFind(type).forEach(ref => objects.push(konvaShape.initializer(ref, null, this._worldTransformer)));
|
|
109468
|
+
});
|
|
109104
109469
|
return objects;
|
|
109105
109470
|
}
|
|
109106
109471
|
getSelectedObjects() {
|
|
109107
109472
|
if (!this._konvaTransformer) return [];
|
|
109108
|
-
return this._konvaTransformer.nodes().map(
|
|
109473
|
+
return this._konvaTransformer.nodes().map(ref => {
|
|
109109
109474
|
const name = ref.className;
|
|
109110
|
-
const konvaShape = Object.values(MarkupMode2Konva).find(
|
|
109475
|
+
const konvaShape = Object.values(MarkupMode2Konva).find(shape => shape.name === name);
|
|
109111
109476
|
return konvaShape ? konvaShape.initializer(ref, null, this._worldTransformer) : null;
|
|
109112
|
-
})
|
|
109477
|
+
}).filter(x => x);
|
|
109113
109478
|
}
|
|
109114
109479
|
selectObjects(objects) {
|
|
109115
109480
|
if (!this._konvaTransformer) return;
|
|
109116
|
-
const selectedObjs = this._konvaTransformer.nodes().concat(objects.map(
|
|
109481
|
+
const selectedObjs = this._konvaTransformer.nodes().concat(objects.map(x => x.ref()));
|
|
109117
109482
|
this._konvaTransformer.nodes(selectedObjs);
|
|
109118
109483
|
}
|
|
109119
109484
|
clearSelected() {
|
|
@@ -109126,7 +109491,7 @@ void main() {
|
|
|
109126
109491
|
if (!this._konvaLayer) return [];
|
|
109127
109492
|
const konvaShape = MarkupMode2Konva[type];
|
|
109128
109493
|
if (!konvaShape || !konvaShape.initializer) return [];
|
|
109129
|
-
return this._konvaLayer.find(konvaShape.name).filter(
|
|
109494
|
+
return this._konvaLayer.find(konvaShape.name).filter(ref => ref.parent === this._konvaLayer || ref.parent === this._groupImages || ref.parent === this._groupGeometry || ref.parent === this._groupTexts);
|
|
109130
109495
|
}
|
|
109131
109496
|
initializeKonva() {
|
|
109132
109497
|
const stage = new Konva.Stage({
|
|
@@ -109157,7 +109522,7 @@ void main() {
|
|
|
109157
109522
|
let lastLine;
|
|
109158
109523
|
let mouseDownPos;
|
|
109159
109524
|
let lastObj;
|
|
109160
|
-
stage.on("mousedown touchstart",
|
|
109525
|
+
stage.on("mousedown touchstart", e => {
|
|
109161
109526
|
if (!this._markupIsActive || e.target !== stage || this._markupMode === "Text" || this._markupMode === "Image") return;
|
|
109162
109527
|
if (e.target === stage && transformer.nodes().length > 0) {
|
|
109163
109528
|
transformer.nodes([]);
|
|
@@ -109165,12 +109530,12 @@ void main() {
|
|
|
109165
109530
|
}
|
|
109166
109531
|
const pos = this.getRelativePointerPosition(stage);
|
|
109167
109532
|
mouseDownPos = pos;
|
|
109168
|
-
isPaint = [ "Arrow", "Cloud", "Ellipse", "Line", "Rectangle" ].some(
|
|
109533
|
+
isPaint = [ "Arrow", "Cloud", "Ellipse", "Line", "Rectangle" ].some(m => m === this._markupMode);
|
|
109169
109534
|
if (this._markupMode === "Line") {
|
|
109170
109535
|
lastLine = this.addLine([ pos.x, pos.y, pos.x, pos.y ]);
|
|
109171
109536
|
}
|
|
109172
|
-
})
|
|
109173
|
-
stage.on("mouseup touchend", (
|
|
109537
|
+
});
|
|
109538
|
+
stage.on("mouseup touchend", () => {
|
|
109174
109539
|
if (!this._markupIsActive) return;
|
|
109175
109540
|
if (isPaint) {
|
|
109176
109541
|
const pos = this.getRelativePointerPosition(stage);
|
|
@@ -109211,8 +109576,8 @@ void main() {
|
|
|
109211
109576
|
}
|
|
109212
109577
|
lastObj = undefined;
|
|
109213
109578
|
isPaint = false;
|
|
109214
|
-
})
|
|
109215
|
-
stage.on("mousemove touchmove", (
|
|
109579
|
+
});
|
|
109580
|
+
stage.on("mousemove touchmove", () => {
|
|
109216
109581
|
if (!this._markupIsActive) return;
|
|
109217
109582
|
if (!isPaint) {
|
|
109218
109583
|
return;
|
|
@@ -109267,8 +109632,8 @@ void main() {
|
|
|
109267
109632
|
y: startY
|
|
109268
109633
|
}, null, dX, dY);
|
|
109269
109634
|
}
|
|
109270
|
-
})
|
|
109271
|
-
stage.on("click tap",
|
|
109635
|
+
});
|
|
109636
|
+
stage.on("click tap", e => {
|
|
109272
109637
|
if (!this._markupIsActive) return;
|
|
109273
109638
|
if (e.target === stage) {
|
|
109274
109639
|
if (this._markupMode === "Text") {
|
|
@@ -109310,7 +109675,7 @@ void main() {
|
|
|
109310
109675
|
this.removeImageInput();
|
|
109311
109676
|
}
|
|
109312
109677
|
}
|
|
109313
|
-
if (transformer.nodes().filter(
|
|
109678
|
+
if (transformer.nodes().filter(x => x.className === "Cloud" || x.className === "Image").length > 0 || e.target.className === "Cloud" || e.target.className === "Image") {
|
|
109314
109679
|
transformer.rotateEnabled(false);
|
|
109315
109680
|
} else {
|
|
109316
109681
|
transformer.rotateEnabled(true);
|
|
@@ -109327,26 +109692,26 @@ void main() {
|
|
|
109327
109692
|
const nodes = transformer.nodes().concat([ e.target ]);
|
|
109328
109693
|
transformer.nodes(nodes);
|
|
109329
109694
|
}
|
|
109330
|
-
})
|
|
109695
|
+
});
|
|
109331
109696
|
const container = stage.container();
|
|
109332
109697
|
container.tabIndex = 1;
|
|
109333
109698
|
container.focus();
|
|
109334
|
-
container.addEventListener("keydown",
|
|
109699
|
+
container.addEventListener("keydown", e => {
|
|
109335
109700
|
if (!this._markupIsActive) return;
|
|
109336
109701
|
if (e.code === "Delete") {
|
|
109337
|
-
this.getSelectedObjects().forEach(
|
|
109702
|
+
this.getSelectedObjects().forEach(obj => obj.delete());
|
|
109338
109703
|
this.clearSelected();
|
|
109339
109704
|
return;
|
|
109340
109705
|
}
|
|
109341
109706
|
e.preventDefault();
|
|
109342
|
-
})
|
|
109707
|
+
});
|
|
109343
109708
|
}
|
|
109344
109709
|
destroyKonva() {
|
|
109345
109710
|
var _a;
|
|
109346
109711
|
this.removeTextInput();
|
|
109347
109712
|
this.removeImageInput();
|
|
109348
109713
|
this.clearOverlay();
|
|
109349
|
-
(_a = this._konvaStage) === null || _a ===
|
|
109714
|
+
(_a = this._konvaStage) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
109350
109715
|
this._groupImages = undefined;
|
|
109351
109716
|
this._groupGeometry = undefined;
|
|
109352
109717
|
this._groupTexts = undefined;
|
|
@@ -109356,7 +109721,7 @@ void main() {
|
|
|
109356
109721
|
}
|
|
109357
109722
|
getMarkupLines() {
|
|
109358
109723
|
const lines = [];
|
|
109359
|
-
this.konvaLayerFind("Line").forEach(
|
|
109724
|
+
this.konvaLayerFind("Line").forEach(ref => {
|
|
109360
109725
|
const wcsPoints = ref.getAttr("wcsPoints");
|
|
109361
109726
|
if (!wcsPoints) return;
|
|
109362
109727
|
const konvaLine = new KonvaLine(null, ref, this._worldTransformer);
|
|
@@ -109368,12 +109733,12 @@ void main() {
|
|
|
109368
109733
|
width: konvaLine.getLineWidth() || this.lineWidth
|
|
109369
109734
|
};
|
|
109370
109735
|
lines.push(line);
|
|
109371
|
-
})
|
|
109736
|
+
});
|
|
109372
109737
|
return lines;
|
|
109373
109738
|
}
|
|
109374
109739
|
getMarkupTexts() {
|
|
109375
109740
|
const texts = [];
|
|
109376
|
-
this.konvaLayerFind("Text").forEach(
|
|
109741
|
+
this.konvaLayerFind("Text").forEach(ref => {
|
|
109377
109742
|
const textSize = .02;
|
|
109378
109743
|
const textScale = this._worldTransformer.getScale();
|
|
109379
109744
|
const wcsPosition = ref.getAttr("wcsStart");
|
|
@@ -109389,12 +109754,12 @@ void main() {
|
|
|
109389
109754
|
font_size: shape.getFontSize() * stageAbsoluteTransform.getMatrix()[0]
|
|
109390
109755
|
};
|
|
109391
109756
|
texts.push(text);
|
|
109392
|
-
})
|
|
109757
|
+
});
|
|
109393
109758
|
return texts;
|
|
109394
109759
|
}
|
|
109395
109760
|
getMarkupRectangles() {
|
|
109396
109761
|
const rectangles = [];
|
|
109397
|
-
this.konvaLayerFind("Rectangle").forEach(
|
|
109762
|
+
this.konvaLayerFind("Rectangle").forEach(ref => {
|
|
109398
109763
|
const wcsStart = ref.getAttr("wcsStart");
|
|
109399
109764
|
const wcsEnd = ref.getAttr("wcsEnd");
|
|
109400
109765
|
const screenStart = this._worldTransformer.worldToScreen(wcsStart);
|
|
@@ -109410,12 +109775,12 @@ void main() {
|
|
|
109410
109775
|
color: shape.getColor()
|
|
109411
109776
|
};
|
|
109412
109777
|
rectangles.push(rectangle);
|
|
109413
|
-
})
|
|
109778
|
+
});
|
|
109414
109779
|
return rectangles;
|
|
109415
109780
|
}
|
|
109416
109781
|
getMarkupEllipses() {
|
|
109417
109782
|
const ellipses = [];
|
|
109418
|
-
this.konvaLayerFind("Ellipse").forEach(
|
|
109783
|
+
this.konvaLayerFind("Ellipse").forEach(ref => {
|
|
109419
109784
|
const wcsPosition = ref.getAttr("wcsPosition");
|
|
109420
109785
|
const wcsPosition2 = ref.getAttr("wcsRadiusX");
|
|
109421
109786
|
const wcsPosition3 = ref.getAttr("wcsRadiusY");
|
|
@@ -109435,12 +109800,12 @@ void main() {
|
|
|
109435
109800
|
color: shape.getColor()
|
|
109436
109801
|
};
|
|
109437
109802
|
ellipses.push(ellipse);
|
|
109438
|
-
})
|
|
109803
|
+
});
|
|
109439
109804
|
return ellipses;
|
|
109440
109805
|
}
|
|
109441
109806
|
getMarkupArrows() {
|
|
109442
109807
|
const arrows = [];
|
|
109443
|
-
this.konvaLayerFind("Arrow").forEach(
|
|
109808
|
+
this.konvaLayerFind("Arrow").forEach(ref => {
|
|
109444
109809
|
const wcsStart = ref.getAttr("wcsStart");
|
|
109445
109810
|
const wcsEnd = ref.getAttr("wcsEnd");
|
|
109446
109811
|
const shape = new KonvaArrow(null, ref, this._worldTransformer);
|
|
@@ -109451,12 +109816,12 @@ void main() {
|
|
|
109451
109816
|
color: shape.getColor()
|
|
109452
109817
|
};
|
|
109453
109818
|
arrows.push(arrow);
|
|
109454
|
-
})
|
|
109819
|
+
});
|
|
109455
109820
|
return arrows;
|
|
109456
109821
|
}
|
|
109457
109822
|
getMarkupImages() {
|
|
109458
109823
|
const images = [];
|
|
109459
|
-
this.konvaLayerFind("Image").forEach(
|
|
109824
|
+
this.konvaLayerFind("Image").forEach(ref => {
|
|
109460
109825
|
const wcsStart = ref.getAttr("wcsStart");
|
|
109461
109826
|
const wcsEnd = ref.getAttr("wcsEnd");
|
|
109462
109827
|
const stageAbsoluteTransform = this._konvaStage.getAbsoluteTransform();
|
|
@@ -109471,12 +109836,12 @@ void main() {
|
|
|
109471
109836
|
height: shape.getHeight() * scale
|
|
109472
109837
|
};
|
|
109473
109838
|
images.push(image);
|
|
109474
|
-
})
|
|
109839
|
+
});
|
|
109475
109840
|
return images;
|
|
109476
109841
|
}
|
|
109477
109842
|
getMarkupClouds() {
|
|
109478
109843
|
const clouds = [];
|
|
109479
|
-
this.konvaLayerFind("Cloud").forEach(
|
|
109844
|
+
this.konvaLayerFind("Cloud").forEach(ref => {
|
|
109480
109845
|
const wcsStart = ref.getAttr("wcsStart");
|
|
109481
109846
|
const wcsEnd = ref.getAttr("wcsEnd");
|
|
109482
109847
|
const screenStart = this._worldTransformer.worldToScreen(wcsStart);
|
|
@@ -109492,7 +109857,7 @@ void main() {
|
|
|
109492
109857
|
color: shape.getColor()
|
|
109493
109858
|
};
|
|
109494
109859
|
clouds.push(cloud);
|
|
109495
|
-
})
|
|
109860
|
+
});
|
|
109496
109861
|
return clouds;
|
|
109497
109862
|
}
|
|
109498
109863
|
combineMarkupWithDrawing() {
|
|
@@ -109553,23 +109918,23 @@ void main() {
|
|
|
109553
109918
|
};
|
|
109554
109919
|
if (text) this._textInputRef.value = text;
|
|
109555
109920
|
document.body.appendChild(this._textInputRef);
|
|
109556
|
-
setTimeout((
|
|
109921
|
+
setTimeout(() => {
|
|
109557
109922
|
this._textInputRef.focus();
|
|
109558
|
-
}
|
|
109923
|
+
}, 50);
|
|
109559
109924
|
} else {
|
|
109560
109925
|
this.removeTextInput();
|
|
109561
109926
|
}
|
|
109562
109927
|
}
|
|
109563
109928
|
removeTextInput() {
|
|
109564
109929
|
var _a;
|
|
109565
|
-
(_a = this._textInputRef) === null || _a ===
|
|
109930
|
+
(_a = this._textInputRef) === null || _a === void 0 ? void 0 : _a.remove();
|
|
109566
109931
|
this._textInputRef = null;
|
|
109567
109932
|
this._textInputPos = null;
|
|
109568
109933
|
this._textInputAngle = 0;
|
|
109569
109934
|
}
|
|
109570
109935
|
createImageInput(pos) {
|
|
109571
109936
|
if (!this._imageInputRef) {
|
|
109572
|
-
const convertBase64 = file => new Promise((
|
|
109937
|
+
const convertBase64 = file => new Promise((resolve, reject) => {
|
|
109573
109938
|
const fileReader = new FileReader;
|
|
109574
109939
|
fileReader.readAsDataURL(file);
|
|
109575
109940
|
fileReader.onload = () => {
|
|
@@ -109578,7 +109943,7 @@ void main() {
|
|
|
109578
109943
|
fileReader.onerror = error => {
|
|
109579
109944
|
reject(error);
|
|
109580
109945
|
};
|
|
109581
|
-
})
|
|
109946
|
+
});
|
|
109582
109947
|
this._imageInputPos = pos;
|
|
109583
109948
|
this._imageInputRef = document.createElement("input");
|
|
109584
109949
|
this._imageInputRef.style.display = "none";
|
|
@@ -109596,23 +109961,23 @@ void main() {
|
|
|
109596
109961
|
this.removeImageInput();
|
|
109597
109962
|
};
|
|
109598
109963
|
document.body.appendChild(this._imageInputRef);
|
|
109599
|
-
setTimeout((
|
|
109964
|
+
setTimeout(() => {
|
|
109600
109965
|
this._imageInputRef.click();
|
|
109601
|
-
}
|
|
109966
|
+
}, 50);
|
|
109602
109967
|
} else {
|
|
109603
109968
|
this.removeImageInput();
|
|
109604
109969
|
}
|
|
109605
109970
|
}
|
|
109606
109971
|
removeImageInput() {
|
|
109607
109972
|
var _a;
|
|
109608
|
-
(_a = this._imageInputRef) === null || _a ===
|
|
109973
|
+
(_a = this._imageInputRef) === null || _a === void 0 ? void 0 : _a.remove();
|
|
109609
109974
|
this._imageInputRef = null;
|
|
109610
109975
|
this._imageInputPos = null;
|
|
109611
109976
|
}
|
|
109612
109977
|
addText(text, position, angle, color, textSize, fontSize, id) {
|
|
109613
109978
|
var _a;
|
|
109614
109979
|
if (!text) return;
|
|
109615
|
-
(_a = this.getSelectedObjects().
|
|
109980
|
+
(_a = this.getSelectedObjects().shift()) === null || _a === void 0 ? void 0 : _a.delete();
|
|
109616
109981
|
this.clearSelected();
|
|
109617
109982
|
this.removeTextInput();
|
|
109618
109983
|
const tolerance = 1e-6;
|
|
@@ -109691,7 +110056,7 @@ void main() {
|
|
|
109691
110056
|
addImage(position, position2, src, width, height, id) {
|
|
109692
110057
|
var _a;
|
|
109693
110058
|
if (!position || !src) return;
|
|
109694
|
-
(_a = this.getSelectedObjects().
|
|
110059
|
+
(_a = this.getSelectedObjects().shift()) === null || _a === void 0 ? void 0 : _a.delete();
|
|
109695
110060
|
this.clearSelected();
|
|
109696
110061
|
this.removeImageInput();
|
|
109697
110062
|
const konvaImage = new KonvaImage({
|
|
@@ -109793,7 +110158,7 @@ void main() {
|
|
|
109793
110158
|
this.target = new Vector3();
|
|
109794
110159
|
this._activeDragger = null;
|
|
109795
110160
|
this._components = [];
|
|
109796
|
-
this.
|
|
110161
|
+
this._renderTime = 0;
|
|
109797
110162
|
this.render = this.render.bind(this);
|
|
109798
110163
|
this.update = this.update.bind(this);
|
|
109799
110164
|
this._markup = new KonvaMarkup();
|
|
@@ -109857,6 +110222,7 @@ void main() {
|
|
|
109857
110222
|
this.composer.addPass(this.fxaaPass);
|
|
109858
110223
|
this.composer.addPass(this.ssaaRenderPass);
|
|
109859
110224
|
this.composer.addPass(this.outputPass);
|
|
110225
|
+
this.composer.setSize(width, height);
|
|
109860
110226
|
this.canvas = canvas;
|
|
109861
110227
|
this.canvasEvents.forEach((x) => canvas.addEventListener(x, this.canvaseventlistener));
|
|
109862
110228
|
this._markup.initialize(this.canvas, this.canvasEvents, this, this);
|
|
@@ -109865,8 +110231,8 @@ void main() {
|
|
|
109865
110231
|
}
|
|
109866
110232
|
this.syncOptions();
|
|
109867
110233
|
this.syncOverlay();
|
|
109868
|
-
this.
|
|
109869
|
-
this.render(this.
|
|
110234
|
+
this._renderTime = performance.now();
|
|
110235
|
+
this.render(this._renderTime);
|
|
109870
110236
|
if (typeof onProgress === "function")
|
|
109871
110237
|
onProgress(new ProgressEvent("progress", { lengthComputable: true, loaded: 1, total: 1 }));
|
|
109872
110238
|
this.emitEvent({ type: "initializeprogress", data: 1, loaded: 1, total: 1 });
|
|
@@ -109918,8 +110284,27 @@ void main() {
|
|
|
109918
110284
|
isInitialized() {
|
|
109919
110285
|
return !!this.renderer;
|
|
109920
110286
|
}
|
|
110287
|
+
setSize(width, height, updateStyle = true) {
|
|
110288
|
+
if (!this.renderer)
|
|
110289
|
+
return;
|
|
110290
|
+
const camera = this.camera;
|
|
110291
|
+
const aspect = width / height;
|
|
110292
|
+
if (camera.isPerspectiveCamera) {
|
|
110293
|
+
camera.aspect = aspect;
|
|
110294
|
+
camera.updateProjectionMatrix();
|
|
110295
|
+
}
|
|
110296
|
+
if (camera.isOrthographicCamera) {
|
|
110297
|
+
camera.left = camera.bottom * aspect;
|
|
110298
|
+
camera.right = camera.top * aspect;
|
|
110299
|
+
camera.updateProjectionMatrix();
|
|
110300
|
+
}
|
|
110301
|
+
this.renderer.setSize(width, height, updateStyle);
|
|
110302
|
+
this.composer.setSize(width, height);
|
|
110303
|
+
this.update(true);
|
|
110304
|
+
this.emitEvent({ type: "resize", width, height });
|
|
110305
|
+
}
|
|
109921
110306
|
update(force = false) {
|
|
109922
|
-
this.
|
|
110307
|
+
this._renderNeeded = true;
|
|
109923
110308
|
if (force)
|
|
109924
110309
|
this.render();
|
|
109925
110310
|
this.emitEvent({ type: "update", data: force });
|
|
@@ -109928,13 +110313,13 @@ void main() {
|
|
|
109928
110313
|
var _a, _b;
|
|
109929
110314
|
if (!this.renderer)
|
|
109930
110315
|
return;
|
|
109931
|
-
if (!
|
|
110316
|
+
if (!this._renderNeeded && !force)
|
|
109932
110317
|
return;
|
|
109933
110318
|
if (!time)
|
|
109934
110319
|
time = performance.now();
|
|
109935
|
-
const deltaTime = (time - this.
|
|
109936
|
-
this.
|
|
109937
|
-
this.
|
|
110320
|
+
const deltaTime = (time - this._renderTime) / 1000;
|
|
110321
|
+
this._renderTime = time;
|
|
110322
|
+
this._renderNeeded = false;
|
|
109938
110323
|
if (this.options.antialiasing === true || this.options.antialiasing === "msaa") {
|
|
109939
110324
|
this.renderer.render(this.scene, this.camera);
|
|
109940
110325
|
this.renderer.render(this.helpers, this.camera);
|
|
@@ -109942,7 +110327,7 @@ void main() {
|
|
|
109942
110327
|
else {
|
|
109943
110328
|
this.composer.render(deltaTime);
|
|
109944
110329
|
}
|
|
109945
|
-
(_b = (_a = this._activeDragger) === null || _a ===
|
|
110330
|
+
(_b = (_a = this._activeDragger) === null || _a === void 0 ? void 0 : _a.updatePreview) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
109946
110331
|
this.emitEvent({ type: "render", time, deltaTime });
|
|
109947
110332
|
}
|
|
109948
110333
|
loadReferences(model) {
|
|
@@ -110161,7 +110546,7 @@ void main() {
|
|
|
110161
110546
|
newDragger = draggers.createDragger(name, this);
|
|
110162
110547
|
if (newDragger) {
|
|
110163
110548
|
this._activeDragger = newDragger;
|
|
110164
|
-
(_b = (_a = this._activeDragger).initialize) === null || _b ===
|
|
110549
|
+
(_b = (_a = this._activeDragger).initialize) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
110165
110550
|
}
|
|
110166
110551
|
}
|
|
110167
110552
|
const canvas = this.canvas;
|
|
@@ -110266,7 +110651,7 @@ void main() {
|
|
|
110266
110651
|
}
|
|
110267
110652
|
};
|
|
110268
110653
|
const setClippingPlanes = (clipping_planes) => {
|
|
110269
|
-
clipping_planes === null || clipping_planes ===
|
|
110654
|
+
clipping_planes === null || clipping_planes === void 0 ? void 0 : clipping_planes.forEach((clipping_plane) => {
|
|
110270
110655
|
const plane = new Plane();
|
|
110271
110656
|
plane.setFromNormalAndCoplanarPoint(getVector3FromPoint3d(clipping_plane.direction), getVector3FromPoint3d(clipping_plane.location));
|
|
110272
110657
|
this.renderer.clippingPlanes.push(plane);
|
|
@@ -110276,7 +110661,7 @@ void main() {
|
|
|
110276
110661
|
if (selection)
|
|
110277
110662
|
this.setSelected(selection.map((component) => component.handle));
|
|
110278
110663
|
};
|
|
110279
|
-
const draggerName = (_a = this._activeDragger) === null || _a ===
|
|
110664
|
+
const draggerName = (_a = this._activeDragger) === null || _a === void 0 ? void 0 : _a.name;
|
|
110280
110665
|
this.setActiveDragger();
|
|
110281
110666
|
this.clearSlices();
|
|
110282
110667
|
this.clearOverlay();
|
|
@@ -110288,7 +110673,7 @@ void main() {
|
|
|
110288
110673
|
setClippingPlanes(viewpoint.clipping_planes);
|
|
110289
110674
|
setSelection(viewpoint.selection);
|
|
110290
110675
|
this._markup.setViewpoint(viewpoint);
|
|
110291
|
-
this.target = getVector3FromPoint3d((_c = (_b = viewpoint.custom_fields) === null || _b ===
|
|
110676
|
+
this.target = getVector3FromPoint3d((_c = (_b = viewpoint.custom_fields) === null || _b === void 0 ? void 0 : _b.camera_target) !== null && _c !== void 0 ? _c : this.target);
|
|
110292
110677
|
this.setActiveDragger(draggerName);
|
|
110293
110678
|
this.emitEvent({ type: "drawviewpoint", data: viewpoint });
|
|
110294
110679
|
this.update();
|