Skip to content

Commit

Permalink
Fix disappearing measurement labels after zooming through model and b…
Browse files Browse the repository at this point in the history
…ack xeokit#999
  • Loading branch information
xeolabs committed Feb 2, 2023
1 parent 9b7f0c2 commit 02576b0
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/plugins/AngleMeasurementsPlugin/AngleMeasurement.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ class AngleMeasurement extends Component {

this._angleVisible = false;
this._labelsVisible = false;
this._clickable = true;
this._clickable = false;

this._originMarker.on("worldPos", (value) => {
this._originWorld.set(value || [0, 0, 0]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ class AngleMeasurementsPlugin extends Plugin {
this._onMouseOver = (event, measurement) => {
this.fire("mouseOver", {
plugin: this,
angleMeasurement: measurement,
measurement,
event
});
Expand All @@ -240,6 +241,7 @@ class AngleMeasurementsPlugin extends Plugin {
this._onMouseLeave = (event, measurement) => {
this.fire("mouseLeave", {
plugin: this,
angleMeasurement: measurement,
measurement,
event
});
Expand All @@ -248,6 +250,7 @@ class AngleMeasurementsPlugin extends Plugin {
this._onContextMenu = (event, measurement) => {
this.fire("contextMenu", {
plugin: this,
angleMeasurement: measurement,
measurement,
event
});
Expand Down
15 changes: 10 additions & 5 deletions src/plugins/DistanceMeasurementsPlugin/DistanceMeasurement.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ class DistanceMeasurement extends Component {
this._zAxisVisible = false;
this._axisEnabled = true;
this._labelsVisible = false;
this._clickable = true;
this._clickable = false;

this._originMarker.on("worldPos", (value) => {
this._originWorld.set(value || [0, 0, 0]);
Expand Down Expand Up @@ -291,10 +291,10 @@ class DistanceMeasurement extends Component {

if (vpz1 > near || vpz2 > near) {

this._xAxisLabel.setVisible(false);
this._yAxisLabel.setVisible(false);
this._zAxisLabel.setVisible(false);
this._lengthLabel.setVisible(false);
this._xAxisLabel.setCulled(true);
this._yAxisLabel.setCulled(true);
this._zAxisLabel.setCulled(true);
this._lengthLabel.setCulled(true);

this._xAxisWire.setVisible(false);
this._yAxisWire.setVisible(false);
Expand Down Expand Up @@ -398,6 +398,11 @@ class DistanceMeasurement extends Component {
}
}

// this._xAxisLabel.setVisible(this.axisVisible && this.xAxisVisible);
// this._yAxisLabel.setVisible(this.axisVisible && this.yAxisVisible);
// this._zAxisLabel.setVisible(this.axisVisible && this.zAxisVisible);
// this._lengthLabel.setVisible(false);

this._originDot.setVisible(this._visible && this._originVisible);
this._targetDot.setVisible(this._visible && this._targetVisible);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ class DistanceMeasurementsPlugin extends Plugin {
this._onMouseOver = (event, measurement) => {
this.fire("mouseOver", {
plugin: this,
distanceMeasurement: measurement,
measurement,
event
});
Expand All @@ -262,6 +263,7 @@ class DistanceMeasurementsPlugin extends Plugin {
this._onMouseLeave = (event, measurement) => {
this.fire("mouseLeave", {
plugin: this,
distanceMeasurement: measurement,
measurement,
event
});
Expand All @@ -270,6 +272,7 @@ class DistanceMeasurementsPlugin extends Plugin {
this._onContextMenu = (event, measurement) => {
this.fire("contextMenu", {
plugin: this,
distanceMeasurement: measurement,
measurement,
event
});
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/lib/html/Dot.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class Dot {
dotStyle.left = 0 + "px";
dotStyle["box-shadow"] = "0 2px 5px 0 #182A3D;";
dotStyle["opacity"] = 1.0;
dotStyle["pointer-events"] = "none";
dotStyle["pointer-events"] = "all";
if (cfg.onContextMenu) {
// dotStyle["cursor"] = "context-menu";
}
Expand Down

0 comments on commit 02576b0

Please sign in to comment.