Skip to content

Commit

Permalink
distance measurement axis correction (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
robin-pham authored May 10, 2021
1 parent c8cbebe commit 182d7c3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/plugins/DistanceMeasurementsPlugin/DistanceMeasurement.js
Original file line number Diff line number Diff line change
Expand Up @@ -292,21 +292,21 @@ class DistanceMeasurement extends Component {
this._zAxisLabelCulled = (zAxisCanvasLength < labelMinAxisLength);

if (!this._xAxisLabelCulled) {
this._xAxisLabel.setText(Math.abs(this._targetWorld[0] - this._originWorld[0] * scale).toFixed(2) + unitAbbrev);
this._xAxisLabel.setText(Math.abs((this._targetWorld[0] - this._originWorld[0]) * scale).toFixed(2) + unitAbbrev);
this._xAxisLabel.setVisible(true);
} else {
this._xAxisLabel.setVisible(false);
}

if (!this._yAxisLabelCulled) {
this._yAxisLabel.setText(Math.abs(this._targetWorld[1] - this._originWorld[1] * scale).toFixed(2) + unitAbbrev);
this._yAxisLabel.setText(Math.abs((this._targetWorld[1] - this._originWorld[1]) * scale).toFixed(2) + unitAbbrev);
this._yAxisLabel.setVisible(true);
} else {
this._yAxisLabel.setVisible(false);
}

if (!this._zAxisLabelCulled) {
this._zAxisLabel.setText(Math.abs(this._targetWorld[2] - this._originWorld[2] * scale).toFixed(2) + unitAbbrev);
this._zAxisLabel.setText(Math.abs((this._targetWorld[2] - this._originWorld[2]) * scale).toFixed(2) + unitAbbrev);
this._zAxisLabel.setVisible(true);
} else {
this._zAxisLabel.setVisible(false);
Expand Down Expand Up @@ -514,4 +514,4 @@ class DistanceMeasurement extends Component {
}
}

export {DistanceMeasurement};
export {DistanceMeasurement};

0 comments on commit 182d7c3

Please sign in to comment.