Skip to content

Commit

Permalink
Rebuild
Browse files Browse the repository at this point in the history
  • Loading branch information
xeolabs committed Apr 9, 2024
1 parent eaff52f commit 587b9cc
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 20 deletions.
31 changes: 26 additions & 5 deletions dist/xeokit-sdk.cjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -12029,13 +12029,16 @@ class AngleMeasurementsMouseControl extends AngleMeasurementsControl {
*
* @param {AngleMeasurementsPlugin} angleMeasurementsPlugin The AngleMeasurementsPlugin to control.
* @param {*} [cfg] Configuration
* @param {function} [cfg.canvasToPagePos] Optional function to map canvas-space coordinates to page coordinates.
* @param {PointerLens} [cfg.pointerLens] A PointerLens to use to provide a magnified view of the cursor when snapping is enabled.
* @param {boolean} [cfg.snapping=true] Whether to initially enable snap-to-vertex and snap-to-edge for this AngleMeasurementsMouseControl.
*/
constructor(angleMeasurementsPlugin, cfg = {}) {

super(angleMeasurementsPlugin.viewer.scene);

this._canvasToPagePos = cfg.canvasToPagePos;

this.pointerLens = cfg.pointerLens;

this._active = false;
Expand Down Expand Up @@ -12174,6 +12177,8 @@ class AngleMeasurementsMouseControl extends AngleMeasurementsControl {
const getTop = el => el.offsetTop + (el.offsetParent && getTop(el.offsetParent));
const getLeft = el => el.offsetLeft + (el.offsetParent && getLeft(el.offsetParent));

const pagePos = math.vec2();

this._onMouseHoverSurface = cameraControl.on(
this._snapping
? "hoverSnapOrSurface"
Expand Down Expand Up @@ -12205,9 +12210,14 @@ class AngleMeasurementsMouseControl extends AngleMeasurementsControl {
mouseHoverCanvasPos.set(canvasPos);
switch (this._mouseState) {
case MOUSE_FINDING_ORIGIN:
this.markerDiv.style.left = `${getLeft(canvas) + canvasPos[0] - 5}px`;
this.markerDiv.style.top = `${getTop(canvas) + canvasPos[1] - 5}px`;

if (this._canvasToPagePos) {
this._canvasToPagePos(canvas, canvasPos, pagePos);
this.markerDiv.style.left = `${pagePos[0] - 5}px`;
this.markerDiv.style.top = `${pagePos[1] - 5}px`;
} else {
this.markerDiv.style.left = `${getLeft(canvas) + canvasPos[0] - 5}px`;
this.markerDiv.style.top = `${getTop(canvas) + canvasPos[1] - 5}px`;
}
break;
case MOUSE_FINDING_CORNER:
if (this._currentAngleMeasurement) {
Expand Down Expand Up @@ -85839,13 +85849,16 @@ class DistanceMeasurementsMouseControl extends DistanceMeasurementsControl {
*
* @param {DistanceMeasurementsPlugin} distanceMeasurementsPlugin The AngleMeasurementsPlugin to control.
* @param [cfg] Configuration
* @param {function} [cfg.canvasToPagePos] Optional function to map canvas-space coordinates to page coordinates.
* @param {PointerLens} [cfg.pointerLens] A PointerLens to use to provide a magnified view of the cursor when snapping is enabled.
* @param {boolean} [cfg.snapping=true] Whether to initially enable snap-to-vertex and snap-to-edge for this DistanceMeasurementsMouseControl.
*/
constructor(distanceMeasurementsPlugin, cfg = {}) {

super(distanceMeasurementsPlugin.viewer.scene);

this._canvasToPagePos = cfg.canvasToPagePos;

this.pointerLens = cfg.pointerLens;

this._active = false;
Expand Down Expand Up @@ -85992,6 +86005,8 @@ class DistanceMeasurementsMouseControl extends DistanceMeasurementsControl {
const getTop = el => el.offsetTop + (el.offsetParent && getTop(el.offsetParent));
const getLeft = el => el.offsetLeft + (el.offsetParent && getLeft(el.offsetParent));

const pagePos = math.vec2();

this._onCameraControlHoverSnapOrSurface = cameraControl.on(
this._snapping
? "hoverSnapOrSurface"
Expand All @@ -86002,8 +86017,14 @@ class DistanceMeasurementsMouseControl extends DistanceMeasurementsControl {
pointerCanvasPos.set(event.canvasPos);
if (this._mouseState === MOUSE_FIRST_CLICK_EXPECTED) {

this._markerDiv.style.left = `${getLeft(canvas) + canvasPos[0] - 5}px`;
this._markerDiv.style.top = `${getTop(canvas) + canvasPos[1] - 5}px`;
if (this._canvasToPagePos) {
this._canvasToPagePos(canvas, canvasPos, pagePos);
this._markerDiv.style.left = `${pagePos[0] - 5}px`;
this._markerDiv.style.top = `${pagePos[1] - 5}px`;
} else {
this._markerDiv.style.left = `${getLeft(canvas) + canvasPos[0] - 5}px`;
this._markerDiv.style.top = `${getTop(canvas) + canvasPos[1] - 5}px`;
}

this._markerDiv.style.background = "pink";
if (event.snappedToVertex || event.snappedToEdge) {
Expand Down
31 changes: 26 additions & 5 deletions dist/xeokit-sdk.es.js
Original file line number Diff line number Diff line change
Expand Up @@ -12025,13 +12025,16 @@ class AngleMeasurementsMouseControl extends AngleMeasurementsControl {
*
* @param {AngleMeasurementsPlugin} angleMeasurementsPlugin The AngleMeasurementsPlugin to control.
* @param {*} [cfg] Configuration
* @param {function} [cfg.canvasToPagePos] Optional function to map canvas-space coordinates to page coordinates.
* @param {PointerLens} [cfg.pointerLens] A PointerLens to use to provide a magnified view of the cursor when snapping is enabled.
* @param {boolean} [cfg.snapping=true] Whether to initially enable snap-to-vertex and snap-to-edge for this AngleMeasurementsMouseControl.
*/
constructor(angleMeasurementsPlugin, cfg = {}) {

super(angleMeasurementsPlugin.viewer.scene);

this._canvasToPagePos = cfg.canvasToPagePos;

this.pointerLens = cfg.pointerLens;

this._active = false;
Expand Down Expand Up @@ -12170,6 +12173,8 @@ class AngleMeasurementsMouseControl extends AngleMeasurementsControl {
const getTop = el => el.offsetTop + (el.offsetParent && getTop(el.offsetParent));
const getLeft = el => el.offsetLeft + (el.offsetParent && getLeft(el.offsetParent));

const pagePos = math.vec2();

this._onMouseHoverSurface = cameraControl.on(
this._snapping
? "hoverSnapOrSurface"
Expand Down Expand Up @@ -12201,9 +12206,14 @@ class AngleMeasurementsMouseControl extends AngleMeasurementsControl {
mouseHoverCanvasPos.set(canvasPos);
switch (this._mouseState) {
case MOUSE_FINDING_ORIGIN:
this.markerDiv.style.left = `${getLeft(canvas) + canvasPos[0] - 5}px`;
this.markerDiv.style.top = `${getTop(canvas) + canvasPos[1] - 5}px`;

if (this._canvasToPagePos) {
this._canvasToPagePos(canvas, canvasPos, pagePos);
this.markerDiv.style.left = `${pagePos[0] - 5}px`;
this.markerDiv.style.top = `${pagePos[1] - 5}px`;
} else {
this.markerDiv.style.left = `${getLeft(canvas) + canvasPos[0] - 5}px`;
this.markerDiv.style.top = `${getTop(canvas) + canvasPos[1] - 5}px`;
}
break;
case MOUSE_FINDING_CORNER:
if (this._currentAngleMeasurement) {
Expand Down Expand Up @@ -85835,13 +85845,16 @@ class DistanceMeasurementsMouseControl extends DistanceMeasurementsControl {
*
* @param {DistanceMeasurementsPlugin} distanceMeasurementsPlugin The AngleMeasurementsPlugin to control.
* @param [cfg] Configuration
* @param {function} [cfg.canvasToPagePos] Optional function to map canvas-space coordinates to page coordinates.
* @param {PointerLens} [cfg.pointerLens] A PointerLens to use to provide a magnified view of the cursor when snapping is enabled.
* @param {boolean} [cfg.snapping=true] Whether to initially enable snap-to-vertex and snap-to-edge for this DistanceMeasurementsMouseControl.
*/
constructor(distanceMeasurementsPlugin, cfg = {}) {

super(distanceMeasurementsPlugin.viewer.scene);

this._canvasToPagePos = cfg.canvasToPagePos;

this.pointerLens = cfg.pointerLens;

this._active = false;
Expand Down Expand Up @@ -85988,6 +86001,8 @@ class DistanceMeasurementsMouseControl extends DistanceMeasurementsControl {
const getTop = el => el.offsetTop + (el.offsetParent && getTop(el.offsetParent));
const getLeft = el => el.offsetLeft + (el.offsetParent && getLeft(el.offsetParent));

const pagePos = math.vec2();

this._onCameraControlHoverSnapOrSurface = cameraControl.on(
this._snapping
? "hoverSnapOrSurface"
Expand All @@ -85998,8 +86013,14 @@ class DistanceMeasurementsMouseControl extends DistanceMeasurementsControl {
pointerCanvasPos.set(event.canvasPos);
if (this._mouseState === MOUSE_FIRST_CLICK_EXPECTED) {

this._markerDiv.style.left = `${getLeft(canvas) + canvasPos[0] - 5}px`;
this._markerDiv.style.top = `${getTop(canvas) + canvasPos[1] - 5}px`;
if (this._canvasToPagePos) {
this._canvasToPagePos(canvas, canvasPos, pagePos);
this._markerDiv.style.left = `${pagePos[0] - 5}px`;
this._markerDiv.style.top = `${pagePos[1] - 5}px`;
} else {
this._markerDiv.style.left = `${getLeft(canvas) + canvasPos[0] - 5}px`;
this._markerDiv.style.top = `${getTop(canvas) + canvasPos[1] - 5}px`;
}

this._markerDiv.style.background = "pink";
if (event.snappedToVertex || event.snappedToEdge) {
Expand Down
Loading

0 comments on commit 587b9cc

Please sign in to comment.