@xeokit/xeokit-sdk 2.6.7 → 2.6.9

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.7",
3
+ "version": "2.6.9",
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",
@@ -193,8 +193,8 @@ export class AngleMeasurementsMouseControl extends AngleMeasurementsControl {
193
193
  const mouseHoverCanvasPos = math.vec2();
194
194
  this._currentAngleMeasurement = null;
195
195
 
196
- const getTop = el => el.offsetTop + (el.offsetParent && getTop(el.offsetParent));
197
- const getLeft = el => el.offsetLeft + (el.offsetParent && getLeft(el.offsetParent));
196
+ const getTop = el => el.offsetTop + (el.offsetParent && (el.offsetParent !== canvas.parentNode) && getTop(el.offsetParent));
197
+ const getLeft = el => el.offsetLeft + (el.offsetParent && (el.offsetParent !== canvas.parentNode) && getLeft(el.offsetParent));
198
198
 
199
199
  const pagePos = math.vec2();
200
200
 
@@ -199,8 +199,8 @@ export class DistanceMeasurementsMouseControl extends DistanceMeasurementsContro
199
199
 
200
200
  this._mouseState = MOUSE_FIRST_CLICK_EXPECTED;
201
201
 
202
- const getTop = el => el.offsetTop + (el.offsetParent && getTop(el.offsetParent));
203
- const getLeft = el => el.offsetLeft + (el.offsetParent && getLeft(el.offsetParent));
202
+ const getTop = el => el.offsetTop + (el.offsetParent && (el.offsetParent !== canvas.parentNode) && getTop(el.offsetParent));
203
+ const getLeft = el => el.offsetLeft + (el.offsetParent && (el.offsetParent !== canvas.parentNode) && getLeft(el.offsetParent));
204
204
 
205
205
  const pagePos = math.vec2();
206
206
 
@@ -1,4 +1,4 @@
1
- import { AngleMeasurementsControl } from "./AngleMeasurementsControl.js";
1
+ import {AngleMeasurementsControl} from "./AngleMeasurementsControl.js";
2
2
  import {AngleMeasurementsPlugin} from "./AngleMeasurementsPlugin";
3
3
  import {PointerLens} from "../../extras/";
4
4
 
@@ -42,11 +42,13 @@ export class AngleMeasurementsMouseControl extends AngleMeasurementsControl {
42
42
  * @param {AngleMeasurementsPlugin} angleMeasurementsPlugin The AngleMeasurementsPlugin to control.
43
43
  * @param {Object} [cfg] Configuration options.
44
44
  * @param {PointerLens} [cfg.pointerLens] A PointerLens to use for providing a magnified view of the cursor when snapping is enabled.
45
+ * @param {function} [cfg.canvasToPagePos] Optional function to map canvas-space coordinates to page coordinates.
45
46
  * @param {boolean} [cfg.snapping=true] Whether to initially enable snap-to-vertex and snap-to-edge for this AngleMeasurementsMouseControl.
46
47
  */
47
48
  constructor(angleMeasurementsPlugin: AngleMeasurementsPlugin, cfg?: {
48
49
  pointerLens?: PointerLens;
49
50
  snapping?: boolean;
51
+ canvasToPagePos? : Function;
50
52
  });
51
53
 
52
54
  /**
@@ -42,11 +42,13 @@ export class AngleMeasurementsTouchControl extends AngleMeasurementsControl {
42
42
  * @param {AngleMeasurementsPlugin} angleMeasurementsPlugin The AngleMeasurementsPlugin to control.
43
43
  * @param {Object} [cfg] Configuration options.
44
44
  * @param {PointerLens} [cfg.pointerLens] A PointerLens to use for providing a magnified view of the cursor when snapping is enabled.
45
+ * @param {function} [cfg.canvasToPagePos] Optional function to map canvas-space coordinates to page coordinates.
45
46
  * @param {boolean} [cfg.snapping=true] Whether to initially enable snap-to-vertex and snap-to-edge for this AngleMeasurementsTouchControl.
46
47
  */
47
48
  constructor(angleMeasurementsPlugin: AngleMeasurementsPlugin, cfg?: {
48
49
  pointerLens?: PointerLens;
49
50
  snapping?: boolean;
51
+ canvasToPagePos? : Function;
50
52
  });
51
53
 
52
54
  /**
@@ -21,11 +21,13 @@ export class DistanceMeasurementsMouseControl extends DistanceMeasurementsContro
21
21
  * @param {DistanceMeasurementsPlugin} distanceMeasurementsPlugin The DistanceMeasurementsPlugin to control.
22
22
  * @param {Object} cfg Configuration options.
23
23
  * @param {PointerLens} [cfg.pointerLens] A PointerLens to provide a magnified view of the cursor when snapping is enabled.
24
+ * @param {function} [cfg.canvasToPagePos] Optional function to map canvas-space coordinates to page coordinates.
24
25
  * @param {boolean} [cfg.snapping=true] Whether to enable snap-to-vertex and snap-to-edge for this DistanceMeasurementsMouseControl.
25
26
  */
26
27
  constructor(distanceMeasurementsPlugin: DistanceMeasurementsPlugin, cfg?: {
27
28
  pointerLens?: PointerLens;
28
29
  snapping?: boolean;
30
+ canvasToPagePos? : Function;
29
31
  });
30
32
 
31
33
  /**
@@ -20,11 +20,13 @@ export class DistanceMeasurementsTouchControl extends DistanceMeasurementsContro
20
20
  * @param {DistanceMeasurementsPlugin} distanceMeasurementsPlugin The DistanceMeasurementsPlugin to control.
21
21
  * @param {Object} cfg Configuration options.
22
22
  * @param {PointerLens} [cfg.pointerLens] A PointerLens to provide a magnified view of the cursor when snapping is enabled.
23
+ * @param {function} [cfg.canvasToPagePos] Optional function to map canvas-space coordinates to page coordinates.
23
24
  * @param {boolean} [cfg.snapping=true] Whether to enable snap-to-vertex and snap-to-edge for this DistanceMeasurementsTouchControl.
24
25
  */
25
26
  constructor(distanceMeasurementsPlugin: DistanceMeasurementsPlugin, cfg?: {
26
27
  pointerLens?: PointerLens;
27
28
  snapping?: boolean;
29
+ canvasToPagePos? : Function;
28
30
  });
29
31
 
30
32
  /**