Skip to content

Commit

Permalink
fix: fix setupEvents in LengthMeasurements when ui is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
TristanLecallier committed Dec 29, 2023
1 parent c671e18 commit 0d6e40d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/measurement/LengthMeasurement/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,9 @@ export class LengthMeasurement
}

private setupEvents(active: boolean) {
const viewerContainer = this.components.ui.viewerContainer;
const viewerContainer =
this.components.renderer.get().domElement.parentElement;
if (!viewerContainer) return;
if (active) {
viewerContainer.addEventListener("click", this.create);
window.addEventListener("keydown", this.onKeyDown);
Expand Down

0 comments on commit 0d6e40d

Please sign in to comment.