Skip to content

Commit

Permalink
Rebuild
Browse files Browse the repository at this point in the history
  • Loading branch information
xeolabs committed Mar 17, 2024
1 parent cfe905b commit 2861d6a
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 43 deletions.
29 changes: 12 additions & 17 deletions dist/xeokit-sdk.cjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -12170,6 +12170,10 @@ class AngleMeasurementsMouseControl extends AngleMeasurementsControl {
const mouseWorldPos = math.vec3();
const mouseHoverCanvasPos = math.vec2();
this._currentAngleMeasurement = null;

const getTop = el => el.offsetTop + (el.offsetParent && getTop(el.offsetParent));
const getLeft = el => el.offsetLeft + (el.offsetParent && getLeft(el.offsetParent));

this._onMouseHoverSurface = cameraControl.on(
this._snapping
? "hoverSnapOrSurface"
Expand Down Expand Up @@ -12201,13 +12205,9 @@ class AngleMeasurementsMouseControl extends AngleMeasurementsControl {
mouseHoverCanvasPos.set(canvasPos);
switch (this._mouseState) {
case MOUSE_FINDING_ORIGIN:
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.left = `${canvasLeftEdge + canvasPos[0] - 5}px`;
this.markerDiv.style.top = `${canvasTopEdge + canvasPos[1] - 5}px`;
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 @@ -85987,6 +85987,9 @@ class DistanceMeasurementsMouseControl extends DistanceMeasurementsControl {

this._mouseState = MOUSE_FIRST_CLICK_EXPECTED;

const getTop = el => el.offsetTop + (el.offsetParent && getTop(el.offsetParent));
const getLeft = el => el.offsetLeft + (el.offsetParent && getLeft(el.offsetParent));

this._onCameraControlHoverSnapOrSurface = cameraControl.on(
this._snapping
? "hoverSnapOrSurface"
Expand All @@ -85997,16 +86000,8 @@ class DistanceMeasurementsMouseControl extends DistanceMeasurementsControl {
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.left = `${canvasLeftEdge + canvasPos[0] - 5}px`;
this._markerDiv.style.top = `${canvasTopEdge + canvasPos[1] - 5}px`;
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
29 changes: 12 additions & 17 deletions dist/xeokit-sdk.es.js
Original file line number Diff line number Diff line change
Expand Up @@ -12166,6 +12166,10 @@ class AngleMeasurementsMouseControl extends AngleMeasurementsControl {
const mouseWorldPos = math.vec3();
const mouseHoverCanvasPos = math.vec2();
this._currentAngleMeasurement = null;

const getTop = el => el.offsetTop + (el.offsetParent && getTop(el.offsetParent));
const getLeft = el => el.offsetLeft + (el.offsetParent && getLeft(el.offsetParent));

this._onMouseHoverSurface = cameraControl.on(
this._snapping
? "hoverSnapOrSurface"
Expand Down Expand Up @@ -12197,13 +12201,9 @@ class AngleMeasurementsMouseControl extends AngleMeasurementsControl {
mouseHoverCanvasPos.set(canvasPos);
switch (this._mouseState) {
case MOUSE_FINDING_ORIGIN:
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.left = `${canvasLeftEdge + canvasPos[0] - 5}px`;
this.markerDiv.style.top = `${canvasTopEdge + canvasPos[1] - 5}px`;
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 @@ -85983,6 +85983,9 @@ class DistanceMeasurementsMouseControl extends DistanceMeasurementsControl {

this._mouseState = MOUSE_FIRST_CLICK_EXPECTED;

const getTop = el => el.offsetTop + (el.offsetParent && getTop(el.offsetParent));
const getLeft = el => el.offsetLeft + (el.offsetParent && getLeft(el.offsetParent));

this._onCameraControlHoverSnapOrSurface = cameraControl.on(
this._snapping
? "hoverSnapOrSurface"
Expand All @@ -85993,16 +85996,8 @@ class DistanceMeasurementsMouseControl extends DistanceMeasurementsControl {
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.left = `${canvasLeftEdge + canvasPos[0] - 5}px`;
this._markerDiv.style.top = `${canvasTopEdge + canvasPos[1] - 5}px`;
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 2861d6a

Please sign in to comment.