@xeokit/xeokit-sdk 2.6.0-beta-6 → 2.6.0-beta-8

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.0-beta-6",
3
+ "version": "2.6.0-beta-8",
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",
@@ -189,6 +189,10 @@ export class AngleMeasurementsMouseControl extends AngleMeasurementsControl {
189
189
  const mouseWorldPos = math.vec3();
190
190
  const mouseHoverCanvasPos = math.vec2();
191
191
  this._currentAngleMeasurement = null;
192
+
193
+ const getTop = el => el.offsetTop + (el.offsetParent && getTop(el.offsetParent));
194
+ const getLeft = el => el.offsetLeft + (el.offsetParent && getLeft(el.offsetParent));
195
+
192
196
  this._onMouseHoverSurface = cameraControl.on(
193
197
  this._snapping
194
198
  ? "hoverSnapOrSurface"
@@ -220,13 +224,9 @@ export class AngleMeasurementsMouseControl extends AngleMeasurementsControl {
220
224
  mouseHoverCanvasPos.set(canvasPos);
221
225
  switch (this._mouseState) {
222
226
  case MOUSE_FINDING_ORIGIN:
223
- const canvasBoundRect = canvas.getBoundingClientRect();
224
- const scrollLeft = window.pageXOffset || document.documentElement.scrollLeft;
225
- const scrollTop = window.pageYOffset || document.documentElement.scrollTop;
226
- const canvasLeftEdge = canvasBoundRect.left + scrollLeft;
227
- const canvasTopEdge = canvasBoundRect.top + scrollTop;
228
- this.markerDiv.style.left = `${canvasLeftEdge + canvasPos[0] - 5}px`;
229
- this.markerDiv.style.top = `${canvasTopEdge + canvasPos[1] - 5}px`;
227
+ this.markerDiv.style.left = `${getLeft(canvas) + canvasPos[0] - 5}px`;
228
+ this.markerDiv.style.top = `${getTop(canvas) + canvasPos[1] - 5}px`;
229
+
230
230
  break;
231
231
  case MOUSE_FINDING_CORNER:
232
232
  if (this._currentAngleMeasurement) {
@@ -197,6 +197,9 @@ export class DistanceMeasurementsMouseControl extends DistanceMeasurementsContro
197
197
 
198
198
  this._mouseState = MOUSE_FIRST_CLICK_EXPECTED;
199
199
 
200
+ const getTop = el => el.offsetTop + (el.offsetParent && getTop(el.offsetParent));
201
+ const getLeft = el => el.offsetLeft + (el.offsetParent && getLeft(el.offsetParent));
202
+
200
203
  this._onCameraControlHoverSnapOrSurface = cameraControl.on(
201
204
  this._snapping
202
205
  ? "hoverSnapOrSurface"
@@ -207,16 +210,8 @@ export class DistanceMeasurementsMouseControl extends DistanceMeasurementsContro
207
210
  pointerCanvasPos.set(event.canvasPos);
208
211
  if (this._mouseState === MOUSE_FIRST_CLICK_EXPECTED) {
209
212
 
210
- // const canvasBoundary = getCanvasBoundary();
211
-
212
- const canvasBoundRect = canvas.getBoundingClientRect();
213
- const scrollLeft = window.pageXOffset || document.documentElement.scrollLeft;
214
- const scrollTop = window.pageYOffset || document.documentElement.scrollTop;
215
- const canvasLeftEdge = canvasBoundRect.left + scrollLeft;
216
- const canvasTopEdge = canvasBoundRect.top + scrollTop;
217
-
218
- this._markerDiv.style.left = `${canvasLeftEdge + canvasPos[0] - 5}px`;
219
- this._markerDiv.style.top = `${canvasTopEdge + canvasPos[1] - 5}px`;
213
+ this._markerDiv.style.left = `${getLeft(canvas) + canvasPos[0] - 5}px`;
214
+ this._markerDiv.style.top = `${getTop(canvas) + canvasPos[1] - 5}px`;
220
215
 
221
216
  this._markerDiv.style.background = "pink";
222
217
  if (event.snappedToVertex || event.snappedToEdge) {
@@ -1,5 +1,5 @@
1
1
  import {utils} from "../../viewer/scene/utils.js";
2
- import {core} from "../../viewer/scene/core";
2
+ import {core} from "../../viewer/scene/core.js";
3
3
 
4
4
  /**
5
5
  * Default data access strategy for {@link GLTFLoaderPlugin}.
@@ -1,5 +1,5 @@
1
1
  import {Map} from "./scene/utils/Map.js";
2
- import {core} from "./scene/core";
2
+ import {core} from "./scene/core.js";
3
3
 
4
4
  /**
5
5
  @desc Base class for {@link Viewer} plugin classes.
@@ -3,7 +3,7 @@ import {CameraFlightAnimation} from "./scene/camera/CameraFlightAnimation.js";
3
3
  import {CameraControl} from "./scene/CameraControl/CameraControl.js";
4
4
  import {MetaScene} from "./metadata/MetaScene.js";
5
5
  import {LocaleService} from "./localization/LocaleService.js";
6
- import html2canvas from 'html2canvas/dist/html2canvas.esm.js';
6
+ import html2canvas from '../../node_modules/html2canvas/dist/html2canvas.esm.js';
7
7
 
8
8
  /**
9
9
  * The 3D Viewer at the heart of the xeokit SDK.
@@ -103,6 +103,9 @@ class CameraUpdater {
103
103
  }
104
104
  }
105
105
  }
106
+ } else {
107
+ dollyDistFactor = 1;
108
+ followPointerWorldPos = null;
106
109
  }
107
110
 
108
111
  const dollyDeltaForDist = (updates.dollyDelta * dollyDistFactor);
@@ -309,4 +312,4 @@ class CameraUpdater {
309
312
  }
310
313
  }
311
314
 
312
- export {CameraUpdater};
315
+ export {CameraUpdater};
@@ -860,7 +860,9 @@ export class DTXTrianglesLayer {
860
860
  // Color
861
861
 
862
862
  let f0;
863
- if (!visible || culled || xrayed) { // Highlight & select are layered on top of color - not mutually exclusive
863
+ if (!visible || culled || xrayed
864
+ || (highlighted && !this.model.scene.highlightMaterial.glowThrough)
865
+ || (selected && !this.model.scene.selectedMaterial.glowThrough)) {
864
866
  f0 = RENDER_PASSES.NOT_RENDERED;
865
867
  } else {
866
868
  if (transparent) {
@@ -1,5 +1,5 @@
1
1
  import {TrianglesBatchingRenderer} from "./TrianglesBatchingRenderer.js";
2
- import {EdgesRenderer} from "./EdgesRenderer";
2
+ import {EdgesRenderer} from "./EdgesRenderer.js";
3
3
 
4
4
 
5
5
  /**
@@ -1,6 +1,6 @@
1
1
  import {Cache} from './Cache.js';
2
2
  import {Loader} from './Loader.js';
3
- import {core} from "../core";
3
+ import {core} from "../core.js";
4
4
 
5
5
  const loading = {};
6
6
 
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @private
3
3
  */
4
- import {core} from "./core";
4
+ import {core} from "./core.js";
5
5
 
6
6
  function xmlToJson(node, attributeRenamer) {
7
7
  if (node.nodeType === node.TEXT_NODE) {