Skip to content

Commit

Permalink
Rebuild
Browse files Browse the repository at this point in the history
  • Loading branch information
xeolabs committed Mar 4, 2024
1 parent 2d4d83d commit 1a1cf0e
Show file tree
Hide file tree
Showing 6 changed files with 74 additions and 59 deletions.
55 changes: 31 additions & 24 deletions dist/xeokit-sdk.cjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -12068,7 +12068,9 @@ class AngleMeasurementsMouseControl extends AngleMeasurementsControl {
markerDiv.style.borderRadius = "10px";
markerDiv.style.width = "5px";
markerDiv.style.height = "5px";
markerDiv.style.margin = "-200px -200px";
markerDiv.style.top = "-200px";
markerDiv.style.left = "-200px";
markerDiv.style.margin = "0 0";
markerDiv.style.zIndex = "100";
markerDiv.style.position = "absolute";
markerDiv.style.pointerEvents = "none";
Expand Down Expand Up @@ -12202,8 +12204,8 @@ class AngleMeasurementsMouseControl extends AngleMeasurementsControl {
const scrollTop = window.pageYOffset || document.documentElement.scrollTop;
const canvasLeftEdge = canvasBoundRect.left + scrollLeft;
const canvasTopEdge = canvasBoundRect.top + scrollTop;
this.markerDiv.style.marginLeft = `${canvasLeftEdge + canvasPos[0] - 5}px`;
this.markerDiv.style.marginTop = `${canvasTopEdge + canvasPos[1] - 5}px`;
this.markerDiv.style.left = `${canvasLeftEdge + canvasPos[0] - 5}px`;
this.markerDiv.style.top = `${canvasTopEdge + canvasPos[1] - 5}px`;
break;
case MOUSE_FINDING_CORNER:
if (this._currentAngleMeasurement) {
Expand All @@ -12214,8 +12216,8 @@ class AngleMeasurementsMouseControl extends AngleMeasurementsControl {
this._currentAngleMeasurement.corner.worldPos = event.worldPos;
this._currentAngleMeasurement.corner.entity = event.entity;
}
this.markerDiv.style.marginLeft = `-10000px`;
this.markerDiv.style.marginTop = `-10000px`;
this.markerDiv.style.left = `-10000px`;
this.markerDiv.style.top = `-10000px`;
canvas.style.cursor = "pointer";
break;
case MOUSE_FINDING_TARGET:
Expand All @@ -12226,8 +12228,8 @@ class AngleMeasurementsMouseControl extends AngleMeasurementsControl {
this._currentAngleMeasurement.target.worldPos = event.worldPos;
this._currentAngleMeasurement.target.entity = event.entity;
}
this.markerDiv.style.marginLeft = `-10000px`;
this.markerDiv.style.marginTop = `-10000px`;
this.markerDiv.style.left = `-10000px`;
this.markerDiv.style.top = `-10000px`;
canvas.style.cursor = "pointer";
break;
}
Expand Down Expand Up @@ -12328,8 +12330,8 @@ class AngleMeasurementsMouseControl extends AngleMeasurementsControl {
pointerLens.snappedCanvasPos = event.snappedCanvasPos || event.canvasPos;
pointerLens.snapped = false;
}
this.markerDiv.style.marginLeft = `-100px`;
this.markerDiv.style.marginTop = `-100px`;
this.markerDiv.style.left = `-100px`;
this.markerDiv.style.top = `-100px`;
if (this._currentAngleMeasurement) {
switch (this._mouseState) {
case MOUSE_FINDING_ORIGIN:
Expand Down Expand Up @@ -85874,7 +85876,9 @@ class DistanceMeasurementsMouseControl extends DistanceMeasurementsControl {
markerDiv.style.borderRadius = "10px";
markerDiv.style.width = "5px";
markerDiv.style.height = "5px";
markerDiv.style.margin = "-200px -200px";
markerDiv.style.top = "-200px";
markerDiv.style.left = "-200px";
markerDiv.style.margin = "0 0";
markerDiv.style.zIndex = "100";
markerDiv.style.position = "absolute";
markerDiv.style.pointerEvents = "none";
Expand Down Expand Up @@ -85980,20 +85984,23 @@ class DistanceMeasurementsMouseControl extends DistanceMeasurementsControl {
this._snapping
? "hoverSnapOrSurface"
: "hoverSurface", event => {
const canvasPos = event.snappedCanvasPos || event.canvasPos;
const canvasPos = event.snappedCanvasPos ||event.canvasPos;
mouseHovering = true;
pointerWorldPos.set(event.worldPos);
pointerCanvasPos.set(event.canvasPos);
if (this._mouseState === MOUSE_FIRST_CLICK_EXPECTED) {


// const canvasBoundary = getCanvasBoundary();

const canvasBoundRect = canvas.getBoundingClientRect();
const scrollLeft = window.pageXOffset || document.documentElement.scrollLeft;
const scrollTop = window.pageYOffset || document.documentElement.scrollTop;
const canvasLeftEdge = canvasBoundRect.left + scrollLeft;
const canvasTopEdge = canvasBoundRect.top + scrollTop;

this._markerDiv.style.marginLeft = `${canvasLeftEdge + canvasPos[0] - 5}px`;
this._markerDiv.style.marginTop = `${canvasTopEdge + canvasPos[1] - 5}px`;

this._markerDiv.style.left = `${canvasLeftEdge + canvasPos[0] - 5}px`;
this._markerDiv.style.top = `${canvasTopEdge + canvasPos[1] - 5}px`;

this._markerDiv.style.background = "pink";
if (event.snappedToVertex || event.snappedToEdge) {
if (this.pointerLens) {
Expand All @@ -86016,8 +86023,8 @@ class DistanceMeasurementsMouseControl extends DistanceMeasurementsControl {
}
hoveredEntity = event.entity;
} else {
this._markerDiv.style.marginLeft = `-10000px`;
this._markerDiv.style.marginTop = `-10000px`;
this._markerDiv.style.left = `-10000px`;
this._markerDiv.style.top = `-10000px`;
}
canvas.style.cursor = "pointer";
if (this._currentDistanceMeasurement) {
Expand All @@ -86028,8 +86035,8 @@ class DistanceMeasurementsMouseControl extends DistanceMeasurementsControl {
this._currentDistanceMeasurement.zAxisVisible = this._currentDistanceMeasurementInitState.zAxisVisible && this.distanceMeasurementsPlugin.defaultZAxisVisible;
this._currentDistanceMeasurement.targetVisible = this._currentDistanceMeasurementInitState.targetVisible;
this._currentDistanceMeasurement.target.worldPos = pointerWorldPos.slice();
this._markerDiv.style.marginLeft = `-10000px`;
this._markerDiv.style.marginTop = `-10000px`;
this._markerDiv.style.left = `-10000px`;
this._markerDiv.style.top = `-10000px`;
}
});

Expand Down Expand Up @@ -86100,8 +86107,8 @@ class DistanceMeasurementsMouseControl extends DistanceMeasurementsControl {
this.pointerLens.snappedCanvasPos = event.snappedCanvasPos || event.canvasPos;
}
mouseHovering = false;
this._markerDiv.style.marginLeft = `-100px`;
this._markerDiv.style.marginTop = `-100px`;
this._markerDiv.style.left = `-100px`;
this._markerDiv.style.top = `-100px`;
if (this._currentDistanceMeasurement) {
this._currentDistanceMeasurement.wireVisible = false;
this._currentDistanceMeasurement.targetVisible = false;
Expand Down Expand Up @@ -94360,9 +94367,9 @@ function getCanvasPosFromEvent$2(event, canvas, canvasPos) {
canvasPos[0] = event.x;
canvasPos[1] = event.y;
} else {
const { x, y } = canvas.getBoundingClientRect();
canvasPos[0] = event.clientX - x;
canvasPos[1] = event.clientY - y;
const { left, top } = canvas.getBoundingClientRect();
canvasPos[0] = event.clientX - left - window.scrollX;
canvasPos[1] = event.clientY - top - window.scrollY;
}
return canvasPos;
}
Expand Down
55 changes: 31 additions & 24 deletions dist/xeokit-sdk.es.js
Original file line number Diff line number Diff line change
Expand Up @@ -12064,7 +12064,9 @@ class AngleMeasurementsMouseControl extends AngleMeasurementsControl {
markerDiv.style.borderRadius = "10px";
markerDiv.style.width = "5px";
markerDiv.style.height = "5px";
markerDiv.style.margin = "-200px -200px";
markerDiv.style.top = "-200px";
markerDiv.style.left = "-200px";
markerDiv.style.margin = "0 0";
markerDiv.style.zIndex = "100";
markerDiv.style.position = "absolute";
markerDiv.style.pointerEvents = "none";
Expand Down Expand Up @@ -12198,8 +12200,8 @@ class AngleMeasurementsMouseControl extends AngleMeasurementsControl {
const scrollTop = window.pageYOffset || document.documentElement.scrollTop;
const canvasLeftEdge = canvasBoundRect.left + scrollLeft;
const canvasTopEdge = canvasBoundRect.top + scrollTop;
this.markerDiv.style.marginLeft = `${canvasLeftEdge + canvasPos[0] - 5}px`;
this.markerDiv.style.marginTop = `${canvasTopEdge + canvasPos[1] - 5}px`;
this.markerDiv.style.left = `${canvasLeftEdge + canvasPos[0] - 5}px`;
this.markerDiv.style.top = `${canvasTopEdge + canvasPos[1] - 5}px`;
break;
case MOUSE_FINDING_CORNER:
if (this._currentAngleMeasurement) {
Expand All @@ -12210,8 +12212,8 @@ class AngleMeasurementsMouseControl extends AngleMeasurementsControl {
this._currentAngleMeasurement.corner.worldPos = event.worldPos;
this._currentAngleMeasurement.corner.entity = event.entity;
}
this.markerDiv.style.marginLeft = `-10000px`;
this.markerDiv.style.marginTop = `-10000px`;
this.markerDiv.style.left = `-10000px`;
this.markerDiv.style.top = `-10000px`;
canvas.style.cursor = "pointer";
break;
case MOUSE_FINDING_TARGET:
Expand All @@ -12222,8 +12224,8 @@ class AngleMeasurementsMouseControl extends AngleMeasurementsControl {
this._currentAngleMeasurement.target.worldPos = event.worldPos;
this._currentAngleMeasurement.target.entity = event.entity;
}
this.markerDiv.style.marginLeft = `-10000px`;
this.markerDiv.style.marginTop = `-10000px`;
this.markerDiv.style.left = `-10000px`;
this.markerDiv.style.top = `-10000px`;
canvas.style.cursor = "pointer";
break;
}
Expand Down Expand Up @@ -12324,8 +12326,8 @@ class AngleMeasurementsMouseControl extends AngleMeasurementsControl {
pointerLens.snappedCanvasPos = event.snappedCanvasPos || event.canvasPos;
pointerLens.snapped = false;
}
this.markerDiv.style.marginLeft = `-100px`;
this.markerDiv.style.marginTop = `-100px`;
this.markerDiv.style.left = `-100px`;
this.markerDiv.style.top = `-100px`;
if (this._currentAngleMeasurement) {
switch (this._mouseState) {
case MOUSE_FINDING_ORIGIN:
Expand Down Expand Up @@ -85870,7 +85872,9 @@ class DistanceMeasurementsMouseControl extends DistanceMeasurementsControl {
markerDiv.style.borderRadius = "10px";
markerDiv.style.width = "5px";
markerDiv.style.height = "5px";
markerDiv.style.margin = "-200px -200px";
markerDiv.style.top = "-200px";
markerDiv.style.left = "-200px";
markerDiv.style.margin = "0 0";
markerDiv.style.zIndex = "100";
markerDiv.style.position = "absolute";
markerDiv.style.pointerEvents = "none";
Expand Down Expand Up @@ -85976,20 +85980,23 @@ class DistanceMeasurementsMouseControl extends DistanceMeasurementsControl {
this._snapping
? "hoverSnapOrSurface"
: "hoverSurface", event => {
const canvasPos = event.snappedCanvasPos || event.canvasPos;
const canvasPos = event.snappedCanvasPos ||event.canvasPos;
mouseHovering = true;
pointerWorldPos.set(event.worldPos);
pointerCanvasPos.set(event.canvasPos);
if (this._mouseState === MOUSE_FIRST_CLICK_EXPECTED) {


// const canvasBoundary = getCanvasBoundary();

const canvasBoundRect = canvas.getBoundingClientRect();
const scrollLeft = window.pageXOffset || document.documentElement.scrollLeft;
const scrollTop = window.pageYOffset || document.documentElement.scrollTop;
const canvasLeftEdge = canvasBoundRect.left + scrollLeft;
const canvasTopEdge = canvasBoundRect.top + scrollTop;

this._markerDiv.style.marginLeft = `${canvasLeftEdge + canvasPos[0] - 5}px`;
this._markerDiv.style.marginTop = `${canvasTopEdge + canvasPos[1] - 5}px`;

this._markerDiv.style.left = `${canvasLeftEdge + canvasPos[0] - 5}px`;
this._markerDiv.style.top = `${canvasTopEdge + canvasPos[1] - 5}px`;

this._markerDiv.style.background = "pink";
if (event.snappedToVertex || event.snappedToEdge) {
if (this.pointerLens) {
Expand All @@ -86012,8 +86019,8 @@ class DistanceMeasurementsMouseControl extends DistanceMeasurementsControl {
}
hoveredEntity = event.entity;
} else {
this._markerDiv.style.marginLeft = `-10000px`;
this._markerDiv.style.marginTop = `-10000px`;
this._markerDiv.style.left = `-10000px`;
this._markerDiv.style.top = `-10000px`;
}
canvas.style.cursor = "pointer";
if (this._currentDistanceMeasurement) {
Expand All @@ -86024,8 +86031,8 @@ class DistanceMeasurementsMouseControl extends DistanceMeasurementsControl {
this._currentDistanceMeasurement.zAxisVisible = this._currentDistanceMeasurementInitState.zAxisVisible && this.distanceMeasurementsPlugin.defaultZAxisVisible;
this._currentDistanceMeasurement.targetVisible = this._currentDistanceMeasurementInitState.targetVisible;
this._currentDistanceMeasurement.target.worldPos = pointerWorldPos.slice();
this._markerDiv.style.marginLeft = `-10000px`;
this._markerDiv.style.marginTop = `-10000px`;
this._markerDiv.style.left = `-10000px`;
this._markerDiv.style.top = `-10000px`;
}
});

Expand Down Expand Up @@ -86096,8 +86103,8 @@ class DistanceMeasurementsMouseControl extends DistanceMeasurementsControl {
this.pointerLens.snappedCanvasPos = event.snappedCanvasPos || event.canvasPos;
}
mouseHovering = false;
this._markerDiv.style.marginLeft = `-100px`;
this._markerDiv.style.marginTop = `-100px`;
this._markerDiv.style.left = `-100px`;
this._markerDiv.style.top = `-100px`;
if (this._currentDistanceMeasurement) {
this._currentDistanceMeasurement.wireVisible = false;
this._currentDistanceMeasurement.targetVisible = false;
Expand Down Expand Up @@ -94356,9 +94363,9 @@ function getCanvasPosFromEvent$2(event, canvas, canvasPos) {
canvasPos[0] = event.x;
canvasPos[1] = event.y;
} else {
const { x, y } = canvas.getBoundingClientRect();
canvasPos[0] = event.clientX - x;
canvasPos[1] = event.clientY - y;
const { left, top } = canvas.getBoundingClientRect();
canvasPos[0] = event.clientX - left - window.scrollX;
canvasPos[1] = event.clientY - top - window.scrollY;
}
return canvasPos;
}
Expand Down
Loading

0 comments on commit 1a1cf0e

Please sign in to comment.