@xeokit/xeokit-sdk 2.6.34 → 2.6.35

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xeokit/xeokit-sdk",
3
- "version": "2.6.34",
3
+ "version": "2.6.35",
4
4
  "description": "Web Programming Toolkit for 3D/2D BIM and AEC Graphics",
5
5
  "module": "./dist/xeokit-sdk.es.js",
6
6
  "main": "./dist/xeokit-sdk.cjs.js",
@@ -74,7 +74,6 @@ export class AngleMeasurementsMouseControl extends AngleMeasurementsControl {
74
74
 
75
75
  _initMarkerDiv() {
76
76
  const markerDiv = document.createElement('div');
77
- markerDiv.setAttribute('id', 'myMarkerDiv');
78
77
  const canvas = this.scene.canvas.canvas;
79
78
  canvas.parentNode.insertBefore(markerDiv, canvas);
80
79
 
@@ -95,9 +94,8 @@ export class AngleMeasurementsMouseControl extends AngleMeasurementsControl {
95
94
 
96
95
  _destroyMarkerDiv() {
97
96
  if (this.markerDiv) {
98
- const element = document.getElementById('myMarkerDiv')
99
- element.parentNode.removeChild(element)
100
- this.markerDiv = null
97
+ this.markerDiv.parentNode.removeChild(this.markerDiv);
98
+ this.markerDiv = null;
101
99
  }
102
100
  }
103
101
 
@@ -82,7 +82,6 @@ export class DistanceMeasurementsMouseControl extends DistanceMeasurementsContro
82
82
 
83
83
  _initMarkerDiv() {
84
84
  const markerDiv = document.createElement('div');
85
- markerDiv.setAttribute('id', 'myMarkerDiv');
86
85
  const canvas = this.scene.canvas.canvas;
87
86
  canvas.parentNode.insertBefore(markerDiv, canvas);
88
87
  markerDiv.style.background = "black";
@@ -102,9 +101,8 @@ export class DistanceMeasurementsMouseControl extends DistanceMeasurementsContro
102
101
 
103
102
  _destroyMarkerDiv() {
104
103
  if (this._markerDiv) {
105
- const element = document.getElementById('myMarkerDiv')
106
- element.parentNode.removeChild(element)
107
- this._markerDiv = null
104
+ this._markerDiv.parentNode.removeChild(this._markerDiv);
105
+ this._markerDiv = null;
108
106
  }
109
107
  }
110
108
 
@@ -644,7 +644,8 @@ class CameraControl extends Component {
644
644
  constrainVertical: false,
645
645
  smartPivot: false,
646
646
  doubleClickTimeFrame: 250,
647
-
647
+ zoomOnMouseWheel: true,
648
+
648
649
  snapToVertex: DEFAULT_SNAP_VERTEX,
649
650
  snapToEdge: DEFAULT_SNAP_EDGE,
650
651
  snapRadius: DEFAULT_SNAP_PICK_RADIUS,
@@ -1735,6 +1736,26 @@ class CameraControl extends Component {
1735
1736
  return this._configs.doubleClickTimeFrame;
1736
1737
  }
1737
1738
 
1739
+ /**
1740
+ * Sets whether to zoom the camera on mouse wheel
1741
+ *
1742
+ * Default is ````true````
1743
+ *
1744
+ * @param {Boolean} enabled
1745
+ */
1746
+ set zoomOnMouseWheel(enabled) {
1747
+ this._configs.zoomOnMouseWheel = !!enabled;
1748
+ }
1749
+
1750
+ /**
1751
+ * Gets whether to zoom the camera on mouse wheel
1752
+ *
1753
+ * @returns {Boolean}
1754
+ */
1755
+ get zoomOnMouseWheel() {
1756
+ return this._configs.zoomOnMouseWheel;
1757
+ }
1758
+
1738
1759
  /**
1739
1760
  * Destroys this ````CameraControl````.
1740
1761
  * @private
@@ -296,7 +296,7 @@ class MousePanRotateDollyHandler {
296
296
  let secsNowLast = null;
297
297
 
298
298
  canvas.addEventListener("wheel", this._mouseWheelHandler = (e) => {
299
- if (!(configs.active && configs.pointerEnabled)) {
299
+ if (!(configs.active && configs.pointerEnabled && configs.zoomOnMouseWheel)) {
300
300
  return;
301
301
  }
302
302
  const secsNow = performance.now() / 1000.0;