Skip to content

Commit

Permalink
fix: setup events in length measurements when ui is disabled (#241)
Browse files Browse the repository at this point in the history
  • Loading branch information
TristanLecallier authored Jan 2, 2024
1 parent ff3328a commit e54121a
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 e54121a

Please sign in to comment.