@inweb/viewer-three 26.9.2 → 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.map +1 -1
- package/dist/plugins/components/AxesHelperComponent.min.js +1 -1
- package/dist/plugins/components/AxesHelperComponent.module.js +1 -1
- 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 +1 -1
- package/dist/plugins/loaders/PotreeLoader.js.map +1 -1
- package/dist/plugins/loaders/PotreeLoader.min.js +1 -1
- package/dist/plugins/loaders/PotreeLoader.module.js +2 -2
- package/dist/plugins/loaders/PotreeLoader.module.js.map +1 -1
- package/dist/viewer-three.js +1210 -839
- package/dist/viewer-three.js.map +1 -1
- package/dist/viewer-three.min.js +3 -3
- package/dist/viewer-three.module.js +559 -270
- package/dist/viewer-three.module.js.map +1 -1
- 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 +5 -5
- 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/WalkDragger.ts +10 -2
- package/src/Viewer/draggers/index.ts +2 -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;
|
|
@@ -81555,11 +81555,16 @@ void main() {
|
|
|
81555
81555
|
// acknowledge and accept the above terms.
|
|
81556
81556
|
///////////////////////////////////////////////////////////////////////////////
|
|
81557
81557
|
class WalkControls extends Controls {
|
|
81558
|
-
constructor(camera, canvas) {
|
|
81558
|
+
constructor(camera, canvas, groundObjects, viewer) {
|
|
81559
81559
|
super(camera, canvas);
|
|
81560
|
-
this.
|
|
81561
|
-
this.
|
|
81562
|
-
this.
|
|
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;
|
|
81563
81568
|
this.moveWheel = 0;
|
|
81564
81569
|
this.mouseDragOn = false;
|
|
81565
81570
|
this.onPointerDown = (event) => {
|
|
@@ -81626,6 +81631,15 @@ void main() {
|
|
|
81626
81631
|
if (this.moveKeys.delete(event.code))
|
|
81627
81632
|
this.update();
|
|
81628
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;
|
|
81629
81643
|
this.moveKeys = new Set();
|
|
81630
81644
|
this.moveClock = new Clock();
|
|
81631
81645
|
this.quaternion = camera.quaternion.clone();
|
|
@@ -81649,23 +81663,80 @@ void main() {
|
|
|
81649
81663
|
window.removeEventListener("keyup", this.onKeyUp);
|
|
81650
81664
|
super.dispose();
|
|
81651
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
|
+
}
|
|
81652
81704
|
update() {
|
|
81705
|
+
let moved = false;
|
|
81706
|
+
let upgradeGroundFollowing = false;
|
|
81707
|
+
const forward = new Vector3();
|
|
81708
|
+
const sideways = new Vector3();
|
|
81653
81709
|
if (this.moveKeys.size > 0) {
|
|
81710
|
+
upgradeGroundFollowing = true;
|
|
81654
81711
|
const timeDelta = this.moveClock.getDelta();
|
|
81655
|
-
const moveDelta = timeDelta * this.
|
|
81656
|
-
|
|
81657
|
-
|
|
81658
|
-
|
|
81659
|
-
|
|
81660
|
-
|
|
81661
|
-
|
|
81662
|
-
if (this.moveKeys.has("
|
|
81663
|
-
this.object.
|
|
81664
|
-
|
|
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")) {
|
|
81665
81732
|
this.object.translateY(moveDelta);
|
|
81666
|
-
|
|
81733
|
+
upgradeGroundFollowing = false;
|
|
81734
|
+
}
|
|
81735
|
+
if (this.moveKeys.has("KeyE")) {
|
|
81667
81736
|
this.object.translateY(-moveDelta);
|
|
81668
|
-
|
|
81737
|
+
upgradeGroundFollowing = false;
|
|
81738
|
+
}
|
|
81739
|
+
const lookDelta = this.LOOK_SPEED + (this.multiplier - 1);
|
|
81669
81740
|
if (this.moveKeys.has("ArrowUp"))
|
|
81670
81741
|
this.rotateCamera(this.rotateDelta.add(new Vector2(0, -lookDelta / 2)));
|
|
81671
81742
|
if (this.moveKeys.has("ArrowDown"))
|
|
@@ -81675,12 +81746,20 @@ void main() {
|
|
|
81675
81746
|
if (this.moveKeys.has("ArrowRight"))
|
|
81676
81747
|
this.rotateCamera(this.rotateDelta.add(new Vector2(-lookDelta, 0)));
|
|
81677
81748
|
this.moveWheel = 0;
|
|
81678
|
-
|
|
81749
|
+
moved = true;
|
|
81679
81750
|
}
|
|
81680
81751
|
if (this.moveWheel !== 0) {
|
|
81681
|
-
const moveDelta = this.moveWheel *
|
|
81682
|
-
this.object.
|
|
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);
|
|
81683
81757
|
this.moveWheel += -1 * Math.sign(this.moveWheel);
|
|
81758
|
+
moved = true;
|
|
81759
|
+
}
|
|
81760
|
+
if (upgradeGroundFollowing)
|
|
81761
|
+
this.updateGroundFollowing();
|
|
81762
|
+
if (moved) {
|
|
81684
81763
|
this.dispatchEvent({ type: "change" });
|
|
81685
81764
|
}
|
|
81686
81765
|
if (this.moveKeys.size === 0 && this.moveWheel === 0) {
|
|
@@ -81742,7 +81821,15 @@ void main() {
|
|
|
81742
81821
|
this.viewerZoom = () => {
|
|
81743
81822
|
this.controls.rotateDelta.set(0, 0);
|
|
81744
81823
|
};
|
|
81745
|
-
|
|
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);
|
|
81746
81833
|
this.controls.addEventListener("change", this.controlsChange);
|
|
81747
81834
|
this.controls.addEventListener("walkspeedchange", this.walkspeedChange);
|
|
81748
81835
|
this.viewer = viewer;
|
|
@@ -81781,11 +81868,150 @@ void main() {
|
|
|
81781
81868
|
// By use of this software, its documentation or related materials, you
|
|
81782
81869
|
// acknowledge and accept the above terms.
|
|
81783
81870
|
///////////////////////////////////////////////////////////////////////////////
|
|
81784
|
-
class
|
|
81785
|
-
constructor(
|
|
81786
|
-
super(
|
|
81787
|
-
this.
|
|
81788
|
-
|
|
81871
|
+
class FlyControls extends Controls {
|
|
81872
|
+
constructor(camera, canvas) {
|
|
81873
|
+
super(camera, canvas);
|
|
81874
|
+
this.movementSpeed = 0.2;
|
|
81875
|
+
this.lookSpeed = 5;
|
|
81876
|
+
this.multiplier = 5;
|
|
81877
|
+
this.moveWheel = 0;
|
|
81878
|
+
this.mouseDragOn = false;
|
|
81879
|
+
this.onPointerDown = (event) => {
|
|
81880
|
+
if (event.button !== 0)
|
|
81881
|
+
return;
|
|
81882
|
+
this.domElement.setPointerCapture(event.pointerId);
|
|
81883
|
+
this.downPosition.set(event.clientX, event.clientY);
|
|
81884
|
+
this.quaternion.copy(this.object.quaternion);
|
|
81885
|
+
this.mouseDragOn = true;
|
|
81886
|
+
};
|
|
81887
|
+
this.onPointerMove = (event) => {
|
|
81888
|
+
if (!this.mouseDragOn)
|
|
81889
|
+
return;
|
|
81890
|
+
const movePosition = new Vector2(event.clientX, event.clientY);
|
|
81891
|
+
if (this.downPosition.distanceTo(movePosition) === 0)
|
|
81892
|
+
return;
|
|
81893
|
+
this.rotateDelta.copy(this.downPosition).sub(movePosition);
|
|
81894
|
+
this.rotateCamera(this.rotateDelta);
|
|
81895
|
+
this.dispatchEvent({ type: "change" });
|
|
81896
|
+
};
|
|
81897
|
+
this.onPointerUp = (event) => {
|
|
81898
|
+
this.domElement.releasePointerCapture(event.pointerId);
|
|
81899
|
+
this.mouseDragOn = false;
|
|
81900
|
+
};
|
|
81901
|
+
this.onPointerCancel = (event) => {
|
|
81902
|
+
this.domElement.dispatchEvent(new PointerEvent("pointerup", event));
|
|
81903
|
+
};
|
|
81904
|
+
this.onWheel = (event) => {
|
|
81905
|
+
this.moveWheel = event.deltaY;
|
|
81906
|
+
this.update();
|
|
81907
|
+
};
|
|
81908
|
+
this.onKeyDown = (event) => {
|
|
81909
|
+
switch (event.code) {
|
|
81910
|
+
case "NumpadSubtract":
|
|
81911
|
+
case "Minus":
|
|
81912
|
+
if (this.multiplier > 1) {
|
|
81913
|
+
this.multiplier = this.multiplier - 1;
|
|
81914
|
+
this.dispatchEvent({ type: "flyspeedchange", data: this.multiplier });
|
|
81915
|
+
}
|
|
81916
|
+
break;
|
|
81917
|
+
case "NumpadAdd":
|
|
81918
|
+
case "Equal":
|
|
81919
|
+
if (this.multiplier < 10) {
|
|
81920
|
+
this.multiplier = this.multiplier + 1;
|
|
81921
|
+
this.dispatchEvent({ type: "flyspeedchange", data: this.multiplier });
|
|
81922
|
+
}
|
|
81923
|
+
break;
|
|
81924
|
+
case "ArrowLeft":
|
|
81925
|
+
case "ArrowRight":
|
|
81926
|
+
case "ArrowUp":
|
|
81927
|
+
case "ArrowDown":
|
|
81928
|
+
case "KeyW":
|
|
81929
|
+
case "KeyS":
|
|
81930
|
+
case "KeyA":
|
|
81931
|
+
case "KeyD":
|
|
81932
|
+
case "KeyQ":
|
|
81933
|
+
case "KeyE":
|
|
81934
|
+
this.moveKeys.add(event.code);
|
|
81935
|
+
this.update();
|
|
81936
|
+
break;
|
|
81937
|
+
}
|
|
81938
|
+
};
|
|
81939
|
+
this.onKeyUp = (event) => {
|
|
81940
|
+
if (this.moveKeys.delete(event.code))
|
|
81941
|
+
this.update();
|
|
81942
|
+
};
|
|
81943
|
+
this.moveKeys = new Set();
|
|
81944
|
+
this.moveClock = new Clock();
|
|
81945
|
+
this.quaternion = camera.quaternion.clone();
|
|
81946
|
+
this.downPosition = new Vector2(0, 0);
|
|
81947
|
+
this.rotateDelta = new Vector2(0, 0);
|
|
81948
|
+
this.domElement.addEventListener("pointerdown", this.onPointerDown);
|
|
81949
|
+
this.domElement.addEventListener("pointermove", this.onPointerMove);
|
|
81950
|
+
this.domElement.addEventListener("pointerup", this.onPointerUp);
|
|
81951
|
+
this.domElement.addEventListener("pointercancel", this.onPointerCancel);
|
|
81952
|
+
this.domElement.addEventListener("wheel", this.onWheel);
|
|
81953
|
+
window.addEventListener("keydown", this.onKeyDown);
|
|
81954
|
+
window.addEventListener("keyup", this.onKeyUp);
|
|
81955
|
+
}
|
|
81956
|
+
dispose() {
|
|
81957
|
+
this.domElement.removeEventListener("pointerdown", this.onPointerDown);
|
|
81958
|
+
this.domElement.removeEventListener("pointermove", this.onPointerMove);
|
|
81959
|
+
this.domElement.removeEventListener("pointerup", this.onPointerUp);
|
|
81960
|
+
this.domElement.removeEventListener("pointercancel", this.onPointerCancel);
|
|
81961
|
+
this.domElement.removeEventListener("wheel", this.onWheel);
|
|
81962
|
+
window.removeEventListener("keydown", this.onKeyDown);
|
|
81963
|
+
window.removeEventListener("keyup", this.onKeyUp);
|
|
81964
|
+
super.dispose();
|
|
81965
|
+
}
|
|
81966
|
+
update() {
|
|
81967
|
+
if (this.moveKeys.size > 0) {
|
|
81968
|
+
const timeDelta = this.moveClock.getDelta();
|
|
81969
|
+
const moveDelta = timeDelta * this.movementSpeed * this.multiplier;
|
|
81970
|
+
if (this.moveKeys.has("KeyW"))
|
|
81971
|
+
this.object.translateZ(-moveDelta);
|
|
81972
|
+
if (this.moveKeys.has("KeyS"))
|
|
81973
|
+
this.object.translateZ(moveDelta);
|
|
81974
|
+
if (this.moveKeys.has("KeyA"))
|
|
81975
|
+
this.object.translateX(-moveDelta);
|
|
81976
|
+
if (this.moveKeys.has("KeyD"))
|
|
81977
|
+
this.object.translateX(moveDelta);
|
|
81978
|
+
if (this.moveKeys.has("KeyQ"))
|
|
81979
|
+
this.object.translateY(moveDelta);
|
|
81980
|
+
if (this.moveKeys.has("KeyE"))
|
|
81981
|
+
this.object.translateY(-moveDelta);
|
|
81982
|
+
const lookDelta = this.lookSpeed + (this.multiplier - 1);
|
|
81983
|
+
if (this.moveKeys.has("ArrowUp"))
|
|
81984
|
+
this.rotateCamera(this.rotateDelta.add(new Vector2(0, -lookDelta / 2)));
|
|
81985
|
+
if (this.moveKeys.has("ArrowDown"))
|
|
81986
|
+
this.rotateCamera(this.rotateDelta.add(new Vector2(0, lookDelta / 2)));
|
|
81987
|
+
if (this.moveKeys.has("ArrowLeft"))
|
|
81988
|
+
this.rotateCamera(this.rotateDelta.add(new Vector2(lookDelta, 0)));
|
|
81989
|
+
if (this.moveKeys.has("ArrowRight"))
|
|
81990
|
+
this.rotateCamera(this.rotateDelta.add(new Vector2(-lookDelta, 0)));
|
|
81991
|
+
this.moveWheel = 0;
|
|
81992
|
+
this.dispatchEvent({ type: "change" });
|
|
81993
|
+
}
|
|
81994
|
+
if (this.moveWheel !== 0) {
|
|
81995
|
+
const moveDelta = this.moveWheel * 0.0001 * this.movementSpeed * this.multiplier;
|
|
81996
|
+
this.object.translateZ(-moveDelta);
|
|
81997
|
+
this.moveWheel += -1 * Math.sign(this.moveWheel);
|
|
81998
|
+
this.dispatchEvent({ type: "change" });
|
|
81999
|
+
}
|
|
82000
|
+
if (this.moveKeys.size === 0 && this.moveWheel === 0) {
|
|
82001
|
+
this.moveClock.stop();
|
|
82002
|
+
this.moveClock.autoStart = true;
|
|
82003
|
+
}
|
|
82004
|
+
}
|
|
82005
|
+
rotateCamera(delta) {
|
|
82006
|
+
const rotateX = (Math.PI * delta.x) / this.domElement.clientWidth;
|
|
82007
|
+
const rotateY = (Math.PI * delta.y) / this.domElement.clientHeight;
|
|
82008
|
+
const xRotation = new Quaternion();
|
|
82009
|
+
xRotation.setFromAxisAngle(this.object.up, rotateX);
|
|
82010
|
+
const yRotation = new Quaternion();
|
|
82011
|
+
yRotation.setFromAxisAngle(new Vector3(1, 0, 0), rotateY);
|
|
82012
|
+
const quaternion = this.quaternion.clone();
|
|
82013
|
+
quaternion.premultiply(xRotation).multiply(yRotation).normalize();
|
|
82014
|
+
this.object.setRotationFromQuaternion(quaternion);
|
|
81789
82015
|
}
|
|
81790
82016
|
}
|
|
81791
82017
|
|
|
@@ -81811,59 +82037,148 @@ void main() {
|
|
|
81811
82037
|
// By use of this software, its documentation or related materials, you
|
|
81812
82038
|
// acknowledge and accept the above terms.
|
|
81813
82039
|
///////////////////////////////////////////////////////////////////////////////
|
|
81814
|
-
|
|
81815
|
-
|
|
81816
|
-
|
|
81817
|
-
|
|
81818
|
-
|
|
81819
|
-
|
|
81820
|
-
|
|
81821
|
-
|
|
81822
|
-
|
|
81823
|
-
|
|
81824
|
-
|
|
81825
|
-
|
|
81826
|
-
|
|
81827
|
-
|
|
81828
|
-
|
|
81829
|
-
|
|
81830
|
-
|
|
81831
|
-
|
|
81832
|
-
|
|
81833
|
-
|
|
81834
|
-
|
|
81835
|
-
|
|
81836
|
-
|
|
81837
|
-
|
|
81838
|
-
|
|
81839
|
-
|
|
81840
|
-
|
|
81841
|
-
|
|
81842
|
-
|
|
81843
|
-
|
|
81844
|
-
|
|
81845
|
-
|
|
81846
|
-
|
|
81847
|
-
|
|
81848
|
-
|
|
81849
|
-
|
|
81850
|
-
|
|
81851
|
-
|
|
81852
|
-
|
|
81853
|
-
|
|
81854
|
-
|
|
81855
|
-
|
|
81856
|
-
|
|
81857
|
-
|
|
81858
|
-
//
|
|
81859
|
-
|
|
81860
|
-
|
|
81861
|
-
|
|
81862
|
-
|
|
81863
|
-
|
|
81864
|
-
|
|
81865
|
-
|
|
81866
|
-
|
|
82040
|
+
class FlyDragger {
|
|
82041
|
+
constructor(viewer) {
|
|
82042
|
+
this.updateControls = () => {
|
|
82043
|
+
const size = this.viewer.extents.getSize(new Vector3());
|
|
82044
|
+
this.controls.movementSpeed = Math.min(size.x, size.y, size.z) / 2;
|
|
82045
|
+
};
|
|
82046
|
+
this.controlsChange = () => {
|
|
82047
|
+
this.viewer.update();
|
|
82048
|
+
this.viewer.emitEvent({ type: "changecamera" });
|
|
82049
|
+
};
|
|
82050
|
+
this.flyspeedChange = (event) => {
|
|
82051
|
+
this.viewer.emitEvent(event);
|
|
82052
|
+
};
|
|
82053
|
+
this.viewerRender = () => {
|
|
82054
|
+
this.controls.update();
|
|
82055
|
+
};
|
|
82056
|
+
this.viewerZoom = () => {
|
|
82057
|
+
this.controls.rotateDelta.set(0, 0);
|
|
82058
|
+
};
|
|
82059
|
+
this.controls = new FlyControls(viewer.camera, viewer.canvas);
|
|
82060
|
+
this.controls.addEventListener("change", this.controlsChange);
|
|
82061
|
+
this.controls.addEventListener("flyspeedchange", this.flyspeedChange);
|
|
82062
|
+
this.viewer = viewer;
|
|
82063
|
+
this.viewer.on("render", this.viewerRender);
|
|
82064
|
+
this.viewer.on("zoom", this.viewerZoom);
|
|
82065
|
+
this.updateControls();
|
|
82066
|
+
}
|
|
82067
|
+
dispose() {
|
|
82068
|
+
this.viewer.off("render", this.viewerRender);
|
|
82069
|
+
this.viewer.off("zoom", this.viewerZoom);
|
|
82070
|
+
this.controls.removeEventListener("flyspeedchange", this.flyspeedChange);
|
|
82071
|
+
this.controls.removeEventListener("change", this.controlsChange);
|
|
82072
|
+
this.controls.dispose();
|
|
82073
|
+
}
|
|
82074
|
+
}
|
|
82075
|
+
|
|
82076
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
82077
|
+
// Copyright (C) 2002-2025, Open Design Alliance (the "Alliance").
|
|
82078
|
+
// All rights reserved.
|
|
82079
|
+
//
|
|
82080
|
+
// This software and its documentation and related materials are owned by
|
|
82081
|
+
// the Alliance. The software may only be incorporated into application
|
|
82082
|
+
// programs owned by members of the Alliance, subject to a signed
|
|
82083
|
+
// Membership Agreement and Supplemental Software License Agreement with the
|
|
82084
|
+
// Alliance. The structure and organization of this software are the valuable
|
|
82085
|
+
// trade secrets of the Alliance and its suppliers. The software is also
|
|
82086
|
+
// protected by copyright law and international treaty provisions. Application
|
|
82087
|
+
// programs incorporating this software must include the following statement
|
|
82088
|
+
// with their copyright notices:
|
|
82089
|
+
//
|
|
82090
|
+
// This application incorporates Open Design Alliance software pursuant to a
|
|
82091
|
+
// license agreement with Open Design Alliance.
|
|
82092
|
+
// Open Design Alliance Copyright (C) 2002-2025 by Open Design Alliance.
|
|
82093
|
+
// All rights reserved.
|
|
82094
|
+
//
|
|
82095
|
+
// By use of this software, its documentation or related materials, you
|
|
82096
|
+
// acknowledge and accept the above terms.
|
|
82097
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
82098
|
+
class ZoomDragger extends OrbitDragger {
|
|
82099
|
+
constructor(viewer) {
|
|
82100
|
+
super(viewer);
|
|
82101
|
+
this.orbit.mouseButtons = { LEFT: MOUSE.DOLLY, MIDDLE: MOUSE.PAN, RIGHT: MOUSE.PAN };
|
|
82102
|
+
// this.controls.touches = { ONE: TOUCH.DOLLY_PAN, TWO: TOUCH.DOLLY_PAN };
|
|
82103
|
+
}
|
|
82104
|
+
}
|
|
82105
|
+
|
|
82106
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
82107
|
+
// Copyright (C) 2002-2025, Open Design Alliance (the "Alliance").
|
|
82108
|
+
// All rights reserved.
|
|
82109
|
+
//
|
|
82110
|
+
// This software and its documentation and related materials are owned by
|
|
82111
|
+
// the Alliance. The software may only be incorporated into application
|
|
82112
|
+
// programs owned by members of the Alliance, subject to a signed
|
|
82113
|
+
// Membership Agreement and Supplemental Software License Agreement with the
|
|
82114
|
+
// Alliance. The structure and organization of this software are the valuable
|
|
82115
|
+
// trade secrets of the Alliance and its suppliers. The software is also
|
|
82116
|
+
// protected by copyright law and international treaty provisions. Application
|
|
82117
|
+
// programs incorporating this software must include the following statement
|
|
82118
|
+
// with their copyright notices:
|
|
82119
|
+
//
|
|
82120
|
+
// This application incorporates Open Design Alliance software pursuant to a
|
|
82121
|
+
// license agreement with Open Design Alliance.
|
|
82122
|
+
// Open Design Alliance Copyright (C) 2002-2025 by Open Design Alliance.
|
|
82123
|
+
// All rights reserved.
|
|
82124
|
+
//
|
|
82125
|
+
// By use of this software, its documentation or related materials, you
|
|
82126
|
+
// acknowledge and accept the above terms.
|
|
82127
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
82128
|
+
/**
|
|
82129
|
+
* Viewer draggers registry. Use this registry to register custom draggers.
|
|
82130
|
+
*
|
|
82131
|
+
* To implement custom dragger:
|
|
82132
|
+
*
|
|
82133
|
+
* 1. Define a dragger class implements {@link IDragger}.
|
|
82134
|
+
* 2. Define a constructor with a `viewer` parameter and add mouse event listeners for the specified viewer.
|
|
82135
|
+
* 3. Define the dragger logic in the event listeners. For example, listen for the `mousemove` event and
|
|
82136
|
+
* zoom in/out when the left mouse button is pressed.
|
|
82137
|
+
* 4. Override {@link IDragger.dispose} and remove mouse event listeners from the viewer.
|
|
82138
|
+
* 5. Register dragger provider in the draggers registry by calling the {@link draggers.registerDragger}.
|
|
82139
|
+
*
|
|
82140
|
+
* @example Implementing a custom dragger.
|
|
82141
|
+
*
|
|
82142
|
+
* ```javascript
|
|
82143
|
+
* import { IDragger, draggers, Viewer } from "@inweb/viewer-three";
|
|
82144
|
+
*
|
|
82145
|
+
* class MyDragger implements IDragger {
|
|
82146
|
+
* protected viewer: Viewer;
|
|
82147
|
+
*
|
|
82148
|
+
* constructor(viewer: Viewer) {
|
|
82149
|
+
* this.viewer = viewer;
|
|
82150
|
+
* this.viewer.addEventListener("pointermove", this.onPointerMove);
|
|
82151
|
+
* }
|
|
82152
|
+
*
|
|
82153
|
+
* override dispose() {
|
|
82154
|
+
* this.viewer.removeEventListener("pointermove", this.onPointerMove);
|
|
82155
|
+
* }
|
|
82156
|
+
*
|
|
82157
|
+
* onPointerMove = (event: PointerEvent) => {
|
|
82158
|
+
* // place custom logic here
|
|
82159
|
+
* };
|
|
82160
|
+
* }
|
|
82161
|
+
*
|
|
82162
|
+
* draggers.registerDragger("MyDragger", (viewer): IDragger => new MyDragger(viewer));
|
|
82163
|
+
* ```
|
|
82164
|
+
*
|
|
82165
|
+
* @example Activating a custom dragger.
|
|
82166
|
+
*
|
|
82167
|
+
* ```javascript
|
|
82168
|
+
* viewer.setActiveDragger("MyDragger");
|
|
82169
|
+
* ```
|
|
82170
|
+
*/
|
|
82171
|
+
const draggers = draggersRegistry("threejs");
|
|
82172
|
+
// build-in draggers
|
|
82173
|
+
draggers.registerDragger("Pan", (viewer) => new PanDragger(viewer));
|
|
82174
|
+
draggers.registerDragger("Orbit", (viewer) => new OrbitDragger(viewer));
|
|
82175
|
+
draggers.registerDragger("Zoom", (viewer) => new ZoomDragger(viewer));
|
|
82176
|
+
draggers.registerDragger("MeasureLine", (viewer) => new MeasureLineDragger(viewer));
|
|
82177
|
+
draggers.registerDragger("CuttingPlaneXAxis", (viewer) => new CuttingPlaneXAxisDragger(viewer));
|
|
82178
|
+
draggers.registerDragger("CuttingPlaneYAxis", (viewer) => new CuttingPlaneYAxisDragger(viewer));
|
|
82179
|
+
draggers.registerDragger("CuttingPlaneZAxis", (viewer) => new CuttingPlaneZAxisDragger(viewer));
|
|
82180
|
+
draggers.registerDragger("Walk", (viewer) => new WalkDragger(viewer));
|
|
82181
|
+
draggers.registerDragger("Fly", (viewer) => new FlyDragger(viewer));
|
|
81867
82182
|
|
|
81868
82183
|
///////////////////////////////////////////////////////////////////////////////
|
|
81869
82184
|
// Copyright (C) 2002-2025, Open Design Alliance (the "Alliance").
|
|
@@ -82537,7 +82852,7 @@ void main() {
|
|
|
82537
82852
|
const objects = [];
|
|
82538
82853
|
viewer.scene.traverseVisible((child) => {
|
|
82539
82854
|
var _a;
|
|
82540
|
-
if (handleSet.has((_a = child.userData) === null || _a ===
|
|
82855
|
+
if (handleSet.has((_a = child.userData) === null || _a === void 0 ? void 0 : _a.handle))
|
|
82541
82856
|
objects.push(child);
|
|
82542
82857
|
});
|
|
82543
82858
|
const extents = objects.reduce((result, object) => result.expandByObject(object), new Box3());
|
|
@@ -84301,9 +84616,9 @@ void main() {
|
|
|
84301
84616
|
}
|
|
84302
84617
|
viewerResize(event) {
|
|
84303
84618
|
var _a, _b, _c;
|
|
84304
|
-
(_a = this.renderTarget) === null || _a ===
|
|
84305
|
-
(_b = this.edgesMaterial) === null || _b ===
|
|
84306
|
-
(_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);
|
|
84307
84622
|
}
|
|
84308
84623
|
}
|
|
84309
84624
|
|
|
@@ -89910,7 +90225,7 @@ void main() {
|
|
|
89910
90225
|
.replace(this.resourcePath, "")
|
|
89911
90226
|
.replace(/^(\.?\/)/, "");
|
|
89912
90227
|
const dataURL = this.dataURLs.get(key);
|
|
89913
|
-
return dataURL !== null && dataURL !==
|
|
90228
|
+
return dataURL !== null && dataURL !== void 0 ? dataURL : url;
|
|
89914
90229
|
});
|
|
89915
90230
|
}
|
|
89916
90231
|
dispose() {
|
|
@@ -90251,13 +90566,26 @@ void main() {
|
|
|
90251
90566
|
};
|
|
90252
90567
|
|
|
90253
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,
|
|
90254
90579
|
POINTS: 0,
|
|
90255
90580
|
LINES: 1,
|
|
90256
90581
|
LINE_LOOP: 2,
|
|
90257
90582
|
LINE_STRIP: 3,
|
|
90258
90583
|
TRIANGLES: 4,
|
|
90259
90584
|
TRIANGLE_STRIP: 5,
|
|
90260
|
-
TRIANGLE_FAN: 6
|
|
90585
|
+
TRIANGLE_FAN: 6,
|
|
90586
|
+
UNSIGNED_BYTE: 5121,
|
|
90587
|
+
UNSIGNED_SHORT: 5123,
|
|
90588
|
+
};
|
|
90261
90589
|
|
|
90262
90590
|
const MAX_GAP = 128 * 1024; // 128 KB
|
|
90263
90591
|
const MAX_CHUNK = 30 * 1024 * 1024; // 100 MB
|
|
@@ -95298,7 +95626,7 @@ void main() {
|
|
|
95298
95626
|
}
|
|
95299
95627
|
removeEventListener(type, listener) {
|
|
95300
95628
|
if (this._listeners[type] === undefined) return this;
|
|
95301
|
-
const listeners = this._listeners[type].filter(
|
|
95629
|
+
const listeners = this._listeners[type].filter(x => x !== listener);
|
|
95302
95630
|
if (listeners.length !== 0) this._listeners[type] = listeners; else delete this._listeners[type];
|
|
95303
95631
|
return this;
|
|
95304
95632
|
}
|
|
@@ -95309,7 +95637,7 @@ void main() {
|
|
|
95309
95637
|
emitEvent(event) {
|
|
95310
95638
|
if (this._listeners[event.type] === undefined) return false;
|
|
95311
95639
|
const invoke = this._listeners[event.type].slice();
|
|
95312
|
-
invoke.forEach(
|
|
95640
|
+
invoke.forEach(listener => listener.call(this, event));
|
|
95313
95641
|
return true;
|
|
95314
95642
|
}
|
|
95315
95643
|
on(type, listener) {
|
|
@@ -95347,7 +95675,7 @@ void main() {
|
|
|
95347
95675
|
hasRequiredGlobal = 1;
|
|
95348
95676
|
(function (exports) {
|
|
95349
95677
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
95350
|
-
exports._registerNode = exports.Konva = exports.glob =
|
|
95678
|
+
exports._registerNode = exports.Konva = exports.glob = void 0;
|
|
95351
95679
|
const PI_OVER_180 = Math.PI / 180;
|
|
95352
95680
|
function detectBrowser() {
|
|
95353
95681
|
return (typeof window !== 'undefined' &&
|
|
@@ -95363,7 +95691,7 @@ void main() {
|
|
|
95363
95691
|
: {};
|
|
95364
95692
|
exports.Konva = {
|
|
95365
95693
|
_global: exports.glob,
|
|
95366
|
-
version: '9.3.
|
|
95694
|
+
version: '9.3.22',
|
|
95367
95695
|
isBrowser: detectBrowser(),
|
|
95368
95696
|
isUnminified: /param/.test(function (param) { }.toString()),
|
|
95369
95697
|
dblClickWindow: 400,
|
|
@@ -95395,7 +95723,7 @@ void main() {
|
|
|
95395
95723
|
},
|
|
95396
95724
|
isTransforming() {
|
|
95397
95725
|
var _a;
|
|
95398
|
-
return (_a = exports.Konva['Transformer']) === null || _a ===
|
|
95726
|
+
return (_a = exports.Konva['Transformer']) === null || _a === void 0 ? void 0 : _a.isTransforming();
|
|
95399
95727
|
},
|
|
95400
95728
|
isDragReady() {
|
|
95401
95729
|
return !!exports.Konva['DD'].node;
|
|
@@ -95424,7 +95752,7 @@ void main() {
|
|
|
95424
95752
|
hasRequiredUtil = 1;
|
|
95425
95753
|
(function (exports) {
|
|
95426
95754
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
95427
|
-
exports.Util = exports.Transform =
|
|
95755
|
+
exports.Util = exports.Transform = void 0;
|
|
95428
95756
|
const Global_1 = requireGlobal();
|
|
95429
95757
|
class Transform {
|
|
95430
95758
|
constructor(m = [1, 0, 0, 1, 0, 0]) {
|
|
@@ -96233,343 +96561,6 @@ void main() {
|
|
|
96233
96561
|
|
|
96234
96562
|
var Node = {};
|
|
96235
96563
|
|
|
96236
|
-
var Factory = {};
|
|
96237
|
-
|
|
96238
|
-
var Validators = {};
|
|
96239
|
-
|
|
96240
|
-
var hasRequiredValidators;
|
|
96241
|
-
|
|
96242
|
-
function requireValidators () {
|
|
96243
|
-
if (hasRequiredValidators) return Validators;
|
|
96244
|
-
hasRequiredValidators = 1;
|
|
96245
|
-
Object.defineProperty(Validators, "__esModule", { value: true });
|
|
96246
|
-
Validators.RGBComponent = RGBComponent;
|
|
96247
|
-
Validators.alphaComponent = alphaComponent;
|
|
96248
|
-
Validators.getNumberValidator = getNumberValidator;
|
|
96249
|
-
Validators.getNumberOrArrayOfNumbersValidator = getNumberOrArrayOfNumbersValidator;
|
|
96250
|
-
Validators.getNumberOrAutoValidator = getNumberOrAutoValidator;
|
|
96251
|
-
Validators.getStringValidator = getStringValidator;
|
|
96252
|
-
Validators.getStringOrGradientValidator = getStringOrGradientValidator;
|
|
96253
|
-
Validators.getFunctionValidator = getFunctionValidator;
|
|
96254
|
-
Validators.getNumberArrayValidator = getNumberArrayValidator;
|
|
96255
|
-
Validators.getBooleanValidator = getBooleanValidator;
|
|
96256
|
-
Validators.getComponentValidator = getComponentValidator;
|
|
96257
|
-
const Global_1 = requireGlobal();
|
|
96258
|
-
const Util_1 = requireUtil();
|
|
96259
|
-
function _formatValue(val) {
|
|
96260
|
-
if (Util_1.Util._isString(val)) {
|
|
96261
|
-
return '"' + val + '"';
|
|
96262
|
-
}
|
|
96263
|
-
if (Object.prototype.toString.call(val) === '[object Number]') {
|
|
96264
|
-
return val;
|
|
96265
|
-
}
|
|
96266
|
-
if (Util_1.Util._isBoolean(val)) {
|
|
96267
|
-
return val;
|
|
96268
|
-
}
|
|
96269
|
-
return Object.prototype.toString.call(val);
|
|
96270
|
-
}
|
|
96271
|
-
function RGBComponent(val) {
|
|
96272
|
-
if (val > 255) {
|
|
96273
|
-
return 255;
|
|
96274
|
-
}
|
|
96275
|
-
else if (val < 0) {
|
|
96276
|
-
return 0;
|
|
96277
|
-
}
|
|
96278
|
-
return Math.round(val);
|
|
96279
|
-
}
|
|
96280
|
-
function alphaComponent(val) {
|
|
96281
|
-
if (val > 1) {
|
|
96282
|
-
return 1;
|
|
96283
|
-
}
|
|
96284
|
-
else if (val < 0.0001) {
|
|
96285
|
-
return 0.0001;
|
|
96286
|
-
}
|
|
96287
|
-
return val;
|
|
96288
|
-
}
|
|
96289
|
-
function getNumberValidator() {
|
|
96290
|
-
if (Global_1.Konva.isUnminified) {
|
|
96291
|
-
return function (val, attr) {
|
|
96292
|
-
if (!Util_1.Util._isNumber(val)) {
|
|
96293
|
-
Util_1.Util.warn(_formatValue(val) +
|
|
96294
|
-
' is a not valid value for "' +
|
|
96295
|
-
attr +
|
|
96296
|
-
'" attribute. The value should be a number.');
|
|
96297
|
-
}
|
|
96298
|
-
return val;
|
|
96299
|
-
};
|
|
96300
|
-
}
|
|
96301
|
-
}
|
|
96302
|
-
function getNumberOrArrayOfNumbersValidator(noOfElements) {
|
|
96303
|
-
if (Global_1.Konva.isUnminified) {
|
|
96304
|
-
return function (val, attr) {
|
|
96305
|
-
let isNumber = Util_1.Util._isNumber(val);
|
|
96306
|
-
let isValidArray = Util_1.Util._isArray(val) && val.length == noOfElements;
|
|
96307
|
-
if (!isNumber && !isValidArray) {
|
|
96308
|
-
Util_1.Util.warn(_formatValue(val) +
|
|
96309
|
-
' is a not valid value for "' +
|
|
96310
|
-
attr +
|
|
96311
|
-
'" attribute. The value should be a number or Array<number>(' +
|
|
96312
|
-
noOfElements +
|
|
96313
|
-
')');
|
|
96314
|
-
}
|
|
96315
|
-
return val;
|
|
96316
|
-
};
|
|
96317
|
-
}
|
|
96318
|
-
}
|
|
96319
|
-
function getNumberOrAutoValidator() {
|
|
96320
|
-
if (Global_1.Konva.isUnminified) {
|
|
96321
|
-
return function (val, attr) {
|
|
96322
|
-
var isNumber = Util_1.Util._isNumber(val);
|
|
96323
|
-
var isAuto = val === 'auto';
|
|
96324
|
-
if (!(isNumber || isAuto)) {
|
|
96325
|
-
Util_1.Util.warn(_formatValue(val) +
|
|
96326
|
-
' is a not valid value for "' +
|
|
96327
|
-
attr +
|
|
96328
|
-
'" attribute. The value should be a number or "auto".');
|
|
96329
|
-
}
|
|
96330
|
-
return val;
|
|
96331
|
-
};
|
|
96332
|
-
}
|
|
96333
|
-
}
|
|
96334
|
-
function getStringValidator() {
|
|
96335
|
-
if (Global_1.Konva.isUnminified) {
|
|
96336
|
-
return function (val, attr) {
|
|
96337
|
-
if (!Util_1.Util._isString(val)) {
|
|
96338
|
-
Util_1.Util.warn(_formatValue(val) +
|
|
96339
|
-
' is a not valid value for "' +
|
|
96340
|
-
attr +
|
|
96341
|
-
'" attribute. The value should be a string.');
|
|
96342
|
-
}
|
|
96343
|
-
return val;
|
|
96344
|
-
};
|
|
96345
|
-
}
|
|
96346
|
-
}
|
|
96347
|
-
function getStringOrGradientValidator() {
|
|
96348
|
-
if (Global_1.Konva.isUnminified) {
|
|
96349
|
-
return function (val, attr) {
|
|
96350
|
-
const isString = Util_1.Util._isString(val);
|
|
96351
|
-
const isGradient = Object.prototype.toString.call(val) === '[object CanvasGradient]' ||
|
|
96352
|
-
(val && val['addColorStop']);
|
|
96353
|
-
if (!(isString || isGradient)) {
|
|
96354
|
-
Util_1.Util.warn(_formatValue(val) +
|
|
96355
|
-
' is a not valid value for "' +
|
|
96356
|
-
attr +
|
|
96357
|
-
'" attribute. The value should be a string or a native gradient.');
|
|
96358
|
-
}
|
|
96359
|
-
return val;
|
|
96360
|
-
};
|
|
96361
|
-
}
|
|
96362
|
-
}
|
|
96363
|
-
function getFunctionValidator() {
|
|
96364
|
-
if (Global_1.Konva.isUnminified) {
|
|
96365
|
-
return function (val, attr) {
|
|
96366
|
-
if (!Util_1.Util._isFunction(val)) {
|
|
96367
|
-
Util_1.Util.warn(_formatValue(val) +
|
|
96368
|
-
' is a not valid value for "' +
|
|
96369
|
-
attr +
|
|
96370
|
-
'" attribute. The value should be a function.');
|
|
96371
|
-
}
|
|
96372
|
-
return val;
|
|
96373
|
-
};
|
|
96374
|
-
}
|
|
96375
|
-
}
|
|
96376
|
-
function getNumberArrayValidator() {
|
|
96377
|
-
if (Global_1.Konva.isUnminified) {
|
|
96378
|
-
return function (val, attr) {
|
|
96379
|
-
const TypedArray = Int8Array ? Object.getPrototypeOf(Int8Array) : null;
|
|
96380
|
-
if (TypedArray && val instanceof TypedArray) {
|
|
96381
|
-
return val;
|
|
96382
|
-
}
|
|
96383
|
-
if (!Util_1.Util._isArray(val)) {
|
|
96384
|
-
Util_1.Util.warn(_formatValue(val) +
|
|
96385
|
-
' is a not valid value for "' +
|
|
96386
|
-
attr +
|
|
96387
|
-
'" attribute. The value should be a array of numbers.');
|
|
96388
|
-
}
|
|
96389
|
-
else {
|
|
96390
|
-
val.forEach(function (item) {
|
|
96391
|
-
if (!Util_1.Util._isNumber(item)) {
|
|
96392
|
-
Util_1.Util.warn('"' +
|
|
96393
|
-
attr +
|
|
96394
|
-
'" attribute has non numeric element ' +
|
|
96395
|
-
item +
|
|
96396
|
-
'. Make sure that all elements are numbers.');
|
|
96397
|
-
}
|
|
96398
|
-
});
|
|
96399
|
-
}
|
|
96400
|
-
return val;
|
|
96401
|
-
};
|
|
96402
|
-
}
|
|
96403
|
-
}
|
|
96404
|
-
function getBooleanValidator() {
|
|
96405
|
-
if (Global_1.Konva.isUnminified) {
|
|
96406
|
-
return function (val, attr) {
|
|
96407
|
-
var isBool = val === true || val === false;
|
|
96408
|
-
if (!isBool) {
|
|
96409
|
-
Util_1.Util.warn(_formatValue(val) +
|
|
96410
|
-
' is a not valid value for "' +
|
|
96411
|
-
attr +
|
|
96412
|
-
'" attribute. The value should be a boolean.');
|
|
96413
|
-
}
|
|
96414
|
-
return val;
|
|
96415
|
-
};
|
|
96416
|
-
}
|
|
96417
|
-
}
|
|
96418
|
-
function getComponentValidator(components) {
|
|
96419
|
-
if (Global_1.Konva.isUnminified) {
|
|
96420
|
-
return function (val, attr) {
|
|
96421
|
-
if (val === undefined || val === null) {
|
|
96422
|
-
return val;
|
|
96423
|
-
}
|
|
96424
|
-
if (!Util_1.Util.isObject(val)) {
|
|
96425
|
-
Util_1.Util.warn(_formatValue(val) +
|
|
96426
|
-
' is a not valid value for "' +
|
|
96427
|
-
attr +
|
|
96428
|
-
'" attribute. The value should be an object with properties ' +
|
|
96429
|
-
components);
|
|
96430
|
-
}
|
|
96431
|
-
return val;
|
|
96432
|
-
};
|
|
96433
|
-
}
|
|
96434
|
-
}
|
|
96435
|
-
return Validators;
|
|
96436
|
-
}
|
|
96437
|
-
|
|
96438
|
-
var hasRequiredFactory;
|
|
96439
|
-
|
|
96440
|
-
function requireFactory () {
|
|
96441
|
-
if (hasRequiredFactory) return Factory;
|
|
96442
|
-
hasRequiredFactory = 1;
|
|
96443
|
-
(function (exports) {
|
|
96444
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
96445
|
-
exports.Factory = undefined;
|
|
96446
|
-
const Util_1 = requireUtil();
|
|
96447
|
-
const Validators_1 = requireValidators();
|
|
96448
|
-
const GET = 'get';
|
|
96449
|
-
const SET = 'set';
|
|
96450
|
-
exports.Factory = {
|
|
96451
|
-
addGetterSetter(constructor, attr, def, validator, after) {
|
|
96452
|
-
exports.Factory.addGetter(constructor, attr, def);
|
|
96453
|
-
exports.Factory.addSetter(constructor, attr, validator, after);
|
|
96454
|
-
exports.Factory.addOverloadedGetterSetter(constructor, attr);
|
|
96455
|
-
},
|
|
96456
|
-
addGetter(constructor, attr, def) {
|
|
96457
|
-
var method = GET + Util_1.Util._capitalize(attr);
|
|
96458
|
-
constructor.prototype[method] =
|
|
96459
|
-
constructor.prototype[method] ||
|
|
96460
|
-
function () {
|
|
96461
|
-
const val = this.attrs[attr];
|
|
96462
|
-
return val === undefined ? def : val;
|
|
96463
|
-
};
|
|
96464
|
-
},
|
|
96465
|
-
addSetter(constructor, attr, validator, after) {
|
|
96466
|
-
var method = SET + Util_1.Util._capitalize(attr);
|
|
96467
|
-
if (!constructor.prototype[method]) {
|
|
96468
|
-
exports.Factory.overWriteSetter(constructor, attr, validator, after);
|
|
96469
|
-
}
|
|
96470
|
-
},
|
|
96471
|
-
overWriteSetter(constructor, attr, validator, after) {
|
|
96472
|
-
var method = SET + Util_1.Util._capitalize(attr);
|
|
96473
|
-
constructor.prototype[method] = function (val) {
|
|
96474
|
-
if (validator && val !== undefined && val !== null) {
|
|
96475
|
-
val = validator.call(this, val, attr);
|
|
96476
|
-
}
|
|
96477
|
-
this._setAttr(attr, val);
|
|
96478
|
-
if (after) {
|
|
96479
|
-
after.call(this);
|
|
96480
|
-
}
|
|
96481
|
-
return this;
|
|
96482
|
-
};
|
|
96483
|
-
},
|
|
96484
|
-
addComponentsGetterSetter(constructor, attr, components, validator, after) {
|
|
96485
|
-
const len = components.length, capitalize = Util_1.Util._capitalize, getter = GET + capitalize(attr), setter = SET + capitalize(attr);
|
|
96486
|
-
constructor.prototype[getter] = function () {
|
|
96487
|
-
const ret = {};
|
|
96488
|
-
for (let n = 0; n < len; n++) {
|
|
96489
|
-
const component = components[n];
|
|
96490
|
-
ret[component] = this.getAttr(attr + capitalize(component));
|
|
96491
|
-
}
|
|
96492
|
-
return ret;
|
|
96493
|
-
};
|
|
96494
|
-
const basicValidator = (0, Validators_1.getComponentValidator)(components);
|
|
96495
|
-
constructor.prototype[setter] = function (val) {
|
|
96496
|
-
const oldVal = this.attrs[attr];
|
|
96497
|
-
if (validator) {
|
|
96498
|
-
val = validator.call(this, val, attr);
|
|
96499
|
-
}
|
|
96500
|
-
if (basicValidator) {
|
|
96501
|
-
basicValidator.call(this, val, attr);
|
|
96502
|
-
}
|
|
96503
|
-
for (const key in val) {
|
|
96504
|
-
if (!val.hasOwnProperty(key)) {
|
|
96505
|
-
continue;
|
|
96506
|
-
}
|
|
96507
|
-
this._setAttr(attr + capitalize(key), val[key]);
|
|
96508
|
-
}
|
|
96509
|
-
if (!val) {
|
|
96510
|
-
components.forEach((component) => {
|
|
96511
|
-
this._setAttr(attr + capitalize(component), undefined);
|
|
96512
|
-
});
|
|
96513
|
-
}
|
|
96514
|
-
this._fireChangeEvent(attr, oldVal, val);
|
|
96515
|
-
if (after) {
|
|
96516
|
-
after.call(this);
|
|
96517
|
-
}
|
|
96518
|
-
return this;
|
|
96519
|
-
};
|
|
96520
|
-
exports.Factory.addOverloadedGetterSetter(constructor, attr);
|
|
96521
|
-
},
|
|
96522
|
-
addOverloadedGetterSetter(constructor, attr) {
|
|
96523
|
-
var capitalizedAttr = Util_1.Util._capitalize(attr), setter = SET + capitalizedAttr, getter = GET + capitalizedAttr;
|
|
96524
|
-
constructor.prototype[attr] = function () {
|
|
96525
|
-
if (arguments.length) {
|
|
96526
|
-
this[setter](arguments[0]);
|
|
96527
|
-
return this;
|
|
96528
|
-
}
|
|
96529
|
-
return this[getter]();
|
|
96530
|
-
};
|
|
96531
|
-
},
|
|
96532
|
-
addDeprecatedGetterSetter(constructor, attr, def, validator) {
|
|
96533
|
-
Util_1.Util.error('Adding deprecated ' + attr);
|
|
96534
|
-
const method = GET + Util_1.Util._capitalize(attr);
|
|
96535
|
-
const message = attr +
|
|
96536
|
-
' property is deprecated and will be removed soon. Look at Konva change log for more information.';
|
|
96537
|
-
constructor.prototype[method] = function () {
|
|
96538
|
-
Util_1.Util.error(message);
|
|
96539
|
-
const val = this.attrs[attr];
|
|
96540
|
-
return val === undefined ? def : val;
|
|
96541
|
-
};
|
|
96542
|
-
exports.Factory.addSetter(constructor, attr, validator, function () {
|
|
96543
|
-
Util_1.Util.error(message);
|
|
96544
|
-
});
|
|
96545
|
-
exports.Factory.addOverloadedGetterSetter(constructor, attr);
|
|
96546
|
-
},
|
|
96547
|
-
backCompat(constructor, methods) {
|
|
96548
|
-
Util_1.Util.each(methods, function (oldMethodName, newMethodName) {
|
|
96549
|
-
const method = constructor.prototype[newMethodName];
|
|
96550
|
-
const oldGetter = GET + Util_1.Util._capitalize(oldMethodName);
|
|
96551
|
-
const oldSetter = SET + Util_1.Util._capitalize(oldMethodName);
|
|
96552
|
-
function deprecated() {
|
|
96553
|
-
method.apply(this, arguments);
|
|
96554
|
-
Util_1.Util.error('"' +
|
|
96555
|
-
oldMethodName +
|
|
96556
|
-
'" method is deprecated and will be removed soon. Use ""' +
|
|
96557
|
-
newMethodName +
|
|
96558
|
-
'" instead.');
|
|
96559
|
-
}
|
|
96560
|
-
constructor.prototype[oldMethodName] = deprecated;
|
|
96561
|
-
constructor.prototype[oldGetter] = deprecated;
|
|
96562
|
-
constructor.prototype[oldSetter] = deprecated;
|
|
96563
|
-
});
|
|
96564
|
-
},
|
|
96565
|
-
afterSetFilter() {
|
|
96566
|
-
this._filterUpToDate = false;
|
|
96567
|
-
},
|
|
96568
|
-
};
|
|
96569
|
-
} (Factory));
|
|
96570
|
-
return Factory;
|
|
96571
|
-
}
|
|
96572
|
-
|
|
96573
96564
|
var Canvas = {};
|
|
96574
96565
|
|
|
96575
96566
|
var Context = {};
|
|
@@ -96580,7 +96571,7 @@ void main() {
|
|
|
96580
96571
|
if (hasRequiredContext) return Context;
|
|
96581
96572
|
hasRequiredContext = 1;
|
|
96582
96573
|
Object.defineProperty(Context, "__esModule", { value: true });
|
|
96583
|
-
Context.HitContext = Context.SceneContext = Context.Context =
|
|
96574
|
+
Context.HitContext = Context.SceneContext = Context.Context = void 0;
|
|
96584
96575
|
const Util_1 = requireUtil();
|
|
96585
96576
|
const Global_1 = requireGlobal();
|
|
96586
96577
|
function simplifyArray(arr) {
|
|
@@ -97069,7 +97060,7 @@ void main() {
|
|
|
97069
97060
|
}
|
|
97070
97061
|
_applyShadow(shape) {
|
|
97071
97062
|
var _a, _b, _c;
|
|
97072
|
-
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 : {
|
|
97073
97064
|
x: 0,
|
|
97074
97065
|
y: 0,
|
|
97075
97066
|
}, scale = shape.getAbsoluteScale(), ratio = this.canvas.getPixelRatio(), scaleX = scale.x * ratio, scaleY = scale.y * ratio;
|
|
@@ -97128,12 +97119,10 @@ void main() {
|
|
|
97128
97119
|
if (hasRequiredCanvas) return Canvas;
|
|
97129
97120
|
hasRequiredCanvas = 1;
|
|
97130
97121
|
Object.defineProperty(Canvas, "__esModule", { value: true });
|
|
97131
|
-
Canvas.HitCanvas = Canvas.SceneCanvas = Canvas.Canvas =
|
|
97122
|
+
Canvas.HitCanvas = Canvas.SceneCanvas = Canvas.Canvas = void 0;
|
|
97132
97123
|
const Util_1 = requireUtil();
|
|
97133
97124
|
const Context_1 = requireContext();
|
|
97134
97125
|
const Global_1 = requireGlobal();
|
|
97135
|
-
const Factory_1 = requireFactory();
|
|
97136
|
-
const Validators_1 = requireValidators();
|
|
97137
97126
|
let _pixelRatio;
|
|
97138
97127
|
function getDevicePixelRatio() {
|
|
97139
97128
|
if (_pixelRatio) {
|
|
@@ -97222,7 +97211,6 @@ void main() {
|
|
|
97222
97211
|
}
|
|
97223
97212
|
};
|
|
97224
97213
|
Canvas.Canvas = Canvas$1;
|
|
97225
|
-
Factory_1.Factory.addGetterSetter(Canvas$1, 'pixelRatio', undefined, (0, Validators_1.getNumberValidator)());
|
|
97226
97214
|
class SceneCanvas extends Canvas$1 {
|
|
97227
97215
|
constructor(config = { width: 0, height: 0, willReadFrequently: false }) {
|
|
97228
97216
|
super(config);
|
|
@@ -97254,7 +97242,7 @@ void main() {
|
|
|
97254
97242
|
hasRequiredDragAndDrop = 1;
|
|
97255
97243
|
(function (exports) {
|
|
97256
97244
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
97257
|
-
exports.DD =
|
|
97245
|
+
exports.DD = void 0;
|
|
97258
97246
|
const Global_1 = requireGlobal();
|
|
97259
97247
|
const Util_1 = requireUtil();
|
|
97260
97248
|
exports.DD = {
|
|
@@ -97369,20 +97357,357 @@ void main() {
|
|
|
97369
97357
|
return DragAndDrop;
|
|
97370
97358
|
}
|
|
97371
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
|
+
|
|
97372
97697
|
var hasRequiredNode;
|
|
97373
97698
|
|
|
97374
97699
|
function requireNode () {
|
|
97375
97700
|
if (hasRequiredNode) return Node;
|
|
97376
97701
|
hasRequiredNode = 1;
|
|
97377
97702
|
Object.defineProperty(Node, "__esModule", { value: true });
|
|
97378
|
-
Node.Node =
|
|
97379
|
-
const Util_1 = requireUtil();
|
|
97380
|
-
const Factory_1 = requireFactory();
|
|
97703
|
+
Node.Node = void 0;
|
|
97381
97704
|
const Canvas_1 = requireCanvas();
|
|
97382
|
-
const Global_1 = requireGlobal();
|
|
97383
97705
|
const DragAndDrop_1 = requireDragAndDrop();
|
|
97706
|
+
const Factory_1 = requireFactory();
|
|
97707
|
+
const Global_1 = requireGlobal();
|
|
97708
|
+
const Util_1 = requireUtil();
|
|
97384
97709
|
const Validators_1 = requireValidators();
|
|
97385
|
-
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 = [
|
|
97386
97711
|
'xChange.konva',
|
|
97387
97712
|
'yChange.konva',
|
|
97388
97713
|
'scaleXChange.konva',
|
|
@@ -97461,8 +97786,8 @@ void main() {
|
|
|
97461
97786
|
}
|
|
97462
97787
|
clearCache() {
|
|
97463
97788
|
if (this._cache.has(CANVAS)) {
|
|
97464
|
-
const { scene, filter, hit } = this._cache.get(CANVAS);
|
|
97465
|
-
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);
|
|
97466
97791
|
this._cache.delete(CANVAS);
|
|
97467
97792
|
}
|
|
97468
97793
|
this._clearSelfAndDescendantCache();
|
|
@@ -97506,6 +97831,11 @@ void main() {
|
|
|
97506
97831
|
width: width,
|
|
97507
97832
|
height: height,
|
|
97508
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();
|
|
97509
97839
|
cachedHitCanvas.isCache = true;
|
|
97510
97840
|
cachedSceneCanvas.isCache = true;
|
|
97511
97841
|
this._cache.delete(CANVAS);
|
|
@@ -97516,12 +97846,16 @@ void main() {
|
|
|
97516
97846
|
}
|
|
97517
97847
|
sceneContext.save();
|
|
97518
97848
|
hitContext.save();
|
|
97849
|
+
bufferContext.save();
|
|
97519
97850
|
sceneContext.translate(-x, -y);
|
|
97520
97851
|
hitContext.translate(-x, -y);
|
|
97852
|
+
bufferContext.translate(-x, -y);
|
|
97853
|
+
bufferCanvas.x = x;
|
|
97854
|
+
bufferCanvas.y = y;
|
|
97521
97855
|
this._isUnderCache = true;
|
|
97522
97856
|
this._clearSelfAndDescendantCache(ABSOLUTE_OPACITY);
|
|
97523
97857
|
this._clearSelfAndDescendantCache(ABSOLUTE_SCALE);
|
|
97524
|
-
this.drawScene(cachedSceneCanvas, this);
|
|
97858
|
+
this.drawScene(cachedSceneCanvas, this, bufferCanvas);
|
|
97525
97859
|
this.drawHit(cachedHitCanvas, this);
|
|
97526
97860
|
this._isUnderCache = false;
|
|
97527
97861
|
sceneContext.restore();
|
|
@@ -97540,6 +97874,7 @@ void main() {
|
|
|
97540
97874
|
scene: cachedSceneCanvas,
|
|
97541
97875
|
filter: cachedFilterCanvas,
|
|
97542
97876
|
hit: cachedHitCanvas,
|
|
97877
|
+
buffer: bufferCanvas,
|
|
97543
97878
|
x: x,
|
|
97544
97879
|
y: y,
|
|
97545
97880
|
});
|
|
@@ -97632,23 +97967,22 @@ void main() {
|
|
|
97632
97967
|
return sceneCanvas;
|
|
97633
97968
|
}
|
|
97634
97969
|
on(evtStr, handler) {
|
|
97635
|
-
|
|
97970
|
+
if (this._cache) {
|
|
97971
|
+
this._cache.delete(ALL_LISTENERS);
|
|
97972
|
+
}
|
|
97636
97973
|
if (arguments.length === 3) {
|
|
97637
97974
|
return this._delegate.apply(this, arguments);
|
|
97638
97975
|
}
|
|
97639
|
-
|
|
97640
|
-
for (n = 0; n <
|
|
97641
|
-
event = events[n];
|
|
97642
|
-
parts = event.split('.');
|
|
97643
|
-
baseEvent = parts[0];
|
|
97644
|
-
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] || '';
|
|
97645
97982
|
if (!this.eventListeners[baseEvent]) {
|
|
97646
97983
|
this.eventListeners[baseEvent] = [];
|
|
97647
97984
|
}
|
|
97648
|
-
this.eventListeners[baseEvent].push({
|
|
97649
|
-
name: name,
|
|
97650
|
-
handler: handler,
|
|
97651
|
-
});
|
|
97985
|
+
this.eventListeners[baseEvent].push({ name, handler });
|
|
97652
97986
|
}
|
|
97653
97987
|
return this;
|
|
97654
97988
|
}
|
|
@@ -98280,7 +98614,7 @@ void main() {
|
|
|
98280
98614
|
var _a, _b;
|
|
98281
98615
|
const m = this._cache.get(TRANSFORM) || new Util_1.Transform();
|
|
98282
98616
|
m.reset();
|
|
98283
|
-
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;
|
|
98284
98618
|
if (x !== 0 || y !== 0) {
|
|
98285
98619
|
m.translate(x, y);
|
|
98286
98620
|
}
|
|
@@ -98482,7 +98816,7 @@ void main() {
|
|
|
98482
98816
|
_requestDraw() {
|
|
98483
98817
|
if (Global_1.Konva.autoDrawEnabled) {
|
|
98484
98818
|
const drawNode = this.getLayer() || this.getStage();
|
|
98485
|
-
drawNode === null || drawNode ===
|
|
98819
|
+
drawNode === null || drawNode === void 0 ? void 0 : drawNode.batchDraw();
|
|
98486
98820
|
}
|
|
98487
98821
|
}
|
|
98488
98822
|
_setAttr(key, val) {
|
|
@@ -98516,14 +98850,22 @@ void main() {
|
|
|
98516
98850
|
if (evt && this.nodeType === SHAPE) {
|
|
98517
98851
|
evt.target = this;
|
|
98518
98852
|
}
|
|
98519
|
-
const
|
|
98853
|
+
const nonBubbling = [
|
|
98854
|
+
MOUSEENTER,
|
|
98855
|
+
MOUSELEAVE,
|
|
98856
|
+
POINTERENTER,
|
|
98857
|
+
POINTERLEAVE,
|
|
98858
|
+
TOUCHENTER,
|
|
98859
|
+
TOUCHLEAVE,
|
|
98860
|
+
];
|
|
98861
|
+
const shouldStop = nonBubbling.indexOf(eventType) !== -1 &&
|
|
98520
98862
|
((compareShape &&
|
|
98521
98863
|
(this === compareShape ||
|
|
98522
98864
|
(this.isAncestorOf && this.isAncestorOf(compareShape)))) ||
|
|
98523
98865
|
(this.nodeType === 'Stage' && !compareShape));
|
|
98524
98866
|
if (!shouldStop) {
|
|
98525
98867
|
this._fire(eventType, evt);
|
|
98526
|
-
const stopBubble = (eventType
|
|
98868
|
+
const stopBubble = nonBubbling.indexOf(eventType) !== -1 &&
|
|
98527
98869
|
compareShape &&
|
|
98528
98870
|
compareShape.isAncestorOf &&
|
|
98529
98871
|
compareShape.isAncestorOf(this) &&
|
|
@@ -98543,13 +98885,13 @@ void main() {
|
|
|
98543
98885
|
}
|
|
98544
98886
|
_getProtoListeners(eventType) {
|
|
98545
98887
|
var _a, _b, _c;
|
|
98546
|
-
const allListeners = (_a = this._cache.get(ALL_LISTENERS)) !== null && _a !==
|
|
98547
|
-
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];
|
|
98548
98890
|
if (events === undefined) {
|
|
98549
98891
|
events = [];
|
|
98550
98892
|
let obj = Object.getPrototypeOf(this);
|
|
98551
98893
|
while (obj) {
|
|
98552
|
-
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 : [];
|
|
98553
98895
|
events.push(...hierarchyEvents);
|
|
98554
98896
|
obj = Object.getPrototypeOf(obj);
|
|
98555
98897
|
}
|
|
@@ -98564,13 +98906,13 @@ void main() {
|
|
|
98564
98906
|
evt.type = eventType;
|
|
98565
98907
|
const topListeners = this._getProtoListeners(eventType);
|
|
98566
98908
|
if (topListeners) {
|
|
98567
|
-
for (
|
|
98909
|
+
for (let i = 0; i < topListeners.length; i++) {
|
|
98568
98910
|
topListeners[i].handler.call(this, evt);
|
|
98569
98911
|
}
|
|
98570
98912
|
}
|
|
98571
98913
|
const selfListeners = this.eventListeners[eventType];
|
|
98572
98914
|
if (selfListeners) {
|
|
98573
|
-
for (
|
|
98915
|
+
for (let i = 0; i < selfListeners.length; i++) {
|
|
98574
98916
|
selfListeners[i].handler.call(this, evt);
|
|
98575
98917
|
}
|
|
98576
98918
|
}
|
|
@@ -98815,7 +99157,7 @@ void main() {
|
|
|
98815
99157
|
if (hasRequiredContainer) return Container;
|
|
98816
99158
|
hasRequiredContainer = 1;
|
|
98817
99159
|
Object.defineProperty(Container, "__esModule", { value: true });
|
|
98818
|
-
Container.Container =
|
|
99160
|
+
Container.Container = void 0;
|
|
98819
99161
|
const Factory_1 = requireFactory();
|
|
98820
99162
|
const Node_1 = requireNode();
|
|
98821
99163
|
const Validators_1 = requireValidators();
|
|
@@ -98825,17 +99167,11 @@ void main() {
|
|
|
98825
99167
|
this.children = [];
|
|
98826
99168
|
}
|
|
98827
99169
|
getChildren(filterFunc) {
|
|
98828
|
-
if (!filterFunc) {
|
|
98829
|
-
return this.children || [];
|
|
98830
|
-
}
|
|
98831
99170
|
const children = this.children || [];
|
|
98832
|
-
|
|
98833
|
-
|
|
98834
|
-
|
|
98835
|
-
|
|
98836
|
-
}
|
|
98837
|
-
});
|
|
98838
|
-
return results;
|
|
99171
|
+
if (filterFunc) {
|
|
99172
|
+
return children.filter(filterFunc);
|
|
99173
|
+
}
|
|
99174
|
+
return children;
|
|
98839
99175
|
}
|
|
98840
99176
|
hasChildren() {
|
|
98841
99177
|
return this.getChildren().length > 0;
|
|
@@ -98972,13 +99308,13 @@ void main() {
|
|
|
98972
99308
|
if (this.isCached()) {
|
|
98973
99309
|
return;
|
|
98974
99310
|
}
|
|
98975
|
-
(_a = this.children) === null || _a ===
|
|
99311
|
+
(_a = this.children) === null || _a === void 0 ? void 0 : _a.forEach(function (node) {
|
|
98976
99312
|
node._clearSelfAndDescendantCache(attr);
|
|
98977
99313
|
});
|
|
98978
99314
|
}
|
|
98979
99315
|
_setChildrenIndices() {
|
|
98980
99316
|
var _a;
|
|
98981
|
-
(_a = this.children) === null || _a ===
|
|
99317
|
+
(_a = this.children) === null || _a === void 0 ? void 0 : _a.forEach(function (child, n) {
|
|
98982
99318
|
child.index = n;
|
|
98983
99319
|
});
|
|
98984
99320
|
this._requestDraw();
|
|
@@ -99049,7 +99385,7 @@ void main() {
|
|
|
99049
99385
|
context.save();
|
|
99050
99386
|
context._applyGlobalCompositeOperation(this);
|
|
99051
99387
|
}
|
|
99052
|
-
(_a = this.children) === null || _a ===
|
|
99388
|
+
(_a = this.children) === null || _a === void 0 ? void 0 : _a.forEach(function (child) {
|
|
99053
99389
|
child[drawMethod](canvas, top, bufferCanvas);
|
|
99054
99390
|
});
|
|
99055
99391
|
if (hasComposition) {
|
|
@@ -99071,7 +99407,7 @@ void main() {
|
|
|
99071
99407
|
height: 0,
|
|
99072
99408
|
};
|
|
99073
99409
|
const that = this;
|
|
99074
|
-
(_a = this.children) === null || _a ===
|
|
99410
|
+
(_a = this.children) === null || _a === void 0 ? void 0 : _a.forEach(function (child) {
|
|
99075
99411
|
if (!child.visible()) {
|
|
99076
99412
|
return;
|
|
99077
99413
|
}
|
|
@@ -99203,7 +99539,7 @@ void main() {
|
|
|
99203
99539
|
hasRequiredStage = 1;
|
|
99204
99540
|
(function (exports) {
|
|
99205
99541
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
99206
|
-
exports.Stage = exports.stages =
|
|
99542
|
+
exports.Stage = exports.stages = void 0;
|
|
99207
99543
|
const Util_1 = requireUtil();
|
|
99208
99544
|
const Factory_1 = requireFactory();
|
|
99209
99545
|
const Container_1 = requireContainer();
|
|
@@ -99229,6 +99565,7 @@ void main() {
|
|
|
99229
99565
|
[POINTERMOVE, '_pointermove'],
|
|
99230
99566
|
[POINTERUP, '_pointerup'],
|
|
99231
99567
|
[POINTERCANCEL, '_pointercancel'],
|
|
99568
|
+
[POINTERLEAVE, '_pointerleave'],
|
|
99232
99569
|
[LOSTPOINTERCAPTURE, '_lostpointercapture'],
|
|
99233
99570
|
];
|
|
99234
99571
|
const EVENTS_MAP = {
|
|
@@ -99330,12 +99667,12 @@ void main() {
|
|
|
99330
99667
|
}
|
|
99331
99668
|
setContainer(container) {
|
|
99332
99669
|
if (typeof container === STRING) {
|
|
99670
|
+
let id;
|
|
99333
99671
|
if (container.charAt(0) === '.') {
|
|
99334
99672
|
const className = container.slice(1);
|
|
99335
99673
|
container = document.getElementsByClassName(className)[0];
|
|
99336
99674
|
}
|
|
99337
99675
|
else {
|
|
99338
|
-
var id;
|
|
99339
99676
|
if (container.charAt(0) !== '#') {
|
|
99340
99677
|
id = container;
|
|
99341
99678
|
}
|
|
@@ -99920,7 +100257,7 @@ void main() {
|
|
|
99920
100257
|
hasRequiredShape = 1;
|
|
99921
100258
|
(function (exports) {
|
|
99922
100259
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
99923
|
-
exports.Shape = exports.shapes =
|
|
100260
|
+
exports.Shape = exports.shapes = void 0;
|
|
99924
100261
|
const Global_1 = requireGlobal();
|
|
99925
100262
|
const Util_1 = requireUtil();
|
|
99926
100263
|
const Factory_1 = requireFactory();
|
|
@@ -100153,7 +100490,7 @@ void main() {
|
|
|
100153
100490
|
}
|
|
100154
100491
|
_useBufferCanvas(forceFill) {
|
|
100155
100492
|
var _a;
|
|
100156
|
-
const perfectDrawEnabled = (_a = this.attrs.perfectDrawEnabled) !== null && _a !==
|
|
100493
|
+
const perfectDrawEnabled = (_a = this.attrs.perfectDrawEnabled) !== null && _a !== void 0 ? _a : true;
|
|
100157
100494
|
if (!perfectDrawEnabled) {
|
|
100158
100495
|
return false;
|
|
100159
100496
|
}
|
|
@@ -100238,8 +100575,8 @@ void main() {
|
|
|
100238
100575
|
}
|
|
100239
100576
|
drawScene(can, top, bufferCanvas) {
|
|
100240
100577
|
const layer = this.getLayer();
|
|
100241
|
-
|
|
100242
|
-
|
|
100578
|
+
const canvas = can || layer.getCanvas(), context = canvas.getContext(), cachedCanvas = this._getCanvasCache(), drawFunc = this.getSceneFunc(), hasShadow = this.hasShadow();
|
|
100579
|
+
let stage;
|
|
100243
100580
|
const cachingSelf = top === this;
|
|
100244
100581
|
if (!this.isVisible() && !cachingSelf) {
|
|
100245
100582
|
return this;
|
|
@@ -100256,14 +100593,14 @@ void main() {
|
|
|
100256
100593
|
return this;
|
|
100257
100594
|
}
|
|
100258
100595
|
context.save();
|
|
100259
|
-
if (this._useBufferCanvas() &&
|
|
100596
|
+
if (this._useBufferCanvas() && true) {
|
|
100260
100597
|
stage = this.getStage();
|
|
100261
100598
|
const bc = bufferCanvas || stage.bufferCanvas;
|
|
100262
|
-
bufferContext = bc.getContext();
|
|
100599
|
+
const bufferContext = bc.getContext();
|
|
100263
100600
|
bufferContext.clear();
|
|
100264
100601
|
bufferContext.save();
|
|
100265
100602
|
bufferContext._applyLineJoin(this);
|
|
100266
|
-
|
|
100603
|
+
const o = this.getAbsoluteTransform(top).getMatrix();
|
|
100267
100604
|
bufferContext.transform(o[0], o[1], o[2], o[3], o[4], o[5]);
|
|
100268
100605
|
drawFunc.call(this, bufferContext, this);
|
|
100269
100606
|
bufferContext.restore();
|
|
@@ -100273,12 +100610,12 @@ void main() {
|
|
|
100273
100610
|
}
|
|
100274
100611
|
context._applyOpacity(this);
|
|
100275
100612
|
context._applyGlobalCompositeOperation(this);
|
|
100276
|
-
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);
|
|
100277
100614
|
}
|
|
100278
100615
|
else {
|
|
100279
100616
|
context._applyLineJoin(this);
|
|
100280
100617
|
if (!cachingSelf) {
|
|
100281
|
-
|
|
100618
|
+
const o = this.getAbsoluteTransform(top).getMatrix();
|
|
100282
100619
|
context.transform(o[0], o[1], o[2], o[3], o[4], o[5]);
|
|
100283
100620
|
context._applyOpacity(this);
|
|
100284
100621
|
context._applyGlobalCompositeOperation(this);
|
|
@@ -100473,7 +100810,7 @@ void main() {
|
|
|
100473
100810
|
if (hasRequiredLayer) return Layer;
|
|
100474
100811
|
hasRequiredLayer = 1;
|
|
100475
100812
|
Object.defineProperty(Layer, "__esModule", { value: true });
|
|
100476
|
-
Layer.Layer =
|
|
100813
|
+
Layer.Layer = void 0;
|
|
100477
100814
|
const Util_1 = requireUtil();
|
|
100478
100815
|
const Container_1 = requireContainer();
|
|
100479
100816
|
const Node_1 = requireNode();
|
|
@@ -100718,7 +101055,7 @@ void main() {
|
|
|
100718
101055
|
}
|
|
100719
101056
|
return {};
|
|
100720
101057
|
}
|
|
100721
|
-
drawScene(can, top) {
|
|
101058
|
+
drawScene(can, top, bufferCanvas) {
|
|
100722
101059
|
const layer = this.getLayer(), canvas = can || (layer && layer.getCanvas());
|
|
100723
101060
|
this._fire(BEFORE_DRAW, {
|
|
100724
101061
|
node: this,
|
|
@@ -100726,7 +101063,7 @@ void main() {
|
|
|
100726
101063
|
if (this.clearBeforeDraw()) {
|
|
100727
101064
|
canvas.getContext().clear();
|
|
100728
101065
|
}
|
|
100729
|
-
Container_1.Container.prototype.drawScene.call(this, canvas, top);
|
|
101066
|
+
Container_1.Container.prototype.drawScene.call(this, canvas, top, bufferCanvas);
|
|
100730
101067
|
this._fire(DRAW, {
|
|
100731
101068
|
node: this,
|
|
100732
101069
|
});
|
|
@@ -100791,7 +101128,7 @@ void main() {
|
|
|
100791
101128
|
if (hasRequiredFastLayer) return FastLayer;
|
|
100792
101129
|
hasRequiredFastLayer = 1;
|
|
100793
101130
|
Object.defineProperty(FastLayer, "__esModule", { value: true });
|
|
100794
|
-
FastLayer.FastLayer =
|
|
101131
|
+
FastLayer.FastLayer = void 0;
|
|
100795
101132
|
const Util_1 = requireUtil();
|
|
100796
101133
|
const Layer_1 = requireLayer();
|
|
100797
101134
|
const Global_1 = requireGlobal();
|
|
@@ -100816,7 +101153,7 @@ void main() {
|
|
|
100816
101153
|
if (hasRequiredGroup) return Group;
|
|
100817
101154
|
hasRequiredGroup = 1;
|
|
100818
101155
|
Object.defineProperty(Group, "__esModule", { value: true });
|
|
100819
|
-
Group.Group =
|
|
101156
|
+
Group.Group = void 0;
|
|
100820
101157
|
const Util_1 = requireUtil();
|
|
100821
101158
|
const Container_1 = requireContainer();
|
|
100822
101159
|
const Global_1 = requireGlobal();
|
|
@@ -100842,7 +101179,7 @@ void main() {
|
|
|
100842
101179
|
if (hasRequiredAnimation) return Animation;
|
|
100843
101180
|
hasRequiredAnimation = 1;
|
|
100844
101181
|
Object.defineProperty(Animation, "__esModule", { value: true });
|
|
100845
|
-
Animation.Animation =
|
|
101182
|
+
Animation.Animation = void 0;
|
|
100846
101183
|
const Global_1 = requireGlobal();
|
|
100847
101184
|
const Util_1 = requireUtil();
|
|
100848
101185
|
const now = (function () {
|
|
@@ -100998,7 +101335,7 @@ void main() {
|
|
|
100998
101335
|
hasRequiredTween = 1;
|
|
100999
101336
|
(function (exports) {
|
|
101000
101337
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
101001
|
-
exports.Easings = exports.Tween =
|
|
101338
|
+
exports.Easings = exports.Tween = void 0;
|
|
101002
101339
|
const Util_1 = requireUtil();
|
|
101003
101340
|
const Animation_1 = requireAnimation();
|
|
101004
101341
|
const Node_1 = requireNode();
|
|
@@ -101354,10 +101691,21 @@ void main() {
|
|
|
101354
101691
|
destroy() {
|
|
101355
101692
|
const nodeId = this.node._id, thisId = this._id, attrs = Tween.tweens[nodeId];
|
|
101356
101693
|
this.pause();
|
|
101694
|
+
if (this.anim) {
|
|
101695
|
+
this.anim.stop();
|
|
101696
|
+
}
|
|
101357
101697
|
for (const key in attrs) {
|
|
101358
101698
|
delete Tween.tweens[nodeId][key];
|
|
101359
101699
|
}
|
|
101360
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
|
+
}
|
|
101361
101709
|
}
|
|
101362
101710
|
}
|
|
101363
101711
|
exports.Tween = Tween;
|
|
@@ -101531,7 +101879,7 @@ void main() {
|
|
|
101531
101879
|
hasRequired_CoreInternals = 1;
|
|
101532
101880
|
(function (exports) {
|
|
101533
101881
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
101534
|
-
exports.Konva =
|
|
101882
|
+
exports.Konva = void 0;
|
|
101535
101883
|
const Global_1 = requireGlobal();
|
|
101536
101884
|
const Util_1 = requireUtil();
|
|
101537
101885
|
const Node_1 = requireNode();
|
|
@@ -101578,7 +101926,7 @@ void main() {
|
|
|
101578
101926
|
if (hasRequiredArc) return Arc;
|
|
101579
101927
|
hasRequiredArc = 1;
|
|
101580
101928
|
Object.defineProperty(Arc, "__esModule", { value: true });
|
|
101581
|
-
Arc.Arc =
|
|
101929
|
+
Arc.Arc = void 0;
|
|
101582
101930
|
const Factory_1 = requireFactory();
|
|
101583
101931
|
const Shape_1 = requireShape();
|
|
101584
101932
|
const Global_1 = requireGlobal();
|
|
@@ -101629,7 +101977,12 @@ void main() {
|
|
|
101629
101977
|
Arc.Arc = Arc$1;
|
|
101630
101978
|
Arc$1.prototype._centroid = true;
|
|
101631
101979
|
Arc$1.prototype.className = 'Arc';
|
|
101632
|
-
Arc$1.prototype._attrsAffectingSize = [
|
|
101980
|
+
Arc$1.prototype._attrsAffectingSize = [
|
|
101981
|
+
'innerRadius',
|
|
101982
|
+
'outerRadius',
|
|
101983
|
+
'angle',
|
|
101984
|
+
'clockwise',
|
|
101985
|
+
];
|
|
101633
101986
|
(0, Global_2._registerNode)(Arc$1);
|
|
101634
101987
|
Factory_1.Factory.addGetterSetter(Arc$1, 'innerRadius', 0, (0, Validators_1.getNumberValidator)());
|
|
101635
101988
|
Factory_1.Factory.addGetterSetter(Arc$1, 'outerRadius', 0, (0, Validators_1.getNumberValidator)());
|
|
@@ -101648,7 +102001,7 @@ void main() {
|
|
|
101648
102001
|
if (hasRequiredLine) return Line;
|
|
101649
102002
|
hasRequiredLine = 1;
|
|
101650
102003
|
Object.defineProperty(Line, "__esModule", { value: true });
|
|
101651
|
-
Line.Line =
|
|
102004
|
+
Line.Line = void 0;
|
|
101652
102005
|
const Factory_1 = requireFactory();
|
|
101653
102006
|
const Global_1 = requireGlobal();
|
|
101654
102007
|
const Shape_1 = requireShape();
|
|
@@ -101681,15 +102034,16 @@ void main() {
|
|
|
101681
102034
|
});
|
|
101682
102035
|
}
|
|
101683
102036
|
_sceneFunc(context) {
|
|
101684
|
-
|
|
102037
|
+
const points = this.points(), length = points.length, tension = this.tension(), closed = this.closed(), bezier = this.bezier();
|
|
101685
102038
|
if (!length) {
|
|
101686
102039
|
return;
|
|
101687
102040
|
}
|
|
102041
|
+
let n = 0;
|
|
101688
102042
|
context.beginPath();
|
|
101689
102043
|
context.moveTo(points[0], points[1]);
|
|
101690
102044
|
if (tension !== 0 && length > 4) {
|
|
101691
|
-
tp = this.getTensionPoints();
|
|
101692
|
-
len = tp.length;
|
|
102045
|
+
const tp = this.getTensionPoints();
|
|
102046
|
+
const len = tp.length;
|
|
101693
102047
|
n = closed ? 0 : 4;
|
|
101694
102048
|
if (!closed) {
|
|
101695
102049
|
context.quadraticCurveTo(tp[0], tp[1], tp[2], tp[3]);
|
|
@@ -101819,7 +102173,7 @@ void main() {
|
|
|
101819
102173
|
hasRequiredBezierFunctions = 1;
|
|
101820
102174
|
(function (exports) {
|
|
101821
102175
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
101822
|
-
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;
|
|
101823
102177
|
exports.tValues = [
|
|
101824
102178
|
[],
|
|
101825
102179
|
[],
|
|
@@ -102617,10 +102971,10 @@ void main() {
|
|
|
102617
102971
|
if (hasRequiredPath) return Path;
|
|
102618
102972
|
hasRequiredPath = 1;
|
|
102619
102973
|
Object.defineProperty(Path, "__esModule", { value: true });
|
|
102620
|
-
Path.Path =
|
|
102974
|
+
Path.Path = void 0;
|
|
102621
102975
|
const Factory_1 = requireFactory();
|
|
102622
|
-
const Shape_1 = requireShape();
|
|
102623
102976
|
const Global_1 = requireGlobal();
|
|
102977
|
+
const Shape_1 = requireShape();
|
|
102624
102978
|
const BezierFunctions_1 = requireBezierFunctions();
|
|
102625
102979
|
let Path$1 = class Path extends Shape_1.Shape {
|
|
102626
102980
|
constructor(config) {
|
|
@@ -102657,10 +103011,10 @@ void main() {
|
|
|
102657
103011
|
context.quadraticCurveTo(p[0], p[1], p[2], p[3]);
|
|
102658
103012
|
break;
|
|
102659
103013
|
case 'A':
|
|
102660
|
-
|
|
102661
|
-
|
|
102662
|
-
|
|
102663
|
-
|
|
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;
|
|
102664
103018
|
context.translate(cx, cy);
|
|
102665
103019
|
context.rotate(psi);
|
|
102666
103020
|
context.scale(scaleX, scaleY);
|
|
@@ -102773,11 +103127,20 @@ void main() {
|
|
|
102773
103127
|
};
|
|
102774
103128
|
}
|
|
102775
103129
|
if (length < 0.01) {
|
|
102776
|
-
|
|
102777
|
-
|
|
102778
|
-
|
|
102779
|
-
|
|
102780
|
-
|
|
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
|
+
}
|
|
102781
103144
|
}
|
|
102782
103145
|
const cp = dataArray[i];
|
|
102783
103146
|
const p = cp.points;
|
|
@@ -102793,15 +103156,16 @@ void main() {
|
|
|
102793
103156
|
return (0, BezierFunctions_1.getQuadraticArcLength)([cp.start.x, p[0], p[2]], [cp.start.y, p[1], p[3]], i);
|
|
102794
103157
|
}), cp.start.x, cp.start.y, p[0], p[1], p[2], p[3]);
|
|
102795
103158
|
case 'A':
|
|
102796
|
-
|
|
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];
|
|
102797
103161
|
theta += (dTheta * length) / cp.pathLength;
|
|
102798
103162
|
return Path.getPointOnEllipticalArc(cx, cy, rx, ry, theta, psi);
|
|
102799
103163
|
}
|
|
102800
103164
|
return null;
|
|
102801
103165
|
}
|
|
102802
103166
|
static getPointOnLine(dist, P1x, P1y, P2x, P2y, fromX, fromY) {
|
|
102803
|
-
fromX = fromX !== null && fromX !==
|
|
102804
|
-
fromY = fromY !== null && fromY !==
|
|
103167
|
+
fromX = fromX !== null && fromX !== void 0 ? fromX : P1x;
|
|
103168
|
+
fromY = fromY !== null && fromY !== void 0 ? fromY : P1y;
|
|
102805
103169
|
const len = this.getLineLength(P1x, P1y, P2x, P2y);
|
|
102806
103170
|
if (len < 1e-10) {
|
|
102807
103171
|
return { x: P1x, y: P1y };
|
|
@@ -102839,10 +103203,7 @@ void main() {
|
|
|
102839
103203
|
}
|
|
102840
103204
|
const x = P4x * CB1(pct) + P3x * CB2(pct) + P2x * CB3(pct) + P1x * CB4(pct);
|
|
102841
103205
|
const y = P4y * CB1(pct) + P3y * CB2(pct) + P2y * CB3(pct) + P1y * CB4(pct);
|
|
102842
|
-
return {
|
|
102843
|
-
x: x,
|
|
102844
|
-
y: y,
|
|
102845
|
-
};
|
|
103206
|
+
return { x, y };
|
|
102846
103207
|
}
|
|
102847
103208
|
static getPointOnQuadraticBezier(pct, P1x, P1y, P2x, P2y, P3x, P3y) {
|
|
102848
103209
|
function QB1(t) {
|
|
@@ -102856,10 +103217,7 @@ void main() {
|
|
|
102856
103217
|
}
|
|
102857
103218
|
const x = P3x * QB1(pct) + P2x * QB2(pct) + P1x * QB3(pct);
|
|
102858
103219
|
const y = P3y * QB1(pct) + P2y * QB2(pct) + P1y * QB3(pct);
|
|
102859
|
-
return {
|
|
102860
|
-
x: x,
|
|
102861
|
-
y: y,
|
|
102862
|
-
};
|
|
103220
|
+
return { x, y };
|
|
102863
103221
|
}
|
|
102864
103222
|
static getPointOnEllipticalArc(cx, cy, rx, ry, theta, psi) {
|
|
102865
103223
|
const cosPsi = Math.cos(psi), sinPsi = Math.sin(psi);
|
|
@@ -102900,7 +103258,7 @@ void main() {
|
|
|
102900
103258
|
'A',
|
|
102901
103259
|
];
|
|
102902
103260
|
cs = cs.replace(new RegExp(' ', 'g'), ',');
|
|
102903
|
-
for (
|
|
103261
|
+
for (let n = 0; n < cc.length; n++) {
|
|
102904
103262
|
cs = cs.replace(new RegExp(cc[n], 'g'), '|' + cc[n]);
|
|
102905
103263
|
}
|
|
102906
103264
|
const arr = cs.split('|');
|
|
@@ -102910,7 +103268,7 @@ void main() {
|
|
|
102910
103268
|
let cpy = 0;
|
|
102911
103269
|
const re = /([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:e[-+]?\d+)?)/gi;
|
|
102912
103270
|
let match;
|
|
102913
|
-
for (n = 1; n < arr.length; n++) {
|
|
103271
|
+
for (let n = 1; n < arr.length; n++) {
|
|
102914
103272
|
let str = arr[n];
|
|
102915
103273
|
let c = str.charAt(0);
|
|
102916
103274
|
str = str.slice(1);
|
|
@@ -102939,8 +103297,8 @@ void main() {
|
|
|
102939
103297
|
let cmd = '';
|
|
102940
103298
|
let points = [];
|
|
102941
103299
|
const startX = cpx, startY = cpy;
|
|
102942
|
-
|
|
102943
|
-
|
|
103300
|
+
let prevCmd, ctlPtx, ctlPty;
|
|
103301
|
+
let rx, ry, psi, fa, fs, x1, y1;
|
|
102944
103302
|
switch (c) {
|
|
102945
103303
|
case 'l':
|
|
102946
103304
|
cpx += p.shift();
|
|
@@ -102954,8 +103312,8 @@ void main() {
|
|
|
102954
103312
|
points.push(cpx, cpy);
|
|
102955
103313
|
break;
|
|
102956
103314
|
case 'm':
|
|
102957
|
-
|
|
102958
|
-
|
|
103315
|
+
const dx = p.shift();
|
|
103316
|
+
const dy = p.shift();
|
|
102959
103317
|
cpx += dx;
|
|
102960
103318
|
cpy += dy;
|
|
102961
103319
|
cmd = 'M';
|
|
@@ -103138,10 +103496,10 @@ void main() {
|
|
|
103138
103496
|
return (0, BezierFunctions_1.getQuadraticArcLength)([x, points[0], points[2]], [y, points[1], points[3]], 1);
|
|
103139
103497
|
case 'A':
|
|
103140
103498
|
len = 0.0;
|
|
103141
|
-
|
|
103142
|
-
|
|
103143
|
-
|
|
103144
|
-
|
|
103499
|
+
const start = points[4];
|
|
103500
|
+
const dTheta = points[5];
|
|
103501
|
+
const end = points[4] + dTheta;
|
|
103502
|
+
let inc = Math.PI / 180.0;
|
|
103145
103503
|
if (Math.abs(start - end) < inc) {
|
|
103146
103504
|
inc = Math.abs(start - end);
|
|
103147
103505
|
}
|
|
@@ -103230,7 +103588,7 @@ void main() {
|
|
|
103230
103588
|
if (hasRequiredArrow) return Arrow;
|
|
103231
103589
|
hasRequiredArrow = 1;
|
|
103232
103590
|
Object.defineProperty(Arrow, "__esModule", { value: true });
|
|
103233
|
-
Arrow.Arrow =
|
|
103591
|
+
Arrow.Arrow = void 0;
|
|
103234
103592
|
const Factory_1 = requireFactory();
|
|
103235
103593
|
const Line_1 = requireLine();
|
|
103236
103594
|
const Validators_1 = requireValidators();
|
|
@@ -103342,7 +103700,7 @@ void main() {
|
|
|
103342
103700
|
if (hasRequiredCircle) return Circle;
|
|
103343
103701
|
hasRequiredCircle = 1;
|
|
103344
103702
|
Object.defineProperty(Circle, "__esModule", { value: true });
|
|
103345
|
-
Circle.Circle =
|
|
103703
|
+
Circle.Circle = void 0;
|
|
103346
103704
|
const Factory_1 = requireFactory();
|
|
103347
103705
|
const Shape_1 = requireShape();
|
|
103348
103706
|
const Validators_1 = requireValidators();
|
|
@@ -103388,7 +103746,7 @@ void main() {
|
|
|
103388
103746
|
if (hasRequiredEllipse) return Ellipse;
|
|
103389
103747
|
hasRequiredEllipse = 1;
|
|
103390
103748
|
Object.defineProperty(Ellipse, "__esModule", { value: true });
|
|
103391
|
-
Ellipse.Ellipse =
|
|
103749
|
+
Ellipse.Ellipse = void 0;
|
|
103392
103750
|
const Factory_1 = requireFactory();
|
|
103393
103751
|
const Shape_1 = requireShape();
|
|
103394
103752
|
const Validators_1 = requireValidators();
|
|
@@ -103438,7 +103796,7 @@ void main() {
|
|
|
103438
103796
|
if (hasRequiredImage) return Image$1;
|
|
103439
103797
|
hasRequiredImage = 1;
|
|
103440
103798
|
Object.defineProperty(Image$1, "__esModule", { value: true });
|
|
103441
|
-
Image$1.Image =
|
|
103799
|
+
Image$1.Image = void 0;
|
|
103442
103800
|
const Util_1 = requireUtil();
|
|
103443
103801
|
const Factory_1 = requireFactory();
|
|
103444
103802
|
const Shape_1 = requireShape();
|
|
@@ -103447,7 +103805,11 @@ void main() {
|
|
|
103447
103805
|
class Image extends Shape_1.Shape {
|
|
103448
103806
|
constructor(attrs) {
|
|
103449
103807
|
super(attrs);
|
|
103450
|
-
this.
|
|
103808
|
+
this._loadListener = () => {
|
|
103809
|
+
this._requestDraw();
|
|
103810
|
+
};
|
|
103811
|
+
this.on('imageChange.konva', (props) => {
|
|
103812
|
+
this._removeImageLoad(props.oldVal);
|
|
103451
103813
|
this._setImageLoad();
|
|
103452
103814
|
});
|
|
103453
103815
|
this._setImageLoad();
|
|
@@ -103461,11 +103823,19 @@ void main() {
|
|
|
103461
103823
|
return;
|
|
103462
103824
|
}
|
|
103463
103825
|
if (image && image['addEventListener']) {
|
|
103464
|
-
image['addEventListener']('load',
|
|
103465
|
-
this._requestDraw();
|
|
103466
|
-
});
|
|
103826
|
+
image['addEventListener']('load', this._loadListener);
|
|
103467
103827
|
}
|
|
103468
103828
|
}
|
|
103829
|
+
_removeImageLoad(image) {
|
|
103830
|
+
if (image && image['removeEventListener']) {
|
|
103831
|
+
image['removeEventListener']('load', this._loadListener);
|
|
103832
|
+
}
|
|
103833
|
+
}
|
|
103834
|
+
destroy() {
|
|
103835
|
+
this._removeImageLoad(this.image());
|
|
103836
|
+
super.destroy();
|
|
103837
|
+
return this;
|
|
103838
|
+
}
|
|
103469
103839
|
_useBufferCanvas() {
|
|
103470
103840
|
const hasCornerRadius = !!this.cornerRadius();
|
|
103471
103841
|
const hasShadow = this.hasShadow();
|
|
@@ -103529,11 +103899,11 @@ void main() {
|
|
|
103529
103899
|
}
|
|
103530
103900
|
getWidth() {
|
|
103531
103901
|
var _a, _b;
|
|
103532
|
-
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;
|
|
103533
103903
|
}
|
|
103534
103904
|
getHeight() {
|
|
103535
103905
|
var _a, _b;
|
|
103536
|
-
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;
|
|
103537
103907
|
}
|
|
103538
103908
|
static fromURL(url, callback, onError = null) {
|
|
103539
103909
|
const img = Util_1.Util.createImageElement();
|
|
@@ -103569,7 +103939,7 @@ void main() {
|
|
|
103569
103939
|
if (hasRequiredLabel) return Label;
|
|
103570
103940
|
hasRequiredLabel = 1;
|
|
103571
103941
|
Object.defineProperty(Label, "__esModule", { value: true });
|
|
103572
|
-
Label.Tag = Label.Label =
|
|
103942
|
+
Label.Tag = Label.Label = void 0;
|
|
103573
103943
|
const Factory_1 = requireFactory();
|
|
103574
103944
|
const Shape_1 = requireShape();
|
|
103575
103945
|
const Group_1 = requireGroup();
|
|
@@ -103756,7 +104126,7 @@ void main() {
|
|
|
103756
104126
|
if (hasRequiredRect) return Rect;
|
|
103757
104127
|
hasRequiredRect = 1;
|
|
103758
104128
|
Object.defineProperty(Rect, "__esModule", { value: true });
|
|
103759
|
-
Rect.Rect =
|
|
104129
|
+
Rect.Rect = void 0;
|
|
103760
104130
|
const Factory_1 = requireFactory();
|
|
103761
104131
|
const Shape_1 = requireShape();
|
|
103762
104132
|
const Global_1 = requireGlobal();
|
|
@@ -103791,7 +104161,7 @@ void main() {
|
|
|
103791
104161
|
if (hasRequiredRegularPolygon) return RegularPolygon;
|
|
103792
104162
|
hasRequiredRegularPolygon = 1;
|
|
103793
104163
|
Object.defineProperty(RegularPolygon, "__esModule", { value: true });
|
|
103794
|
-
RegularPolygon.RegularPolygon =
|
|
104164
|
+
RegularPolygon.RegularPolygon = void 0;
|
|
103795
104165
|
const Factory_1 = requireFactory();
|
|
103796
104166
|
const Shape_1 = requireShape();
|
|
103797
104167
|
const Validators_1 = requireValidators();
|
|
@@ -103869,7 +104239,7 @@ void main() {
|
|
|
103869
104239
|
if (hasRequiredRing) return Ring;
|
|
103870
104240
|
hasRequiredRing = 1;
|
|
103871
104241
|
Object.defineProperty(Ring, "__esModule", { value: true });
|
|
103872
|
-
Ring.Ring =
|
|
104242
|
+
Ring.Ring = void 0;
|
|
103873
104243
|
const Factory_1 = requireFactory();
|
|
103874
104244
|
const Shape_1 = requireShape();
|
|
103875
104245
|
const Validators_1 = requireValidators();
|
|
@@ -103915,7 +104285,7 @@ void main() {
|
|
|
103915
104285
|
if (hasRequiredSprite) return Sprite;
|
|
103916
104286
|
hasRequiredSprite = 1;
|
|
103917
104287
|
Object.defineProperty(Sprite, "__esModule", { value: true });
|
|
103918
|
-
Sprite.Sprite =
|
|
104288
|
+
Sprite.Sprite = void 0;
|
|
103919
104289
|
const Factory_1 = requireFactory();
|
|
103920
104290
|
const Shape_1 = requireShape();
|
|
103921
104291
|
const Animation_1 = requireAnimation();
|
|
@@ -104036,7 +104406,7 @@ void main() {
|
|
|
104036
104406
|
if (hasRequiredStar) return Star;
|
|
104037
104407
|
hasRequiredStar = 1;
|
|
104038
104408
|
Object.defineProperty(Star, "__esModule", { value: true });
|
|
104039
|
-
Star.Star =
|
|
104409
|
+
Star.Star = void 0;
|
|
104040
104410
|
const Factory_1 = requireFactory();
|
|
104041
104411
|
const Shape_1 = requireShape();
|
|
104042
104412
|
const Validators_1 = requireValidators();
|
|
@@ -104087,7 +104457,7 @@ void main() {
|
|
|
104087
104457
|
if (hasRequiredText) return Text;
|
|
104088
104458
|
hasRequiredText = 1;
|
|
104089
104459
|
Object.defineProperty(Text, "__esModule", { value: true });
|
|
104090
|
-
Text.Text =
|
|
104460
|
+
Text.Text = void 0;
|
|
104091
104461
|
Text.stringToArray = stringToArray;
|
|
104092
104462
|
const Util_1 = requireUtil();
|
|
104093
104463
|
const Factory_1 = requireFactory();
|
|
@@ -104200,8 +104570,6 @@ void main() {
|
|
|
104200
104570
|
(metrics.fontBoundingBoxAscent - metrics.fontBoundingBoxDescent) / 2 +
|
|
104201
104571
|
lineHeightPx / 2;
|
|
104202
104572
|
}
|
|
104203
|
-
var lineTranslateX = 0;
|
|
104204
|
-
var lineTranslateY = 0;
|
|
104205
104573
|
if (direction === RTL) {
|
|
104206
104574
|
context.setAttr('direction', direction);
|
|
104207
104575
|
}
|
|
@@ -104216,9 +104584,9 @@ void main() {
|
|
|
104216
104584
|
}
|
|
104217
104585
|
context.translate(padding, alignY + padding);
|
|
104218
104586
|
for (n = 0; n < textArrLen; n++) {
|
|
104219
|
-
|
|
104220
|
-
|
|
104221
|
-
|
|
104587
|
+
let lineTranslateX = 0;
|
|
104588
|
+
let lineTranslateY = 0;
|
|
104589
|
+
const obj = textArr[n], text = obj.text, width = obj.width, lastLine = obj.lastInParagraph;
|
|
104222
104590
|
context.save();
|
|
104223
104591
|
if (align === RIGHT) {
|
|
104224
104592
|
lineTranslateX += totalWidth - width - padding * 2;
|
|
@@ -104235,9 +104603,7 @@ void main() {
|
|
|
104235
104603
|
const x = lineTranslateX;
|
|
104236
104604
|
const y = translateY + lineTranslateY + yOffset;
|
|
104237
104605
|
context.moveTo(x, y);
|
|
104238
|
-
|
|
104239
|
-
lineWidth =
|
|
104240
|
-
align === JUSTIFY && !lastLine ? totalWidth - padding * 2 : width;
|
|
104606
|
+
const lineWidth = align === JUSTIFY && !lastLine ? totalWidth - padding * 2 : width;
|
|
104241
104607
|
context.lineTo(x + Math.round(lineWidth), y);
|
|
104242
104608
|
context.lineWidth = fontSize / 15;
|
|
104243
104609
|
const gradient = this._getLinearGradient();
|
|
@@ -104250,9 +104616,7 @@ void main() {
|
|
|
104250
104616
|
context.beginPath();
|
|
104251
104617
|
const yOffset = Global_1.Konva._fixTextRendering ? -Math.round(fontSize / 4) : 0;
|
|
104252
104618
|
context.moveTo(lineTranslateX, translateY + lineTranslateY + yOffset);
|
|
104253
|
-
|
|
104254
|
-
lineWidth =
|
|
104255
|
-
align === JUSTIFY && !lastLine ? totalWidth - padding * 2 : width;
|
|
104619
|
+
const lineWidth = align === JUSTIFY && !lastLine ? totalWidth - padding * 2 : width;
|
|
104256
104620
|
context.lineTo(lineTranslateX + Math.round(lineWidth), translateY + lineTranslateY + yOffset);
|
|
104257
104621
|
context.lineWidth = fontSize / 15;
|
|
104258
104622
|
const gradient = this._getLinearGradient();
|
|
@@ -104261,7 +104625,7 @@ void main() {
|
|
|
104261
104625
|
context.restore();
|
|
104262
104626
|
}
|
|
104263
104627
|
if (direction !== RTL && (letterSpacing !== 0 || align === JUSTIFY)) {
|
|
104264
|
-
spacesNumber = text.split(' ').length - 1;
|
|
104628
|
+
const spacesNumber = text.split(' ').length - 1;
|
|
104265
104629
|
const array = stringToArray(text);
|
|
104266
104630
|
for (let li = 0; li < array.length; li++) {
|
|
104267
104631
|
const letter = array[li];
|
|
@@ -104333,17 +104697,17 @@ void main() {
|
|
|
104333
104697
|
_context.restore();
|
|
104334
104698
|
const scaleFactor = fontSize / 100;
|
|
104335
104699
|
return {
|
|
104336
|
-
actualBoundingBoxAscent: (_a = metrics.actualBoundingBoxAscent) !== null && _a !==
|
|
104337
|
-
actualBoundingBoxDescent: (_b = metrics.actualBoundingBoxDescent) !== null && _b !==
|
|
104338
|
-
actualBoundingBoxLeft: (_c = metrics.actualBoundingBoxLeft) !== null && _c !==
|
|
104339
|
-
actualBoundingBoxRight: (_d = metrics.actualBoundingBoxRight) !== null && _d !==
|
|
104340
|
-
alphabeticBaseline: (_e = metrics.alphabeticBaseline) !== null && _e !==
|
|
104341
|
-
emHeightAscent: (_f = metrics.emHeightAscent) !== null && _f !==
|
|
104342
|
-
emHeightDescent: (_g = metrics.emHeightDescent) !== null && _g !==
|
|
104343
|
-
fontBoundingBoxAscent: (_h = metrics.fontBoundingBoxAscent) !== null && _h !==
|
|
104344
|
-
fontBoundingBoxDescent: (_j = metrics.fontBoundingBoxDescent) !== null && _j !==
|
|
104345
|
-
hangingBaseline: (_k = metrics.hangingBaseline) !== null && _k !==
|
|
104346
|
-
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,
|
|
104347
104711
|
width: metrics.width,
|
|
104348
104712
|
height: fontSize,
|
|
104349
104713
|
};
|
|
@@ -104387,8 +104751,14 @@ void main() {
|
|
|
104387
104751
|
while (line.length > 0) {
|
|
104388
104752
|
let low = 0, high = stringToArray(line).length, match = '', matchWidth = 0;
|
|
104389
104753
|
while (low < high) {
|
|
104390
|
-
const mid = (low + high) >>> 1, lineArray = stringToArray(line), substr = lineArray.slice(0, mid + 1).join(''), substrWidth = this._getTextWidth(substr)
|
|
104391
|
-
|
|
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) {
|
|
104392
104762
|
low = mid + 1;
|
|
104393
104763
|
match = substr;
|
|
104394
104764
|
matchWidth = substrWidth;
|
|
@@ -104535,7 +104905,7 @@ void main() {
|
|
|
104535
104905
|
if (hasRequiredTextPath) return TextPath;
|
|
104536
104906
|
hasRequiredTextPath = 1;
|
|
104537
104907
|
Object.defineProperty(TextPath, "__esModule", { value: true });
|
|
104538
|
-
TextPath.TextPath =
|
|
104908
|
+
TextPath.TextPath = void 0;
|
|
104539
104909
|
const Util_1 = requireUtil();
|
|
104540
104910
|
const Factory_1 = requireFactory();
|
|
104541
104911
|
const Shape_1 = requireShape();
|
|
@@ -104785,7 +105155,7 @@ void main() {
|
|
|
104785
105155
|
if (hasRequiredTransformer) return Transformer;
|
|
104786
105156
|
hasRequiredTransformer = 1;
|
|
104787
105157
|
Object.defineProperty(Transformer, "__esModule", { value: true });
|
|
104788
|
-
Transformer.Transformer =
|
|
105158
|
+
Transformer.Transformer = void 0;
|
|
104789
105159
|
const Util_1 = requireUtil();
|
|
104790
105160
|
const Factory_1 = requireFactory();
|
|
104791
105161
|
const Node_1 = requireNode();
|
|
@@ -104982,10 +105352,12 @@ void main() {
|
|
|
104982
105352
|
this.update();
|
|
104983
105353
|
}
|
|
104984
105354
|
};
|
|
104985
|
-
|
|
104986
|
-
|
|
104987
|
-
|
|
104988
|
-
|
|
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
|
+
}
|
|
104989
105361
|
node.on(TRANSFORM_CHANGE_STR.map((e) => e + `.${this._getEventNamespace()}`).join(' '), onChange);
|
|
104990
105362
|
node.on(`absoluteTransformChange.${this._getEventNamespace()}`, onChange);
|
|
104991
105363
|
this._proxyDrag(node);
|
|
@@ -105304,10 +105676,10 @@ void main() {
|
|
|
105304
105676
|
else {
|
|
105305
105677
|
keepProportion = this.keepRatio() || e.shiftKey;
|
|
105306
105678
|
}
|
|
105307
|
-
|
|
105679
|
+
let centeredScaling = this.centeredScaling() || e.altKey;
|
|
105308
105680
|
if (this._movingAnchorName === 'top-left') {
|
|
105309
105681
|
if (keepProportion) {
|
|
105310
|
-
|
|
105682
|
+
const comparePoint = centeredScaling
|
|
105311
105683
|
? {
|
|
105312
105684
|
x: this.width() / 2,
|
|
105313
105685
|
y: this.height() / 2,
|
|
@@ -105318,8 +105690,8 @@ void main() {
|
|
|
105318
105690
|
};
|
|
105319
105691
|
newHypotenuse = Math.sqrt(Math.pow(comparePoint.x - anchorNode.x(), 2) +
|
|
105320
105692
|
Math.pow(comparePoint.y - anchorNode.y(), 2));
|
|
105321
|
-
|
|
105322
|
-
|
|
105693
|
+
const reverseX = this.findOne('.top-left').x() > comparePoint.x ? -1 : 1;
|
|
105694
|
+
const reverseY = this.findOne('.top-left').y() > comparePoint.y ? -1 : 1;
|
|
105323
105695
|
x = newHypotenuse * this.cos * reverseX;
|
|
105324
105696
|
y = newHypotenuse * this.sin * reverseY;
|
|
105325
105697
|
this.findOne('.top-left').x(comparePoint.x - x);
|
|
@@ -105331,7 +105703,7 @@ void main() {
|
|
|
105331
105703
|
}
|
|
105332
105704
|
else if (this._movingAnchorName === 'top-right') {
|
|
105333
105705
|
if (keepProportion) {
|
|
105334
|
-
|
|
105706
|
+
const comparePoint = centeredScaling
|
|
105335
105707
|
? {
|
|
105336
105708
|
x: this.width() / 2,
|
|
105337
105709
|
y: this.height() / 2,
|
|
@@ -105342,8 +105714,8 @@ void main() {
|
|
|
105342
105714
|
};
|
|
105343
105715
|
newHypotenuse = Math.sqrt(Math.pow(anchorNode.x() - comparePoint.x, 2) +
|
|
105344
105716
|
Math.pow(comparePoint.y - anchorNode.y(), 2));
|
|
105345
|
-
|
|
105346
|
-
|
|
105717
|
+
const reverseX = this.findOne('.top-right').x() < comparePoint.x ? -1 : 1;
|
|
105718
|
+
const reverseY = this.findOne('.top-right').y() > comparePoint.y ? -1 : 1;
|
|
105347
105719
|
x = newHypotenuse * this.cos * reverseX;
|
|
105348
105720
|
y = newHypotenuse * this.sin * reverseY;
|
|
105349
105721
|
this.findOne('.top-right').x(comparePoint.x + x);
|
|
@@ -105361,7 +105733,7 @@ void main() {
|
|
|
105361
105733
|
}
|
|
105362
105734
|
else if (this._movingAnchorName === 'bottom-left') {
|
|
105363
105735
|
if (keepProportion) {
|
|
105364
|
-
|
|
105736
|
+
const comparePoint = centeredScaling
|
|
105365
105737
|
? {
|
|
105366
105738
|
x: this.width() / 2,
|
|
105367
105739
|
y: this.height() / 2,
|
|
@@ -105372,8 +105744,8 @@ void main() {
|
|
|
105372
105744
|
};
|
|
105373
105745
|
newHypotenuse = Math.sqrt(Math.pow(comparePoint.x - anchorNode.x(), 2) +
|
|
105374
105746
|
Math.pow(anchorNode.y() - comparePoint.y, 2));
|
|
105375
|
-
|
|
105376
|
-
|
|
105747
|
+
const reverseX = comparePoint.x < anchorNode.x() ? -1 : 1;
|
|
105748
|
+
const reverseY = anchorNode.y() < comparePoint.y ? -1 : 1;
|
|
105377
105749
|
x = newHypotenuse * this.cos * reverseX;
|
|
105378
105750
|
y = newHypotenuse * this.sin * reverseY;
|
|
105379
105751
|
anchorNode.x(comparePoint.x - x);
|
|
@@ -105388,7 +105760,7 @@ void main() {
|
|
|
105388
105760
|
}
|
|
105389
105761
|
else if (this._movingAnchorName === 'bottom-right') {
|
|
105390
105762
|
if (keepProportion) {
|
|
105391
|
-
|
|
105763
|
+
const comparePoint = centeredScaling
|
|
105392
105764
|
? {
|
|
105393
105765
|
x: this.width() / 2,
|
|
105394
105766
|
y: this.height() / 2,
|
|
@@ -105399,8 +105771,8 @@ void main() {
|
|
|
105399
105771
|
};
|
|
105400
105772
|
newHypotenuse = Math.sqrt(Math.pow(anchorNode.x() - comparePoint.x, 2) +
|
|
105401
105773
|
Math.pow(anchorNode.y() - comparePoint.y, 2));
|
|
105402
|
-
|
|
105403
|
-
|
|
105774
|
+
const reverseX = this.findOne('.bottom-right').x() < comparePoint.x ? -1 : 1;
|
|
105775
|
+
const reverseY = this.findOne('.bottom-right').y() < comparePoint.y ? -1 : 1;
|
|
105404
105776
|
x = newHypotenuse * this.cos * reverseX;
|
|
105405
105777
|
y = newHypotenuse * this.sin * reverseY;
|
|
105406
105778
|
this.findOne('.bottom-right').x(comparePoint.x + x);
|
|
@@ -105411,7 +105783,7 @@ void main() {
|
|
|
105411
105783
|
console.error(new Error('Wrong position argument of selection resizer: ' +
|
|
105412
105784
|
this._movingAnchorName));
|
|
105413
105785
|
}
|
|
105414
|
-
|
|
105786
|
+
centeredScaling = this.centeredScaling() || e.altKey;
|
|
105415
105787
|
if (centeredScaling) {
|
|
105416
105788
|
const topLeft = this.findOne('.top-left');
|
|
105417
105789
|
const bottomRight = this.findOne('.bottom-right');
|
|
@@ -105460,12 +105832,12 @@ void main() {
|
|
|
105460
105832
|
const node = this.getNode();
|
|
105461
105833
|
activeTransformersCount--;
|
|
105462
105834
|
this._fire('transformend', { evt: e, target: node });
|
|
105463
|
-
(_a = this.getLayer()) === null || _a ===
|
|
105835
|
+
(_a = this.getLayer()) === null || _a === void 0 ? void 0 : _a.batchDraw();
|
|
105464
105836
|
if (node) {
|
|
105465
105837
|
this._nodes.forEach((target) => {
|
|
105466
105838
|
var _a;
|
|
105467
105839
|
target._fire('transformend', { evt: e, target });
|
|
105468
|
-
(_a = target.getLayer()) === null || _a ===
|
|
105840
|
+
(_a = target.getLayer()) === null || _a === void 0 ? void 0 : _a.batchDraw();
|
|
105469
105841
|
});
|
|
105470
105842
|
}
|
|
105471
105843
|
this._movingAnchorName = null;
|
|
@@ -105578,7 +105950,7 @@ void main() {
|
|
|
105578
105950
|
.multiply(localTransform);
|
|
105579
105951
|
const attrs = newLocalTransform.decompose();
|
|
105580
105952
|
node.setAttrs(attrs);
|
|
105581
|
-
(_a = node.getLayer()) === null || _a ===
|
|
105953
|
+
(_a = node.getLayer()) === null || _a === void 0 ? void 0 : _a.batchDraw();
|
|
105582
105954
|
});
|
|
105583
105955
|
this.rotation(Util_1.Util._getRotation(newAttrs.rotation));
|
|
105584
105956
|
this._nodes.forEach((node) => {
|
|
@@ -105693,7 +106065,7 @@ void main() {
|
|
|
105693
106065
|
styleFunc(node);
|
|
105694
106066
|
});
|
|
105695
106067
|
}
|
|
105696
|
-
(_a = this.getLayer()) === null || _a ===
|
|
106068
|
+
(_a = this.getLayer()) === null || _a === void 0 ? void 0 : _a.batchDraw();
|
|
105697
106069
|
}
|
|
105698
106070
|
isTransforming() {
|
|
105699
106071
|
return this._transforming;
|
|
@@ -105800,7 +106172,7 @@ void main() {
|
|
|
105800
106172
|
if (hasRequiredWedge) return Wedge;
|
|
105801
106173
|
hasRequiredWedge = 1;
|
|
105802
106174
|
Object.defineProperty(Wedge, "__esModule", { value: true });
|
|
105803
|
-
Wedge.Wedge =
|
|
106175
|
+
Wedge.Wedge = void 0;
|
|
105804
106176
|
const Factory_1 = requireFactory();
|
|
105805
106177
|
const Shape_1 = requireShape();
|
|
105806
106178
|
const Global_1 = requireGlobal();
|
|
@@ -105851,7 +106223,7 @@ void main() {
|
|
|
105851
106223
|
if (hasRequiredBlur) return Blur;
|
|
105852
106224
|
hasRequiredBlur = 1;
|
|
105853
106225
|
Object.defineProperty(Blur, "__esModule", { value: true });
|
|
105854
|
-
Blur.Blur =
|
|
106226
|
+
Blur.Blur = void 0;
|
|
105855
106227
|
const Factory_1 = requireFactory();
|
|
105856
106228
|
const Node_1 = requireNode();
|
|
105857
106229
|
const Validators_1 = requireValidators();
|
|
@@ -105899,10 +106271,10 @@ void main() {
|
|
|
105899
106271
|
];
|
|
105900
106272
|
function filterGaussBlurRGBA(imageData, radius) {
|
|
105901
106273
|
const pixels = imageData.data, width = imageData.width, height = imageData.height;
|
|
105902
|
-
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;
|
|
105903
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];
|
|
105904
106276
|
let stackEnd = null, stack = stackStart, stackIn = null, stackOut = null;
|
|
105905
|
-
for (i = 1; i < div; i++) {
|
|
106277
|
+
for (let i = 1; i < div; i++) {
|
|
105906
106278
|
stack = stack.next = new BlurStack();
|
|
105907
106279
|
if (i === radiusPlus1) {
|
|
105908
106280
|
stackEnd = stack;
|
|
@@ -105910,7 +106282,7 @@ void main() {
|
|
|
105910
106282
|
}
|
|
105911
106283
|
stack.next = stackStart;
|
|
105912
106284
|
yw = yi = 0;
|
|
105913
|
-
for (y = 0; y < height; y++) {
|
|
106285
|
+
for (let y = 0; y < height; y++) {
|
|
105914
106286
|
r_in_sum =
|
|
105915
106287
|
g_in_sum =
|
|
105916
106288
|
b_in_sum =
|
|
@@ -105929,14 +106301,14 @@ void main() {
|
|
|
105929
106301
|
b_sum += sumFactor * pb;
|
|
105930
106302
|
a_sum += sumFactor * pa;
|
|
105931
106303
|
stack = stackStart;
|
|
105932
|
-
for (i = 0; i < radiusPlus1; i++) {
|
|
106304
|
+
for (let i = 0; i < radiusPlus1; i++) {
|
|
105933
106305
|
stack.r = pr;
|
|
105934
106306
|
stack.g = pg;
|
|
105935
106307
|
stack.b = pb;
|
|
105936
106308
|
stack.a = pa;
|
|
105937
106309
|
stack = stack.next;
|
|
105938
106310
|
}
|
|
105939
|
-
for (i = 1; i < radiusPlus1; i++) {
|
|
106311
|
+
for (let i = 1; i < radiusPlus1; i++) {
|
|
105940
106312
|
p = yi + ((widthMinus1 < i ? widthMinus1 : i) << 2);
|
|
105941
106313
|
r_sum += (stack.r = pr = pixels[p]) * (rbs = radiusPlus1 - i);
|
|
105942
106314
|
g_sum += (stack.g = pg = pixels[p + 1]) * rbs;
|
|
@@ -105950,7 +106322,7 @@ void main() {
|
|
|
105950
106322
|
}
|
|
105951
106323
|
stackIn = stackStart;
|
|
105952
106324
|
stackOut = stackEnd;
|
|
105953
|
-
for (x = 0; x < width; x++) {
|
|
106325
|
+
for (let x = 0; x < width; x++) {
|
|
105954
106326
|
pixels[yi + 3] = pa = (a_sum * mul_sum) >> shg_sum;
|
|
105955
106327
|
if (pa !== 0) {
|
|
105956
106328
|
pa = 255 / pa;
|
|
@@ -105992,7 +106364,7 @@ void main() {
|
|
|
105992
106364
|
}
|
|
105993
106365
|
yw += width;
|
|
105994
106366
|
}
|
|
105995
|
-
for (x = 0; x < width; x++) {
|
|
106367
|
+
for (let x = 0; x < width; x++) {
|
|
105996
106368
|
g_in_sum =
|
|
105997
106369
|
b_in_sum =
|
|
105998
106370
|
a_in_sum =
|
|
@@ -106012,15 +106384,15 @@ void main() {
|
|
|
106012
106384
|
b_sum += sumFactor * pb;
|
|
106013
106385
|
a_sum += sumFactor * pa;
|
|
106014
106386
|
stack = stackStart;
|
|
106015
|
-
for (i = 0; i < radiusPlus1; i++) {
|
|
106387
|
+
for (let i = 0; i < radiusPlus1; i++) {
|
|
106016
106388
|
stack.r = pr;
|
|
106017
106389
|
stack.g = pg;
|
|
106018
106390
|
stack.b = pb;
|
|
106019
106391
|
stack.a = pa;
|
|
106020
106392
|
stack = stack.next;
|
|
106021
106393
|
}
|
|
106022
|
-
yp = width;
|
|
106023
|
-
for (i = 1; i <= radius; i++) {
|
|
106394
|
+
let yp = width;
|
|
106395
|
+
for (let i = 1; i <= radius; i++) {
|
|
106024
106396
|
yi = (yp + x) << 2;
|
|
106025
106397
|
r_sum += (stack.r = pr = pixels[yi]) * (rbs = radiusPlus1 - i);
|
|
106026
106398
|
g_sum += (stack.g = pg = pixels[yi + 1]) * rbs;
|
|
@@ -106038,7 +106410,7 @@ void main() {
|
|
|
106038
106410
|
yi = x;
|
|
106039
106411
|
stackIn = stackStart;
|
|
106040
106412
|
stackOut = stackEnd;
|
|
106041
|
-
for (y = 0; y < height; y++) {
|
|
106413
|
+
for (let y = 0; y < height; y++) {
|
|
106042
106414
|
p = yi << 2;
|
|
106043
106415
|
pixels[p + 3] = pa = (a_sum * mul_sum) >> shg_sum;
|
|
106044
106416
|
if (pa > 0) {
|
|
@@ -106099,7 +106471,7 @@ void main() {
|
|
|
106099
106471
|
if (hasRequiredBrighten) return Brighten;
|
|
106100
106472
|
hasRequiredBrighten = 1;
|
|
106101
106473
|
Object.defineProperty(Brighten, "__esModule", { value: true });
|
|
106102
|
-
Brighten.Brighten =
|
|
106474
|
+
Brighten.Brighten = void 0;
|
|
106103
106475
|
const Factory_1 = requireFactory();
|
|
106104
106476
|
const Node_1 = requireNode();
|
|
106105
106477
|
const Validators_1 = requireValidators();
|
|
@@ -106124,7 +106496,7 @@ void main() {
|
|
|
106124
106496
|
if (hasRequiredContrast) return Contrast;
|
|
106125
106497
|
hasRequiredContrast = 1;
|
|
106126
106498
|
Object.defineProperty(Contrast, "__esModule", { value: true });
|
|
106127
|
-
Contrast.Contrast =
|
|
106499
|
+
Contrast.Contrast = void 0;
|
|
106128
106500
|
const Factory_1 = requireFactory();
|
|
106129
106501
|
const Node_1 = requireNode();
|
|
106130
106502
|
const Validators_1 = requireValidators();
|
|
@@ -106172,7 +106544,7 @@ void main() {
|
|
|
106172
106544
|
if (hasRequiredEmboss) return Emboss;
|
|
106173
106545
|
hasRequiredEmboss = 1;
|
|
106174
106546
|
Object.defineProperty(Emboss, "__esModule", { value: true });
|
|
106175
|
-
Emboss.Emboss =
|
|
106547
|
+
Emboss.Emboss = void 0;
|
|
106176
106548
|
const Factory_1 = requireFactory();
|
|
106177
106549
|
const Node_1 = requireNode();
|
|
106178
106550
|
const Util_1 = requireUtil();
|
|
@@ -106288,7 +106660,7 @@ void main() {
|
|
|
106288
106660
|
if (hasRequiredEnhance) return Enhance;
|
|
106289
106661
|
hasRequiredEnhance = 1;
|
|
106290
106662
|
Object.defineProperty(Enhance, "__esModule", { value: true });
|
|
106291
|
-
Enhance.Enhance =
|
|
106663
|
+
Enhance.Enhance = void 0;
|
|
106292
106664
|
const Factory_1 = requireFactory();
|
|
106293
106665
|
const Node_1 = requireNode();
|
|
106294
106666
|
const Validators_1 = requireValidators();
|
|
@@ -106346,7 +106718,7 @@ void main() {
|
|
|
106346
106718
|
bMax = 255;
|
|
106347
106719
|
bMin = 0;
|
|
106348
106720
|
}
|
|
106349
|
-
let
|
|
106721
|
+
let rGoalMax, rGoalMin, gGoalMax, gGoalMin, bGoalMax, bGoalMin;
|
|
106350
106722
|
if (enhanceAmount > 0) {
|
|
106351
106723
|
rGoalMax = rMax + enhanceAmount * (255 - rMax);
|
|
106352
106724
|
rGoalMin = rMin - enhanceAmount * (rMin - 0);
|
|
@@ -106356,13 +106728,13 @@ void main() {
|
|
|
106356
106728
|
bGoalMin = bMin - enhanceAmount * (bMin - 0);
|
|
106357
106729
|
}
|
|
106358
106730
|
else {
|
|
106359
|
-
rMid = (rMax + rMin) * 0.5;
|
|
106731
|
+
const rMid = (rMax + rMin) * 0.5;
|
|
106360
106732
|
rGoalMax = rMax + enhanceAmount * (rMax - rMid);
|
|
106361
106733
|
rGoalMin = rMin + enhanceAmount * (rMin - rMid);
|
|
106362
|
-
gMid = (gMax + gMin) * 0.5;
|
|
106734
|
+
const gMid = (gMax + gMin) * 0.5;
|
|
106363
106735
|
gGoalMax = gMax + enhanceAmount * (gMax - gMid);
|
|
106364
106736
|
gGoalMin = gMin + enhanceAmount * (gMin - gMid);
|
|
106365
|
-
bMid = (bMax + bMin) * 0.5;
|
|
106737
|
+
const bMid = (bMax + bMin) * 0.5;
|
|
106366
106738
|
bGoalMax = bMax + enhanceAmount * (bMax - bMid);
|
|
106367
106739
|
bGoalMin = bMin + enhanceAmount * (bMin - bMid);
|
|
106368
106740
|
}
|
|
@@ -106385,7 +106757,7 @@ void main() {
|
|
|
106385
106757
|
if (hasRequiredGrayscale) return Grayscale;
|
|
106386
106758
|
hasRequiredGrayscale = 1;
|
|
106387
106759
|
Object.defineProperty(Grayscale, "__esModule", { value: true });
|
|
106388
|
-
Grayscale.Grayscale =
|
|
106760
|
+
Grayscale.Grayscale = void 0;
|
|
106389
106761
|
const Grayscale$1 = function (imageData) {
|
|
106390
106762
|
const data = imageData.data, len = data.length;
|
|
106391
106763
|
for (let i = 0; i < len; i += 4) {
|
|
@@ -106407,7 +106779,7 @@ void main() {
|
|
|
106407
106779
|
if (hasRequiredHSL) return HSL;
|
|
106408
106780
|
hasRequiredHSL = 1;
|
|
106409
106781
|
Object.defineProperty(HSL, "__esModule", { value: true });
|
|
106410
|
-
HSL.HSL =
|
|
106782
|
+
HSL.HSL = void 0;
|
|
106411
106783
|
const Factory_1 = requireFactory();
|
|
106412
106784
|
const Node_1 = requireNode();
|
|
106413
106785
|
const Validators_1 = requireValidators();
|
|
@@ -106444,7 +106816,7 @@ void main() {
|
|
|
106444
106816
|
if (hasRequiredHSV) return HSV;
|
|
106445
106817
|
hasRequiredHSV = 1;
|
|
106446
106818
|
Object.defineProperty(HSV, "__esModule", { value: true });
|
|
106447
|
-
HSV.HSV =
|
|
106819
|
+
HSV.HSV = void 0;
|
|
106448
106820
|
const Factory_1 = requireFactory();
|
|
106449
106821
|
const Node_1 = requireNode();
|
|
106450
106822
|
const Validators_1 = requireValidators();
|
|
@@ -106454,12 +106826,11 @@ void main() {
|
|
|
106454
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;
|
|
106455
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;
|
|
106456
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;
|
|
106457
|
-
let r, g, b, a;
|
|
106458
106829
|
for (let i = 0; i < nPixels; i += 4) {
|
|
106459
|
-
r = data[i + 0];
|
|
106460
|
-
g = data[i + 1];
|
|
106461
|
-
b = data[i + 2];
|
|
106462
|
-
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];
|
|
106463
106834
|
data[i + 0] = rr * r + rg * g + rb * b;
|
|
106464
106835
|
data[i + 1] = gr * r + gg * g + gb * b;
|
|
106465
106836
|
data[i + 2] = br * r + bg * g + bb * b;
|
|
@@ -106481,7 +106852,7 @@ void main() {
|
|
|
106481
106852
|
if (hasRequiredInvert) return Invert;
|
|
106482
106853
|
hasRequiredInvert = 1;
|
|
106483
106854
|
Object.defineProperty(Invert, "__esModule", { value: true });
|
|
106484
|
-
Invert.Invert =
|
|
106855
|
+
Invert.Invert = void 0;
|
|
106485
106856
|
const Invert$1 = function (imageData) {
|
|
106486
106857
|
const data = imageData.data, len = data.length;
|
|
106487
106858
|
for (let i = 0; i < len; i += 4) {
|
|
@@ -106502,7 +106873,7 @@ void main() {
|
|
|
106502
106873
|
if (hasRequiredKaleidoscope) return Kaleidoscope;
|
|
106503
106874
|
hasRequiredKaleidoscope = 1;
|
|
106504
106875
|
Object.defineProperty(Kaleidoscope, "__esModule", { value: true });
|
|
106505
|
-
Kaleidoscope.Kaleidoscope =
|
|
106876
|
+
Kaleidoscope.Kaleidoscope = void 0;
|
|
106506
106877
|
const Factory_1 = requireFactory();
|
|
106507
106878
|
const Node_1 = requireNode();
|
|
106508
106879
|
const Util_1 = requireUtil();
|
|
@@ -106648,7 +107019,7 @@ void main() {
|
|
|
106648
107019
|
if (hasRequiredMask) return Mask;
|
|
106649
107020
|
hasRequiredMask = 1;
|
|
106650
107021
|
Object.defineProperty(Mask, "__esModule", { value: true });
|
|
106651
|
-
Mask.Mask =
|
|
107022
|
+
Mask.Mask = void 0;
|
|
106652
107023
|
const Factory_1 = requireFactory();
|
|
106653
107024
|
const Node_1 = requireNode();
|
|
106654
107025
|
const Validators_1 = requireValidators();
|
|
@@ -106802,7 +107173,7 @@ void main() {
|
|
|
106802
107173
|
if (hasRequiredNoise) return Noise;
|
|
106803
107174
|
hasRequiredNoise = 1;
|
|
106804
107175
|
Object.defineProperty(Noise, "__esModule", { value: true });
|
|
106805
|
-
Noise.Noise =
|
|
107176
|
+
Noise.Noise = void 0;
|
|
106806
107177
|
const Factory_1 = requireFactory();
|
|
106807
107178
|
const Node_1 = requireNode();
|
|
106808
107179
|
const Validators_1 = requireValidators();
|
|
@@ -106827,37 +107198,37 @@ void main() {
|
|
|
106827
107198
|
if (hasRequiredPixelate) return Pixelate;
|
|
106828
107199
|
hasRequiredPixelate = 1;
|
|
106829
107200
|
Object.defineProperty(Pixelate, "__esModule", { value: true });
|
|
106830
|
-
Pixelate.Pixelate =
|
|
107201
|
+
Pixelate.Pixelate = void 0;
|
|
106831
107202
|
const Factory_1 = requireFactory();
|
|
106832
107203
|
const Util_1 = requireUtil();
|
|
106833
107204
|
const Node_1 = requireNode();
|
|
106834
107205
|
const Validators_1 = requireValidators();
|
|
106835
107206
|
const Pixelate$1 = function (imageData) {
|
|
106836
|
-
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;
|
|
106837
107208
|
if (pixelSize <= 0) {
|
|
106838
107209
|
Util_1.Util.error('pixelSize value can not be <= 0');
|
|
106839
107210
|
return;
|
|
106840
107211
|
}
|
|
106841
|
-
for (xBin = 0; xBin < nBinsX; xBin += 1) {
|
|
106842
|
-
for (yBin = 0; yBin < nBinsY; yBin += 1) {
|
|
106843
|
-
red = 0;
|
|
106844
|
-
green = 0;
|
|
106845
|
-
blue = 0;
|
|
106846
|
-
alpha = 0;
|
|
106847
|
-
xBinStart = xBin * pixelSize;
|
|
106848
|
-
xBinEnd = xBinStart + pixelSize;
|
|
106849
|
-
yBinStart = yBin * pixelSize;
|
|
106850
|
-
yBinEnd = yBinStart + pixelSize;
|
|
106851
|
-
pixelsInBin = 0;
|
|
106852
|
-
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) {
|
|
106853
107224
|
if (x >= width) {
|
|
106854
107225
|
continue;
|
|
106855
107226
|
}
|
|
106856
|
-
for (y = yBinStart; y < yBinEnd; y += 1) {
|
|
107227
|
+
for (let y = yBinStart; y < yBinEnd; y += 1) {
|
|
106857
107228
|
if (y >= height) {
|
|
106858
107229
|
continue;
|
|
106859
107230
|
}
|
|
106860
|
-
i = (width * y + x) * 4;
|
|
107231
|
+
const i = (width * y + x) * 4;
|
|
106861
107232
|
red += data[i + 0];
|
|
106862
107233
|
green += data[i + 1];
|
|
106863
107234
|
blue += data[i + 2];
|
|
@@ -106869,15 +107240,15 @@ void main() {
|
|
|
106869
107240
|
green = green / pixelsInBin;
|
|
106870
107241
|
blue = blue / pixelsInBin;
|
|
106871
107242
|
alpha = alpha / pixelsInBin;
|
|
106872
|
-
for (x = xBinStart; x < xBinEnd; x += 1) {
|
|
107243
|
+
for (let x = xBinStart; x < xBinEnd; x += 1) {
|
|
106873
107244
|
if (x >= width) {
|
|
106874
107245
|
continue;
|
|
106875
107246
|
}
|
|
106876
|
-
for (y = yBinStart; y < yBinEnd; y += 1) {
|
|
107247
|
+
for (let y = yBinStart; y < yBinEnd; y += 1) {
|
|
106877
107248
|
if (y >= height) {
|
|
106878
107249
|
continue;
|
|
106879
107250
|
}
|
|
106880
|
-
i = (width * y + x) * 4;
|
|
107251
|
+
const i = (width * y + x) * 4;
|
|
106881
107252
|
data[i + 0] = red;
|
|
106882
107253
|
data[i + 1] = green;
|
|
106883
107254
|
data[i + 2] = blue;
|
|
@@ -106900,7 +107271,7 @@ void main() {
|
|
|
106900
107271
|
if (hasRequiredPosterize) return Posterize;
|
|
106901
107272
|
hasRequiredPosterize = 1;
|
|
106902
107273
|
Object.defineProperty(Posterize, "__esModule", { value: true });
|
|
106903
|
-
Posterize.Posterize =
|
|
107274
|
+
Posterize.Posterize = void 0;
|
|
106904
107275
|
const Factory_1 = requireFactory();
|
|
106905
107276
|
const Node_1 = requireNode();
|
|
106906
107277
|
const Validators_1 = requireValidators();
|
|
@@ -106923,7 +107294,7 @@ void main() {
|
|
|
106923
107294
|
if (hasRequiredRGB) return RGB;
|
|
106924
107295
|
hasRequiredRGB = 1;
|
|
106925
107296
|
Object.defineProperty(RGB, "__esModule", { value: true });
|
|
106926
|
-
RGB.RGB =
|
|
107297
|
+
RGB.RGB = void 0;
|
|
106927
107298
|
const Factory_1 = requireFactory();
|
|
106928
107299
|
const Node_1 = requireNode();
|
|
106929
107300
|
const Validators_1 = requireValidators();
|
|
@@ -106974,7 +107345,7 @@ void main() {
|
|
|
106974
107345
|
if (hasRequiredRGBA) return RGBA;
|
|
106975
107346
|
hasRequiredRGBA = 1;
|
|
106976
107347
|
Object.defineProperty(RGBA, "__esModule", { value: true });
|
|
106977
|
-
RGBA.RGBA =
|
|
107348
|
+
RGBA.RGBA = void 0;
|
|
106978
107349
|
const Factory_1 = requireFactory();
|
|
106979
107350
|
const Node_1 = requireNode();
|
|
106980
107351
|
const Validators_1 = requireValidators();
|
|
@@ -107036,7 +107407,7 @@ void main() {
|
|
|
107036
107407
|
if (hasRequiredSepia) return Sepia;
|
|
107037
107408
|
hasRequiredSepia = 1;
|
|
107038
107409
|
Object.defineProperty(Sepia, "__esModule", { value: true });
|
|
107039
|
-
Sepia.Sepia =
|
|
107410
|
+
Sepia.Sepia = void 0;
|
|
107040
107411
|
const Sepia$1 = function (imageData) {
|
|
107041
107412
|
const data = imageData.data, nPixels = data.length;
|
|
107042
107413
|
for (let i = 0; i < nPixels; i += 4) {
|
|
@@ -107060,7 +107431,7 @@ void main() {
|
|
|
107060
107431
|
if (hasRequiredSolarize) return Solarize;
|
|
107061
107432
|
hasRequiredSolarize = 1;
|
|
107062
107433
|
Object.defineProperty(Solarize, "__esModule", { value: true });
|
|
107063
|
-
Solarize.Solarize =
|
|
107434
|
+
Solarize.Solarize = void 0;
|
|
107064
107435
|
const Solarize$1 = function (imageData) {
|
|
107065
107436
|
const data = imageData.data, w = imageData.width, h = imageData.height, w4 = w * 4;
|
|
107066
107437
|
let y = h;
|
|
@@ -107099,7 +107470,7 @@ void main() {
|
|
|
107099
107470
|
if (hasRequiredThreshold) return Threshold;
|
|
107100
107471
|
hasRequiredThreshold = 1;
|
|
107101
107472
|
Object.defineProperty(Threshold, "__esModule", { value: true });
|
|
107102
|
-
Threshold.Threshold =
|
|
107473
|
+
Threshold.Threshold = void 0;
|
|
107103
107474
|
const Factory_1 = requireFactory();
|
|
107104
107475
|
const Node_1 = requireNode();
|
|
107105
107476
|
const Validators_1 = requireValidators();
|
|
@@ -107120,7 +107491,7 @@ void main() {
|
|
|
107120
107491
|
if (hasRequired_FullInternals) return _FullInternals;
|
|
107121
107492
|
hasRequired_FullInternals = 1;
|
|
107122
107493
|
Object.defineProperty(_FullInternals, "__esModule", { value: true });
|
|
107123
|
-
_FullInternals.Konva =
|
|
107494
|
+
_FullInternals.Konva = void 0;
|
|
107124
107495
|
const _CoreInternals_1 = require_CoreInternals();
|
|
107125
107496
|
const Arc_1 = requireArc();
|
|
107126
107497
|
const Arrow_1 = requireArrow();
|
|
@@ -107308,7 +107679,7 @@ void main() {
|
|
|
107308
107679
|
} ];
|
|
107309
107680
|
const konvaPoints = [];
|
|
107310
107681
|
const wcsPoints = [];
|
|
107311
|
-
params.points.forEach(
|
|
107682
|
+
params.points.forEach(point => {
|
|
107312
107683
|
konvaPoints.push(point.x, point.y);
|
|
107313
107684
|
const wcsPoint = this._worldTransformer.screenToWorld({
|
|
107314
107685
|
x: point.x,
|
|
@@ -107319,10 +107690,10 @@ void main() {
|
|
|
107319
107690
|
y: wcsPoint.y,
|
|
107320
107691
|
z: wcsPoint.z
|
|
107321
107692
|
});
|
|
107322
|
-
})
|
|
107693
|
+
});
|
|
107323
107694
|
this._ref = new Konva.Line({
|
|
107324
|
-
stroke: (_a = params.color) !== null && _a !==
|
|
107325
|
-
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,
|
|
107326
107697
|
globalCompositeOperation: "source-over",
|
|
107327
107698
|
lineCap: "round",
|
|
107328
107699
|
lineJoin: "round",
|
|
@@ -107332,11 +107703,11 @@ void main() {
|
|
|
107332
107703
|
dash: LineTypeSpecs.get(params.type) || []
|
|
107333
107704
|
});
|
|
107334
107705
|
this._ref.setAttr("wcsPoints", wcsPoints);
|
|
107335
|
-
this._ref.on("transform",
|
|
107706
|
+
this._ref.on("transform", e => {
|
|
107336
107707
|
const attrs = e.target.attrs;
|
|
107337
107708
|
if (attrs.rotation !== this._ref.rotation()) this._ref.rotation(attrs.rotation);
|
|
107338
|
-
})
|
|
107339
|
-
this._ref.on("transformend", (
|
|
107709
|
+
});
|
|
107710
|
+
this._ref.on("transformend", () => {
|
|
107340
107711
|
const absoluteTransform = this._ref.getAbsoluteTransform();
|
|
107341
107712
|
const wcsPoints = [];
|
|
107342
107713
|
const points = this._ref.points();
|
|
@@ -107357,8 +107728,8 @@ void main() {
|
|
|
107357
107728
|
});
|
|
107358
107729
|
}
|
|
107359
107730
|
this._ref.setAttr("wcsPoints", wcsPoints);
|
|
107360
|
-
})
|
|
107361
|
-
this._ref.on("dragend", (
|
|
107731
|
+
});
|
|
107732
|
+
this._ref.on("dragend", () => {
|
|
107362
107733
|
const absoluteTransform = this._ref.getAbsoluteTransform();
|
|
107363
107734
|
const wcsPoints = [];
|
|
107364
107735
|
const points = this._ref.points();
|
|
@@ -107379,7 +107750,7 @@ void main() {
|
|
|
107379
107750
|
});
|
|
107380
107751
|
}
|
|
107381
107752
|
this._ref.setAttr("wcsPoints", wcsPoints);
|
|
107382
|
-
})
|
|
107753
|
+
});
|
|
107383
107754
|
this._ref.id(this._ref._id.toString());
|
|
107384
107755
|
}
|
|
107385
107756
|
ref() {
|
|
@@ -107450,11 +107821,11 @@ void main() {
|
|
|
107450
107821
|
addPoints(points) {
|
|
107451
107822
|
let newPoints = this._ref.points();
|
|
107452
107823
|
const wcsPoints = this._ref.getAttr("wcsPoints");
|
|
107453
|
-
points.forEach(
|
|
107824
|
+
points.forEach(point => {
|
|
107454
107825
|
newPoints = newPoints.concat([ point.x, point.y ]);
|
|
107455
107826
|
const wcsPoint = this._worldTransformer.screenToWorld(point);
|
|
107456
107827
|
wcsPoints.push(wcsPoint);
|
|
107457
|
-
})
|
|
107828
|
+
});
|
|
107458
107829
|
this._ref.points(newPoints);
|
|
107459
107830
|
}
|
|
107460
107831
|
updateScreenCoordinates() {
|
|
@@ -107462,7 +107833,7 @@ void main() {
|
|
|
107462
107833
|
const points = [];
|
|
107463
107834
|
let invert = this._ref.getAbsoluteTransform().copy();
|
|
107464
107835
|
invert = invert.invert();
|
|
107465
|
-
wcsPoints.forEach(
|
|
107836
|
+
wcsPoints.forEach(point => {
|
|
107466
107837
|
let screenPoint = this._worldTransformer.worldToScreen(point);
|
|
107467
107838
|
screenPoint = invert.point({
|
|
107468
107839
|
x: screenPoint.x,
|
|
@@ -107470,7 +107841,7 @@ void main() {
|
|
|
107470
107841
|
});
|
|
107471
107842
|
points.push(screenPoint.x);
|
|
107472
107843
|
points.push(screenPoint.y);
|
|
107473
|
-
})
|
|
107844
|
+
});
|
|
107474
107845
|
this._ref.points([]);
|
|
107475
107846
|
this._ref.points(points);
|
|
107476
107847
|
this._ref.clearCache();
|
|
@@ -107503,19 +107874,19 @@ void main() {
|
|
|
107503
107874
|
x: params.position.x,
|
|
107504
107875
|
y: params.position.y,
|
|
107505
107876
|
text: params.text,
|
|
107506
|
-
fontSize: (_a = params.fontSize) !== null && _a !==
|
|
107877
|
+
fontSize: (_a = params.fontSize) !== null && _a !== void 0 ? _a : 34,
|
|
107507
107878
|
fontFamily: this.TEXT_FONT_FAMILY,
|
|
107508
|
-
fill: (_b = params.color) !== null && _b !==
|
|
107879
|
+
fill: (_b = params.color) !== null && _b !== void 0 ? _b : "#ff0000",
|
|
107509
107880
|
align: "left",
|
|
107510
107881
|
draggable: true,
|
|
107511
|
-
rotation: (_c = params.rotation) !== null && _c !==
|
|
107882
|
+
rotation: (_c = params.rotation) !== null && _c !== void 0 ? _c : 0
|
|
107512
107883
|
});
|
|
107513
107884
|
this._ref.width(this._ref.getTextWidth());
|
|
107514
107885
|
this._ref.setAttr("wcsStart", this._worldTransformer.screenToWorld({
|
|
107515
107886
|
x: params.position.x,
|
|
107516
107887
|
y: params.position.y
|
|
107517
107888
|
}));
|
|
107518
|
-
this._ref.on("transform",
|
|
107889
|
+
this._ref.on("transform", e => {
|
|
107519
107890
|
const attrs = e.target.attrs;
|
|
107520
107891
|
if (attrs.rotation !== this._ref.rotation()) this._ref.rotation(attrs.rotation);
|
|
107521
107892
|
const scaleByX = Math.abs(attrs.scaleX - 1) > 1e-5;
|
|
@@ -107537,8 +107908,8 @@ void main() {
|
|
|
107537
107908
|
x: 1,
|
|
107538
107909
|
y: 1
|
|
107539
107910
|
});
|
|
107540
|
-
})
|
|
107541
|
-
this._ref.on("transformend",
|
|
107911
|
+
});
|
|
107912
|
+
this._ref.on("transformend", e => {
|
|
107542
107913
|
const attrs = e.target.attrs;
|
|
107543
107914
|
if (attrs.rotation !== this._ref.rotation()) this._ref.rotation(attrs.rotation);
|
|
107544
107915
|
const absoluteTransform = this._ref.getStage().getAbsoluteTransform();
|
|
@@ -107547,15 +107918,15 @@ void main() {
|
|
|
107547
107918
|
y: this._ref.y()
|
|
107548
107919
|
});
|
|
107549
107920
|
this._ref.setAttr("wcsStart", this._worldTransformer.screenToWorld(position));
|
|
107550
|
-
})
|
|
107551
|
-
this._ref.on("dragend", (
|
|
107921
|
+
});
|
|
107922
|
+
this._ref.on("dragend", () => {
|
|
107552
107923
|
const absoluteTransform = this._ref.getStage().getAbsoluteTransform();
|
|
107553
107924
|
const position = absoluteTransform.point({
|
|
107554
107925
|
x: this._ref.x(),
|
|
107555
107926
|
y: this._ref.y()
|
|
107556
107927
|
});
|
|
107557
107928
|
this._ref.setAttr("wcsStart", this._worldTransformer.screenToWorld(position));
|
|
107558
|
-
})
|
|
107929
|
+
});
|
|
107559
107930
|
this._ref.id(this._ref._id.toString());
|
|
107560
107931
|
}
|
|
107561
107932
|
ref() {
|
|
@@ -107679,15 +108050,15 @@ void main() {
|
|
|
107679
108050
|
}
|
|
107680
108051
|
}
|
|
107681
108052
|
this._ref = new Konva.Rect({
|
|
107682
|
-
stroke: (_a = params.color) !== null && _a !==
|
|
107683
|
-
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,
|
|
107684
108055
|
globalCompositeOperation: "source-over",
|
|
107685
108056
|
lineCap: "round",
|
|
107686
108057
|
lineJoin: "round",
|
|
107687
108058
|
x: params.position.x,
|
|
107688
108059
|
y: params.position.y,
|
|
107689
|
-
width: (_c = params.width) !== null && _c !==
|
|
107690
|
-
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,
|
|
107691
108062
|
draggable: true,
|
|
107692
108063
|
strokeScaleEnabled: false
|
|
107693
108064
|
});
|
|
@@ -107699,7 +108070,7 @@ void main() {
|
|
|
107699
108070
|
x: params.position2.x,
|
|
107700
108071
|
y: params.position2.y
|
|
107701
108072
|
}));
|
|
107702
|
-
this._ref.on("transform",
|
|
108073
|
+
this._ref.on("transform", e => {
|
|
107703
108074
|
const attrs = e.target.attrs;
|
|
107704
108075
|
const scaleByX = Math.abs(attrs.scaleX - 1) > 1e-5;
|
|
107705
108076
|
const scaleByY = Math.abs(attrs.scaleY - 1) > 1e-5;
|
|
@@ -107721,8 +108092,8 @@ void main() {
|
|
|
107721
108092
|
x: 1,
|
|
107722
108093
|
y: 1
|
|
107723
108094
|
});
|
|
107724
|
-
})
|
|
107725
|
-
this._ref.on("transformend",
|
|
108095
|
+
});
|
|
108096
|
+
this._ref.on("transformend", e => {
|
|
107726
108097
|
const attrs = e.target.attrs;
|
|
107727
108098
|
if (attrs.rotation !== this._ref.rotation()) this._ref.rotation(attrs.rotation);
|
|
107728
108099
|
const absoluteTransform = this._ref.getStage().getAbsoluteTransform();
|
|
@@ -107735,8 +108106,8 @@ void main() {
|
|
|
107735
108106
|
x: position.x + this._ref.width(),
|
|
107736
108107
|
y: position.y + this._ref.height()
|
|
107737
108108
|
}));
|
|
107738
|
-
})
|
|
107739
|
-
this._ref.on("dragend", (
|
|
108109
|
+
});
|
|
108110
|
+
this._ref.on("dragend", () => {
|
|
107740
108111
|
const absoluteTransform = this._ref.getStage().getAbsoluteTransform();
|
|
107741
108112
|
const position = absoluteTransform.point({
|
|
107742
108113
|
x: this._ref.x(),
|
|
@@ -107747,7 +108118,7 @@ void main() {
|
|
|
107747
108118
|
x: position.x + this._ref.width(),
|
|
107748
108119
|
y: position.y + this._ref.height()
|
|
107749
108120
|
}));
|
|
107750
|
-
})
|
|
108121
|
+
});
|
|
107751
108122
|
this._ref.id(this._ref._id.toString());
|
|
107752
108123
|
}
|
|
107753
108124
|
getPosition() {
|
|
@@ -107888,7 +108259,7 @@ void main() {
|
|
|
107888
108259
|
y: 0
|
|
107889
108260
|
};
|
|
107890
108261
|
if (params.position2) {
|
|
107891
|
-
(_a = params.radius) !== null && _a !==
|
|
108262
|
+
(_a = params.radius) !== null && _a !== void 0 ? _a : params.radius = {
|
|
107892
108263
|
x: 0,
|
|
107893
108264
|
y: 0
|
|
107894
108265
|
};
|
|
@@ -107901,8 +108272,8 @@ void main() {
|
|
|
107901
108272
|
};
|
|
107902
108273
|
}
|
|
107903
108274
|
this._ref = new Konva.Ellipse({
|
|
107904
|
-
stroke: (_b = params.color) !== null && _b !==
|
|
107905
|
-
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,
|
|
107906
108277
|
globalCompositeOperation: "source-over",
|
|
107907
108278
|
lineCap: "round",
|
|
107908
108279
|
lineJoin: "round",
|
|
@@ -107925,7 +108296,7 @@ void main() {
|
|
|
107925
108296
|
x: this._ref.x(),
|
|
107926
108297
|
y: this._ref.y() + params.radius.y
|
|
107927
108298
|
}));
|
|
107928
|
-
this._ref.on("transform",
|
|
108299
|
+
this._ref.on("transform", e => {
|
|
107929
108300
|
const attrs = e.target.attrs;
|
|
107930
108301
|
if (attrs.rotation !== this._ref.rotation()) this._ref.rotation(attrs.rotation);
|
|
107931
108302
|
const scaleByX = Math.abs(attrs.scaleX - 1) > 1e-5;
|
|
@@ -107960,8 +108331,8 @@ void main() {
|
|
|
107960
108331
|
x: 1,
|
|
107961
108332
|
y: 1
|
|
107962
108333
|
});
|
|
107963
|
-
})
|
|
107964
|
-
this._ref.on("transformend", (
|
|
108334
|
+
});
|
|
108335
|
+
this._ref.on("transformend", () => {
|
|
107965
108336
|
const absoluteTransform = this._ref.getStage().getAbsoluteTransform();
|
|
107966
108337
|
const position = absoluteTransform.point({
|
|
107967
108338
|
x: this._ref.x(),
|
|
@@ -107978,8 +108349,8 @@ void main() {
|
|
|
107978
108349
|
y: this._ref.y() + this._ref.radiusY()
|
|
107979
108350
|
});
|
|
107980
108351
|
this._ref.setAttr("wcsRadiusY", this._worldTransformer.screenToWorld(radiusY));
|
|
107981
|
-
})
|
|
107982
|
-
this._ref.on("dragend", (
|
|
108352
|
+
});
|
|
108353
|
+
this._ref.on("dragend", () => {
|
|
107983
108354
|
const absoluteTransform = this._ref.getStage().getAbsoluteTransform();
|
|
107984
108355
|
const position = absoluteTransform.point({
|
|
107985
108356
|
x: this._ref.x(),
|
|
@@ -107996,7 +108367,7 @@ void main() {
|
|
|
107996
108367
|
y: this._ref.y() + this._ref.radiusY()
|
|
107997
108368
|
});
|
|
107998
108369
|
this._ref.setAttr("wcsRadiusY", this._worldTransformer.screenToWorld(radiusY));
|
|
107999
|
-
})
|
|
108370
|
+
});
|
|
108000
108371
|
this._ref.id(this._ref._id.toString());
|
|
108001
108372
|
}
|
|
108002
108373
|
getPosition() {
|
|
@@ -108121,8 +108492,8 @@ void main() {
|
|
|
108121
108492
|
y: 100
|
|
108122
108493
|
};
|
|
108123
108494
|
this._ref = new Konva.Arrow({
|
|
108124
|
-
stroke: (_a = params.color) !== null && _a !==
|
|
108125
|
-
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",
|
|
108126
108497
|
strokeWidth: 4,
|
|
108127
108498
|
globalCompositeOperation: "source-over",
|
|
108128
108499
|
lineCap: "round",
|
|
@@ -108139,7 +108510,7 @@ void main() {
|
|
|
108139
108510
|
x: params.end.x,
|
|
108140
108511
|
y: params.end.y
|
|
108141
108512
|
}));
|
|
108142
|
-
this._ref.on("transformend",
|
|
108513
|
+
this._ref.on("transformend", e => {
|
|
108143
108514
|
const attrs = e.target.attrs;
|
|
108144
108515
|
if (attrs.rotation !== this._ref.rotation()) this._ref.rotation(attrs.rotation);
|
|
108145
108516
|
const points = this._ref.points();
|
|
@@ -108154,8 +108525,8 @@ void main() {
|
|
|
108154
108525
|
});
|
|
108155
108526
|
this._ref.setAttr("wcsStart", this._worldTransformer.screenToWorld(transformStart));
|
|
108156
108527
|
this._ref.setAttr("wcsEnd", this._worldTransformer.screenToWorld(transformEnd));
|
|
108157
|
-
})
|
|
108158
|
-
this._ref.on("dragend",
|
|
108528
|
+
});
|
|
108529
|
+
this._ref.on("dragend", e => {
|
|
108159
108530
|
const points = this._ref.points();
|
|
108160
108531
|
const absoluteTransform = e.target.getAbsoluteTransform();
|
|
108161
108532
|
const transformStart = absoluteTransform.point({
|
|
@@ -108168,7 +108539,7 @@ void main() {
|
|
|
108168
108539
|
});
|
|
108169
108540
|
this._ref.setAttr("wcsStart", this._worldTransformer.screenToWorld(transformStart));
|
|
108170
108541
|
this._ref.setAttr("wcsEnd", this._worldTransformer.screenToWorld(transformEnd));
|
|
108171
|
-
})
|
|
108542
|
+
});
|
|
108172
108543
|
this._ref.id(this._ref._id.toString());
|
|
108173
108544
|
}
|
|
108174
108545
|
ref() {
|
|
@@ -108355,15 +108726,15 @@ void main() {
|
|
|
108355
108726
|
x: params.position.x,
|
|
108356
108727
|
y: params.position.y,
|
|
108357
108728
|
image: this._canvasImage,
|
|
108358
|
-
width: (_a = params.width) !== null && _a !==
|
|
108359
|
-
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,
|
|
108360
108731
|
draggable: true
|
|
108361
108732
|
});
|
|
108362
108733
|
this._ref.setAttr("wcsStart", this._worldTransformer.screenToWorld({
|
|
108363
108734
|
x: params.position.x,
|
|
108364
108735
|
y: params.position.y
|
|
108365
108736
|
}));
|
|
108366
|
-
this._ref.on("transform",
|
|
108737
|
+
this._ref.on("transform", e => {
|
|
108367
108738
|
const attrs = e.target.attrs;
|
|
108368
108739
|
if (attrs.rotation !== this._ref.rotation()) this._ref.rotation(attrs.rotation);
|
|
108369
108740
|
const scaleByX = Math.abs(attrs.scaleX - 1) > 1e-5;
|
|
@@ -108392,8 +108763,8 @@ void main() {
|
|
|
108392
108763
|
x: 1,
|
|
108393
108764
|
y: 1
|
|
108394
108765
|
});
|
|
108395
|
-
})
|
|
108396
|
-
this._ref.on("transformend", (
|
|
108766
|
+
});
|
|
108767
|
+
this._ref.on("transformend", () => {
|
|
108397
108768
|
const absoluteTransform = this._ref.getStage().getAbsoluteTransform();
|
|
108398
108769
|
const position = absoluteTransform.point({
|
|
108399
108770
|
x: this._ref.x(),
|
|
@@ -108404,8 +108775,8 @@ void main() {
|
|
|
108404
108775
|
x: position.x + this._ref.width(),
|
|
108405
108776
|
y: position.y + this._ref.height()
|
|
108406
108777
|
}));
|
|
108407
|
-
})
|
|
108408
|
-
this._ref.on("dragend", (
|
|
108778
|
+
});
|
|
108779
|
+
this._ref.on("dragend", () => {
|
|
108409
108780
|
const absoluteTransform = this._ref.getStage().getAbsoluteTransform();
|
|
108410
108781
|
const position = absoluteTransform.point({
|
|
108411
108782
|
x: this._ref.x(),
|
|
@@ -108416,7 +108787,7 @@ void main() {
|
|
|
108416
108787
|
x: position.x + this._ref.width(),
|
|
108417
108788
|
y: position.y + this._ref.height()
|
|
108418
108789
|
}));
|
|
108419
|
-
})
|
|
108790
|
+
});
|
|
108420
108791
|
this._ref.id(this._ref._id.toString());
|
|
108421
108792
|
}
|
|
108422
108793
|
getSrc() {
|
|
@@ -108570,10 +108941,10 @@ void main() {
|
|
|
108570
108941
|
this._ref = new Konva.Shape({
|
|
108571
108942
|
x: params.position.x,
|
|
108572
108943
|
y: params.position.y,
|
|
108573
|
-
width: (_a = params.width) !== null && _a !==
|
|
108574
|
-
height: (_b = params.height) !== null && _b !==
|
|
108575
|
-
stroke: (_c = params.color) !== null && _c !==
|
|
108576
|
-
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,
|
|
108577
108948
|
draggable: true,
|
|
108578
108949
|
strokeScaleEnabled: false,
|
|
108579
108950
|
globalCompositeOperation: "source-over",
|
|
@@ -108659,7 +109030,7 @@ void main() {
|
|
|
108659
109030
|
x: params.position2.x,
|
|
108660
109031
|
y: params.position2.y
|
|
108661
109032
|
}));
|
|
108662
|
-
this._ref.on("transform",
|
|
109033
|
+
this._ref.on("transform", e => {
|
|
108663
109034
|
const attrs = e.target.attrs;
|
|
108664
109035
|
const scaleByX = Math.abs(attrs.scaleX - 1) > 1e-5;
|
|
108665
109036
|
const scaleByY = Math.abs(attrs.scaleY - 1) > 1e-5;
|
|
@@ -108679,8 +109050,8 @@ void main() {
|
|
|
108679
109050
|
x: 1,
|
|
108680
109051
|
y: 1
|
|
108681
109052
|
});
|
|
108682
|
-
})
|
|
108683
|
-
this._ref.on("transformend",
|
|
109053
|
+
});
|
|
109054
|
+
this._ref.on("transformend", e => {
|
|
108684
109055
|
const attrs = e.target.attrs;
|
|
108685
109056
|
if (attrs.rotation !== this._ref.rotation()) this._ref.rotation(attrs.rotation);
|
|
108686
109057
|
const absoluteTransform = this._ref.getStage().getAbsoluteTransform();
|
|
@@ -108693,8 +109064,8 @@ void main() {
|
|
|
108693
109064
|
x: position.x + this._ref.width(),
|
|
108694
109065
|
y: position.y + this._ref.height()
|
|
108695
109066
|
}));
|
|
108696
|
-
})
|
|
108697
|
-
this._ref.on("dragend", (
|
|
109067
|
+
});
|
|
109068
|
+
this._ref.on("dragend", () => {
|
|
108698
109069
|
const absoluteTransform = this._ref.getStage().getAbsoluteTransform();
|
|
108699
109070
|
const position = absoluteTransform.point({
|
|
108700
109071
|
x: this._ref.x(),
|
|
@@ -108705,7 +109076,7 @@ void main() {
|
|
|
108705
109076
|
x: position.x + this._ref.width(),
|
|
108706
109077
|
y: position.y + this._ref.height()
|
|
108707
109078
|
}));
|
|
108708
|
-
})
|
|
109079
|
+
});
|
|
108709
109080
|
this._ref.getSelfRect = () => ({
|
|
108710
109081
|
x: 0 - ARC_RADIUS,
|
|
108711
109082
|
y: 0 - ARC_RADIUS,
|
|
@@ -108854,10 +109225,10 @@ void main() {
|
|
|
108854
109225
|
if (timeout) {
|
|
108855
109226
|
clearTimeout(timeout);
|
|
108856
109227
|
}
|
|
108857
|
-
timeout = setTimeout((
|
|
109228
|
+
timeout = setTimeout(() => {
|
|
108858
109229
|
timeout = null;
|
|
108859
109230
|
func(...args);
|
|
108860
|
-
}
|
|
109231
|
+
}, wait);
|
|
108861
109232
|
};
|
|
108862
109233
|
}
|
|
108863
109234
|
|
|
@@ -108870,7 +109241,7 @@ void main() {
|
|
|
108870
109241
|
this.fontSize = 34;
|
|
108871
109242
|
this.changeActiveDragger = event => {
|
|
108872
109243
|
const draggerName = event.data;
|
|
108873
|
-
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(" ");
|
|
108874
109245
|
this.removeTextInput();
|
|
108875
109246
|
this.removeImageInput();
|
|
108876
109247
|
this.enableEditMode(draggerName);
|
|
@@ -108882,9 +109253,9 @@ void main() {
|
|
|
108882
109253
|
if (!this._konvaStage) return;
|
|
108883
109254
|
this._konvaStage.width(width);
|
|
108884
109255
|
this._konvaStage.height(height);
|
|
108885
|
-
this.getObjects().forEach(
|
|
109256
|
+
this.getObjects().forEach(markupObject => {
|
|
108886
109257
|
markupObject.updateScreenCoordinates();
|
|
108887
|
-
})
|
|
109258
|
+
});
|
|
108888
109259
|
};
|
|
108889
109260
|
this.resizeViewer = event => {
|
|
108890
109261
|
const {width: width, height: height} = event;
|
|
@@ -108892,19 +109263,19 @@ void main() {
|
|
|
108892
109263
|
if (!this._konvaStage) return;
|
|
108893
109264
|
this._konvaStage.width(width);
|
|
108894
109265
|
this._konvaStage.height(height);
|
|
108895
|
-
this.getObjects().forEach(
|
|
109266
|
+
this.getObjects().forEach(markupObject => {
|
|
108896
109267
|
markupObject.updateScreenCoordinates();
|
|
108897
|
-
})
|
|
109268
|
+
});
|
|
108898
109269
|
};
|
|
108899
109270
|
this.pan = () => {
|
|
108900
|
-
this.getObjects().forEach(
|
|
109271
|
+
this.getObjects().forEach(markupObject => {
|
|
108901
109272
|
markupObject.updateScreenCoordinates();
|
|
108902
|
-
})
|
|
109273
|
+
});
|
|
108903
109274
|
};
|
|
108904
109275
|
this.zoomAt = () => {
|
|
108905
|
-
this.getObjects().forEach(
|
|
109276
|
+
this.getObjects().forEach(markupObject => {
|
|
108906
109277
|
markupObject.updateScreenCoordinates();
|
|
108907
|
-
})
|
|
109278
|
+
});
|
|
108908
109279
|
};
|
|
108909
109280
|
this.redirectToViewer = event => {
|
|
108910
109281
|
if (this._viewer) this._viewer.emit(event);
|
|
@@ -108919,7 +109290,7 @@ void main() {
|
|
|
108919
109290
|
initialize(container, containerEvents, viewer, worldTransformer) {
|
|
108920
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?');
|
|
108921
109292
|
this._viewer = viewer;
|
|
108922
|
-
this._worldTransformer = worldTransformer !== null && worldTransformer !==
|
|
109293
|
+
this._worldTransformer = worldTransformer !== null && worldTransformer !== void 0 ? worldTransformer : new WorldTransform;
|
|
108923
109294
|
this._container = container;
|
|
108924
109295
|
this._markupContainer = document.createElement("div");
|
|
108925
109296
|
this._markupContainer.id = "markup-container";
|
|
@@ -108947,9 +109318,9 @@ void main() {
|
|
|
108947
109318
|
this._viewer.removeEventListener("changeactivedragger", this.changeActiveDragger);
|
|
108948
109319
|
}
|
|
108949
109320
|
this.destroyKonva();
|
|
108950
|
-
(_a = this._resizeObserver) === null || _a ===
|
|
109321
|
+
(_a = this._resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
108951
109322
|
this._resizeObserver = undefined;
|
|
108952
|
-
(_b = this._markupContainer) === null || _b ===
|
|
109323
|
+
(_b = this._markupContainer) === null || _b === void 0 ? void 0 : _b.remove();
|
|
108953
109324
|
this._markupContainer = undefined;
|
|
108954
109325
|
this._container = undefined;
|
|
108955
109326
|
this._viewer = undefined;
|
|
@@ -108961,7 +109332,7 @@ void main() {
|
|
|
108961
109332
|
this.removeTextInput();
|
|
108962
109333
|
this.removeImageInput();
|
|
108963
109334
|
this.clearSelected();
|
|
108964
|
-
this.getObjects().forEach(
|
|
109335
|
+
this.getObjects().forEach(obj => obj.delete());
|
|
108965
109336
|
}
|
|
108966
109337
|
getMarkupColor() {
|
|
108967
109338
|
return this._markupColor.asRGB();
|
|
@@ -108980,17 +109351,17 @@ void main() {
|
|
|
108980
109351
|
colorizeAllMarkup(r, g, b) {
|
|
108981
109352
|
this.setMarkupColor(r, g, b);
|
|
108982
109353
|
const hexColor = new MarkupColor(r, g, b).asHex();
|
|
108983
|
-
this.getObjects().filter(
|
|
109354
|
+
this.getObjects().filter(obj => {
|
|
108984
109355
|
var _a;
|
|
108985
|
-
return (_a = obj.setColor) === null || _a ===
|
|
108986
|
-
})
|
|
109356
|
+
return (_a = obj.setColor) === null || _a === void 0 ? void 0 : _a.call(obj, hexColor);
|
|
109357
|
+
});
|
|
108987
109358
|
}
|
|
108988
109359
|
colorizeSelectedMarkups(r, g, b) {
|
|
108989
109360
|
const hexColor = new MarkupColor(r, g, b).asHex();
|
|
108990
|
-
this.getSelectedObjects().filter(
|
|
109361
|
+
this.getSelectedObjects().filter(obj => {
|
|
108991
109362
|
var _a;
|
|
108992
|
-
return (_a = obj.setColor) === null || _a ===
|
|
108993
|
-
})
|
|
109363
|
+
return (_a = obj.setColor) === null || _a === void 0 ? void 0 : _a.call(obj, hexColor);
|
|
109364
|
+
});
|
|
108994
109365
|
}
|
|
108995
109366
|
setViewpoint(viewpoint) {
|
|
108996
109367
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
@@ -109005,51 +109376,51 @@ void main() {
|
|
|
109005
109376
|
x: 0,
|
|
109006
109377
|
y: 0
|
|
109007
109378
|
});
|
|
109008
|
-
const markupColor = ((_a = viewpoint.custom_fields) === null || _a ===
|
|
109379
|
+
const markupColor = ((_a = viewpoint.custom_fields) === null || _a === void 0 ? void 0 : _a.markup_color) || {
|
|
109009
109380
|
r: 255,
|
|
109010
109381
|
g: 0,
|
|
109011
109382
|
b: 0
|
|
109012
109383
|
};
|
|
109013
109384
|
this.setMarkupColor(markupColor.r, markupColor.g, markupColor.b);
|
|
109014
|
-
(_b = viewpoint.lines) === null || _b ===
|
|
109385
|
+
(_b = viewpoint.lines) === null || _b === void 0 ? void 0 : _b.forEach(line => {
|
|
109015
109386
|
const linePoints = [];
|
|
109016
|
-
line.points.forEach(
|
|
109387
|
+
line.points.forEach(point => {
|
|
109017
109388
|
const screenPoint = this._worldTransformer.worldToScreen(point);
|
|
109018
109389
|
linePoints.push(screenPoint.x);
|
|
109019
109390
|
linePoints.push(screenPoint.y);
|
|
109020
|
-
})
|
|
109391
|
+
});
|
|
109021
109392
|
this.addLine(linePoints, line.color, line.type, line.width, line.id);
|
|
109022
|
-
})
|
|
109023
|
-
(_c = viewpoint.texts) === null || _c ===
|
|
109393
|
+
});
|
|
109394
|
+
(_c = viewpoint.texts) === null || _c === void 0 ? void 0 : _c.forEach(text => {
|
|
109024
109395
|
const screenPoint = this._worldTransformer.worldToScreen(text.position);
|
|
109025
109396
|
this.addText(text.text, screenPoint, text.angle, text.color, text.text_size, text.font_size, text.id);
|
|
109026
|
-
})
|
|
109027
|
-
(_d = viewpoint.rectangles) === null || _d ===
|
|
109397
|
+
});
|
|
109398
|
+
(_d = viewpoint.rectangles) === null || _d === void 0 ? void 0 : _d.forEach(rect => {
|
|
109028
109399
|
const screenPoint = this._worldTransformer.worldToScreen(rect.position);
|
|
109029
109400
|
const screenPoint2 = rect.position2 ? this._worldTransformer.worldToScreen(rect.position2) : null;
|
|
109030
109401
|
this.addRectangle(screenPoint, screenPoint2, rect.width, rect.height, rect.line_width, rect.color, rect.id);
|
|
109031
|
-
})
|
|
109032
|
-
(_e = viewpoint.ellipses) === null || _e ===
|
|
109402
|
+
});
|
|
109403
|
+
(_e = viewpoint.ellipses) === null || _e === void 0 ? void 0 : _e.forEach(ellipse => {
|
|
109033
109404
|
const screenPoint = this._worldTransformer.worldToScreen(ellipse.position);
|
|
109034
109405
|
const screenPoint2 = ellipse.position2 ? this._worldTransformer.worldToScreen(ellipse.position2) : null;
|
|
109035
109406
|
const screenPoint3 = ellipse.position3 ? this._worldTransformer.worldToScreen(ellipse.position3) : null;
|
|
109036
109407
|
this.addEllipse(screenPoint, screenPoint2, screenPoint3, ellipse.radius, ellipse.line_width, ellipse.color, ellipse.id);
|
|
109037
|
-
})
|
|
109038
|
-
(_f = viewpoint.arrows) === null || _f ===
|
|
109408
|
+
});
|
|
109409
|
+
(_f = viewpoint.arrows) === null || _f === void 0 ? void 0 : _f.forEach(arrow => {
|
|
109039
109410
|
const startPoint = this._worldTransformer.worldToScreen(arrow.start);
|
|
109040
109411
|
const endPoint = this._worldTransformer.worldToScreen(arrow.end);
|
|
109041
109412
|
this.addArrow(startPoint, endPoint, arrow.color, arrow.id);
|
|
109042
|
-
})
|
|
109043
|
-
(_g = viewpoint.clouds) === null || _g ===
|
|
109413
|
+
});
|
|
109414
|
+
(_g = viewpoint.clouds) === null || _g === void 0 ? void 0 : _g.forEach(cloud => {
|
|
109044
109415
|
const screenPoint = this._worldTransformer.worldToScreen(cloud.position);
|
|
109045
109416
|
const screenPoint2 = cloud.position2 ? this._worldTransformer.worldToScreen(cloud.position2) : null;
|
|
109046
109417
|
this.addCloud(screenPoint, screenPoint2, cloud.width, cloud.height, cloud.line_width, cloud.color, cloud.id);
|
|
109047
|
-
})
|
|
109048
|
-
(_h = viewpoint.images) === null || _h ===
|
|
109418
|
+
});
|
|
109419
|
+
(_h = viewpoint.images) === null || _h === void 0 ? void 0 : _h.forEach(image => {
|
|
109049
109420
|
const screenPoint = this._worldTransformer.worldToScreen(image.position);
|
|
109050
109421
|
const screenPoint2 = image.position2 ? this._worldTransformer.worldToScreen(image.position2) : null;
|
|
109051
109422
|
this.addImage(screenPoint, screenPoint2, image.src, image.width, image.height, image.id);
|
|
109052
|
-
})
|
|
109423
|
+
});
|
|
109053
109424
|
}
|
|
109054
109425
|
getViewpoint(viewpoint) {
|
|
109055
109426
|
if (!viewpoint) viewpoint = {};
|
|
@@ -109091,23 +109462,23 @@ void main() {
|
|
|
109091
109462
|
}
|
|
109092
109463
|
getObjects() {
|
|
109093
109464
|
const objects = [];
|
|
109094
|
-
Object.keys(MarkupMode2Konva).forEach(
|
|
109465
|
+
Object.keys(MarkupMode2Konva).forEach(type => {
|
|
109095
109466
|
const konvaShape = MarkupMode2Konva[type];
|
|
109096
|
-
this.konvaLayerFind(type).forEach(
|
|
109097
|
-
})
|
|
109467
|
+
this.konvaLayerFind(type).forEach(ref => objects.push(konvaShape.initializer(ref, null, this._worldTransformer)));
|
|
109468
|
+
});
|
|
109098
109469
|
return objects;
|
|
109099
109470
|
}
|
|
109100
109471
|
getSelectedObjects() {
|
|
109101
109472
|
if (!this._konvaTransformer) return [];
|
|
109102
|
-
return this._konvaTransformer.nodes().map(
|
|
109473
|
+
return this._konvaTransformer.nodes().map(ref => {
|
|
109103
109474
|
const name = ref.className;
|
|
109104
|
-
const konvaShape = Object.values(MarkupMode2Konva).find(
|
|
109475
|
+
const konvaShape = Object.values(MarkupMode2Konva).find(shape => shape.name === name);
|
|
109105
109476
|
return konvaShape ? konvaShape.initializer(ref, null, this._worldTransformer) : null;
|
|
109106
|
-
})
|
|
109477
|
+
}).filter(x => x);
|
|
109107
109478
|
}
|
|
109108
109479
|
selectObjects(objects) {
|
|
109109
109480
|
if (!this._konvaTransformer) return;
|
|
109110
|
-
const selectedObjs = this._konvaTransformer.nodes().concat(objects.map(
|
|
109481
|
+
const selectedObjs = this._konvaTransformer.nodes().concat(objects.map(x => x.ref()));
|
|
109111
109482
|
this._konvaTransformer.nodes(selectedObjs);
|
|
109112
109483
|
}
|
|
109113
109484
|
clearSelected() {
|
|
@@ -109120,7 +109491,7 @@ void main() {
|
|
|
109120
109491
|
if (!this._konvaLayer) return [];
|
|
109121
109492
|
const konvaShape = MarkupMode2Konva[type];
|
|
109122
109493
|
if (!konvaShape || !konvaShape.initializer) return [];
|
|
109123
|
-
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);
|
|
109124
109495
|
}
|
|
109125
109496
|
initializeKonva() {
|
|
109126
109497
|
const stage = new Konva.Stage({
|
|
@@ -109151,7 +109522,7 @@ void main() {
|
|
|
109151
109522
|
let lastLine;
|
|
109152
109523
|
let mouseDownPos;
|
|
109153
109524
|
let lastObj;
|
|
109154
|
-
stage.on("mousedown touchstart",
|
|
109525
|
+
stage.on("mousedown touchstart", e => {
|
|
109155
109526
|
if (!this._markupIsActive || e.target !== stage || this._markupMode === "Text" || this._markupMode === "Image") return;
|
|
109156
109527
|
if (e.target === stage && transformer.nodes().length > 0) {
|
|
109157
109528
|
transformer.nodes([]);
|
|
@@ -109159,12 +109530,12 @@ void main() {
|
|
|
109159
109530
|
}
|
|
109160
109531
|
const pos = this.getRelativePointerPosition(stage);
|
|
109161
109532
|
mouseDownPos = pos;
|
|
109162
|
-
isPaint = [ "Arrow", "Cloud", "Ellipse", "Line", "Rectangle" ].some(
|
|
109533
|
+
isPaint = [ "Arrow", "Cloud", "Ellipse", "Line", "Rectangle" ].some(m => m === this._markupMode);
|
|
109163
109534
|
if (this._markupMode === "Line") {
|
|
109164
109535
|
lastLine = this.addLine([ pos.x, pos.y, pos.x, pos.y ]);
|
|
109165
109536
|
}
|
|
109166
|
-
})
|
|
109167
|
-
stage.on("mouseup touchend", (
|
|
109537
|
+
});
|
|
109538
|
+
stage.on("mouseup touchend", () => {
|
|
109168
109539
|
if (!this._markupIsActive) return;
|
|
109169
109540
|
if (isPaint) {
|
|
109170
109541
|
const pos = this.getRelativePointerPosition(stage);
|
|
@@ -109205,8 +109576,8 @@ void main() {
|
|
|
109205
109576
|
}
|
|
109206
109577
|
lastObj = undefined;
|
|
109207
109578
|
isPaint = false;
|
|
109208
|
-
})
|
|
109209
|
-
stage.on("mousemove touchmove", (
|
|
109579
|
+
});
|
|
109580
|
+
stage.on("mousemove touchmove", () => {
|
|
109210
109581
|
if (!this._markupIsActive) return;
|
|
109211
109582
|
if (!isPaint) {
|
|
109212
109583
|
return;
|
|
@@ -109261,8 +109632,8 @@ void main() {
|
|
|
109261
109632
|
y: startY
|
|
109262
109633
|
}, null, dX, dY);
|
|
109263
109634
|
}
|
|
109264
|
-
})
|
|
109265
|
-
stage.on("click tap",
|
|
109635
|
+
});
|
|
109636
|
+
stage.on("click tap", e => {
|
|
109266
109637
|
if (!this._markupIsActive) return;
|
|
109267
109638
|
if (e.target === stage) {
|
|
109268
109639
|
if (this._markupMode === "Text") {
|
|
@@ -109304,7 +109675,7 @@ void main() {
|
|
|
109304
109675
|
this.removeImageInput();
|
|
109305
109676
|
}
|
|
109306
109677
|
}
|
|
109307
|
-
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") {
|
|
109308
109679
|
transformer.rotateEnabled(false);
|
|
109309
109680
|
} else {
|
|
109310
109681
|
transformer.rotateEnabled(true);
|
|
@@ -109321,26 +109692,26 @@ void main() {
|
|
|
109321
109692
|
const nodes = transformer.nodes().concat([ e.target ]);
|
|
109322
109693
|
transformer.nodes(nodes);
|
|
109323
109694
|
}
|
|
109324
|
-
})
|
|
109695
|
+
});
|
|
109325
109696
|
const container = stage.container();
|
|
109326
109697
|
container.tabIndex = 1;
|
|
109327
109698
|
container.focus();
|
|
109328
|
-
container.addEventListener("keydown",
|
|
109699
|
+
container.addEventListener("keydown", e => {
|
|
109329
109700
|
if (!this._markupIsActive) return;
|
|
109330
109701
|
if (e.code === "Delete") {
|
|
109331
|
-
this.getSelectedObjects().forEach(
|
|
109702
|
+
this.getSelectedObjects().forEach(obj => obj.delete());
|
|
109332
109703
|
this.clearSelected();
|
|
109333
109704
|
return;
|
|
109334
109705
|
}
|
|
109335
109706
|
e.preventDefault();
|
|
109336
|
-
})
|
|
109707
|
+
});
|
|
109337
109708
|
}
|
|
109338
109709
|
destroyKonva() {
|
|
109339
109710
|
var _a;
|
|
109340
109711
|
this.removeTextInput();
|
|
109341
109712
|
this.removeImageInput();
|
|
109342
109713
|
this.clearOverlay();
|
|
109343
|
-
(_a = this._konvaStage) === null || _a ===
|
|
109714
|
+
(_a = this._konvaStage) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
109344
109715
|
this._groupImages = undefined;
|
|
109345
109716
|
this._groupGeometry = undefined;
|
|
109346
109717
|
this._groupTexts = undefined;
|
|
@@ -109350,7 +109721,7 @@ void main() {
|
|
|
109350
109721
|
}
|
|
109351
109722
|
getMarkupLines() {
|
|
109352
109723
|
const lines = [];
|
|
109353
|
-
this.konvaLayerFind("Line").forEach(
|
|
109724
|
+
this.konvaLayerFind("Line").forEach(ref => {
|
|
109354
109725
|
const wcsPoints = ref.getAttr("wcsPoints");
|
|
109355
109726
|
if (!wcsPoints) return;
|
|
109356
109727
|
const konvaLine = new KonvaLine(null, ref, this._worldTransformer);
|
|
@@ -109362,12 +109733,12 @@ void main() {
|
|
|
109362
109733
|
width: konvaLine.getLineWidth() || this.lineWidth
|
|
109363
109734
|
};
|
|
109364
109735
|
lines.push(line);
|
|
109365
|
-
})
|
|
109736
|
+
});
|
|
109366
109737
|
return lines;
|
|
109367
109738
|
}
|
|
109368
109739
|
getMarkupTexts() {
|
|
109369
109740
|
const texts = [];
|
|
109370
|
-
this.konvaLayerFind("Text").forEach(
|
|
109741
|
+
this.konvaLayerFind("Text").forEach(ref => {
|
|
109371
109742
|
const textSize = .02;
|
|
109372
109743
|
const textScale = this._worldTransformer.getScale();
|
|
109373
109744
|
const wcsPosition = ref.getAttr("wcsStart");
|
|
@@ -109383,12 +109754,12 @@ void main() {
|
|
|
109383
109754
|
font_size: shape.getFontSize() * stageAbsoluteTransform.getMatrix()[0]
|
|
109384
109755
|
};
|
|
109385
109756
|
texts.push(text);
|
|
109386
|
-
})
|
|
109757
|
+
});
|
|
109387
109758
|
return texts;
|
|
109388
109759
|
}
|
|
109389
109760
|
getMarkupRectangles() {
|
|
109390
109761
|
const rectangles = [];
|
|
109391
|
-
this.konvaLayerFind("Rectangle").forEach(
|
|
109762
|
+
this.konvaLayerFind("Rectangle").forEach(ref => {
|
|
109392
109763
|
const wcsStart = ref.getAttr("wcsStart");
|
|
109393
109764
|
const wcsEnd = ref.getAttr("wcsEnd");
|
|
109394
109765
|
const screenStart = this._worldTransformer.worldToScreen(wcsStart);
|
|
@@ -109404,12 +109775,12 @@ void main() {
|
|
|
109404
109775
|
color: shape.getColor()
|
|
109405
109776
|
};
|
|
109406
109777
|
rectangles.push(rectangle);
|
|
109407
|
-
})
|
|
109778
|
+
});
|
|
109408
109779
|
return rectangles;
|
|
109409
109780
|
}
|
|
109410
109781
|
getMarkupEllipses() {
|
|
109411
109782
|
const ellipses = [];
|
|
109412
|
-
this.konvaLayerFind("Ellipse").forEach(
|
|
109783
|
+
this.konvaLayerFind("Ellipse").forEach(ref => {
|
|
109413
109784
|
const wcsPosition = ref.getAttr("wcsPosition");
|
|
109414
109785
|
const wcsPosition2 = ref.getAttr("wcsRadiusX");
|
|
109415
109786
|
const wcsPosition3 = ref.getAttr("wcsRadiusY");
|
|
@@ -109429,12 +109800,12 @@ void main() {
|
|
|
109429
109800
|
color: shape.getColor()
|
|
109430
109801
|
};
|
|
109431
109802
|
ellipses.push(ellipse);
|
|
109432
|
-
})
|
|
109803
|
+
});
|
|
109433
109804
|
return ellipses;
|
|
109434
109805
|
}
|
|
109435
109806
|
getMarkupArrows() {
|
|
109436
109807
|
const arrows = [];
|
|
109437
|
-
this.konvaLayerFind("Arrow").forEach(
|
|
109808
|
+
this.konvaLayerFind("Arrow").forEach(ref => {
|
|
109438
109809
|
const wcsStart = ref.getAttr("wcsStart");
|
|
109439
109810
|
const wcsEnd = ref.getAttr("wcsEnd");
|
|
109440
109811
|
const shape = new KonvaArrow(null, ref, this._worldTransformer);
|
|
@@ -109445,12 +109816,12 @@ void main() {
|
|
|
109445
109816
|
color: shape.getColor()
|
|
109446
109817
|
};
|
|
109447
109818
|
arrows.push(arrow);
|
|
109448
|
-
})
|
|
109819
|
+
});
|
|
109449
109820
|
return arrows;
|
|
109450
109821
|
}
|
|
109451
109822
|
getMarkupImages() {
|
|
109452
109823
|
const images = [];
|
|
109453
|
-
this.konvaLayerFind("Image").forEach(
|
|
109824
|
+
this.konvaLayerFind("Image").forEach(ref => {
|
|
109454
109825
|
const wcsStart = ref.getAttr("wcsStart");
|
|
109455
109826
|
const wcsEnd = ref.getAttr("wcsEnd");
|
|
109456
109827
|
const stageAbsoluteTransform = this._konvaStage.getAbsoluteTransform();
|
|
@@ -109465,12 +109836,12 @@ void main() {
|
|
|
109465
109836
|
height: shape.getHeight() * scale
|
|
109466
109837
|
};
|
|
109467
109838
|
images.push(image);
|
|
109468
|
-
})
|
|
109839
|
+
});
|
|
109469
109840
|
return images;
|
|
109470
109841
|
}
|
|
109471
109842
|
getMarkupClouds() {
|
|
109472
109843
|
const clouds = [];
|
|
109473
|
-
this.konvaLayerFind("Cloud").forEach(
|
|
109844
|
+
this.konvaLayerFind("Cloud").forEach(ref => {
|
|
109474
109845
|
const wcsStart = ref.getAttr("wcsStart");
|
|
109475
109846
|
const wcsEnd = ref.getAttr("wcsEnd");
|
|
109476
109847
|
const screenStart = this._worldTransformer.worldToScreen(wcsStart);
|
|
@@ -109486,7 +109857,7 @@ void main() {
|
|
|
109486
109857
|
color: shape.getColor()
|
|
109487
109858
|
};
|
|
109488
109859
|
clouds.push(cloud);
|
|
109489
|
-
})
|
|
109860
|
+
});
|
|
109490
109861
|
return clouds;
|
|
109491
109862
|
}
|
|
109492
109863
|
combineMarkupWithDrawing() {
|
|
@@ -109547,23 +109918,23 @@ void main() {
|
|
|
109547
109918
|
};
|
|
109548
109919
|
if (text) this._textInputRef.value = text;
|
|
109549
109920
|
document.body.appendChild(this._textInputRef);
|
|
109550
|
-
setTimeout((
|
|
109921
|
+
setTimeout(() => {
|
|
109551
109922
|
this._textInputRef.focus();
|
|
109552
|
-
}
|
|
109923
|
+
}, 50);
|
|
109553
109924
|
} else {
|
|
109554
109925
|
this.removeTextInput();
|
|
109555
109926
|
}
|
|
109556
109927
|
}
|
|
109557
109928
|
removeTextInput() {
|
|
109558
109929
|
var _a;
|
|
109559
|
-
(_a = this._textInputRef) === null || _a ===
|
|
109930
|
+
(_a = this._textInputRef) === null || _a === void 0 ? void 0 : _a.remove();
|
|
109560
109931
|
this._textInputRef = null;
|
|
109561
109932
|
this._textInputPos = null;
|
|
109562
109933
|
this._textInputAngle = 0;
|
|
109563
109934
|
}
|
|
109564
109935
|
createImageInput(pos) {
|
|
109565
109936
|
if (!this._imageInputRef) {
|
|
109566
|
-
const convertBase64 = file => new Promise((
|
|
109937
|
+
const convertBase64 = file => new Promise((resolve, reject) => {
|
|
109567
109938
|
const fileReader = new FileReader;
|
|
109568
109939
|
fileReader.readAsDataURL(file);
|
|
109569
109940
|
fileReader.onload = () => {
|
|
@@ -109572,7 +109943,7 @@ void main() {
|
|
|
109572
109943
|
fileReader.onerror = error => {
|
|
109573
109944
|
reject(error);
|
|
109574
109945
|
};
|
|
109575
|
-
})
|
|
109946
|
+
});
|
|
109576
109947
|
this._imageInputPos = pos;
|
|
109577
109948
|
this._imageInputRef = document.createElement("input");
|
|
109578
109949
|
this._imageInputRef.style.display = "none";
|
|
@@ -109590,23 +109961,23 @@ void main() {
|
|
|
109590
109961
|
this.removeImageInput();
|
|
109591
109962
|
};
|
|
109592
109963
|
document.body.appendChild(this._imageInputRef);
|
|
109593
|
-
setTimeout((
|
|
109964
|
+
setTimeout(() => {
|
|
109594
109965
|
this._imageInputRef.click();
|
|
109595
|
-
}
|
|
109966
|
+
}, 50);
|
|
109596
109967
|
} else {
|
|
109597
109968
|
this.removeImageInput();
|
|
109598
109969
|
}
|
|
109599
109970
|
}
|
|
109600
109971
|
removeImageInput() {
|
|
109601
109972
|
var _a;
|
|
109602
|
-
(_a = this._imageInputRef) === null || _a ===
|
|
109973
|
+
(_a = this._imageInputRef) === null || _a === void 0 ? void 0 : _a.remove();
|
|
109603
109974
|
this._imageInputRef = null;
|
|
109604
109975
|
this._imageInputPos = null;
|
|
109605
109976
|
}
|
|
109606
109977
|
addText(text, position, angle, color, textSize, fontSize, id) {
|
|
109607
109978
|
var _a;
|
|
109608
109979
|
if (!text) return;
|
|
109609
|
-
(_a = this.getSelectedObjects().
|
|
109980
|
+
(_a = this.getSelectedObjects().shift()) === null || _a === void 0 ? void 0 : _a.delete();
|
|
109610
109981
|
this.clearSelected();
|
|
109611
109982
|
this.removeTextInput();
|
|
109612
109983
|
const tolerance = 1e-6;
|
|
@@ -109685,7 +110056,7 @@ void main() {
|
|
|
109685
110056
|
addImage(position, position2, src, width, height, id) {
|
|
109686
110057
|
var _a;
|
|
109687
110058
|
if (!position || !src) return;
|
|
109688
|
-
(_a = this.getSelectedObjects().
|
|
110059
|
+
(_a = this.getSelectedObjects().shift()) === null || _a === void 0 ? void 0 : _a.delete();
|
|
109689
110060
|
this.clearSelected();
|
|
109690
110061
|
this.removeImageInput();
|
|
109691
110062
|
const konvaImage = new KonvaImage({
|
|
@@ -109956,7 +110327,7 @@ void main() {
|
|
|
109956
110327
|
else {
|
|
109957
110328
|
this.composer.render(deltaTime);
|
|
109958
110329
|
}
|
|
109959
|
-
(_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);
|
|
109960
110331
|
this.emitEvent({ type: "render", time, deltaTime });
|
|
109961
110332
|
}
|
|
109962
110333
|
loadReferences(model) {
|
|
@@ -110175,7 +110546,7 @@ void main() {
|
|
|
110175
110546
|
newDragger = draggers.createDragger(name, this);
|
|
110176
110547
|
if (newDragger) {
|
|
110177
110548
|
this._activeDragger = newDragger;
|
|
110178
|
-
(_b = (_a = this._activeDragger).initialize) === null || _b ===
|
|
110549
|
+
(_b = (_a = this._activeDragger).initialize) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
110179
110550
|
}
|
|
110180
110551
|
}
|
|
110181
110552
|
const canvas = this.canvas;
|
|
@@ -110280,7 +110651,7 @@ void main() {
|
|
|
110280
110651
|
}
|
|
110281
110652
|
};
|
|
110282
110653
|
const setClippingPlanes = (clipping_planes) => {
|
|
110283
|
-
clipping_planes === null || clipping_planes ===
|
|
110654
|
+
clipping_planes === null || clipping_planes === void 0 ? void 0 : clipping_planes.forEach((clipping_plane) => {
|
|
110284
110655
|
const plane = new Plane();
|
|
110285
110656
|
plane.setFromNormalAndCoplanarPoint(getVector3FromPoint3d(clipping_plane.direction), getVector3FromPoint3d(clipping_plane.location));
|
|
110286
110657
|
this.renderer.clippingPlanes.push(plane);
|
|
@@ -110290,7 +110661,7 @@ void main() {
|
|
|
110290
110661
|
if (selection)
|
|
110291
110662
|
this.setSelected(selection.map((component) => component.handle));
|
|
110292
110663
|
};
|
|
110293
|
-
const draggerName = (_a = this._activeDragger) === null || _a ===
|
|
110664
|
+
const draggerName = (_a = this._activeDragger) === null || _a === void 0 ? void 0 : _a.name;
|
|
110294
110665
|
this.setActiveDragger();
|
|
110295
110666
|
this.clearSlices();
|
|
110296
110667
|
this.clearOverlay();
|
|
@@ -110302,7 +110673,7 @@ void main() {
|
|
|
110302
110673
|
setClippingPlanes(viewpoint.clipping_planes);
|
|
110303
110674
|
setSelection(viewpoint.selection);
|
|
110304
110675
|
this._markup.setViewpoint(viewpoint);
|
|
110305
|
-
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);
|
|
110306
110677
|
this.setActiveDragger(draggerName);
|
|
110307
110678
|
this.emitEvent({ type: "drawviewpoint", data: viewpoint });
|
|
110308
110679
|
this.update();
|