Skip to content

Commit

Permalink
fix(viewer): only do measurement on canvas (#3636)
Browse files Browse the repository at this point in the history
  • Loading branch information
haakonflatval-cognite authored Aug 29, 2023
1 parent c289363 commit 1dae829
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions viewer/packages/tools/src/Measurement/MeasurementTool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -378,10 +378,12 @@ export class MeasurementTool extends Cognite3DViewerToolBase {
}

private async onPointerClick(event: MouseEvent): Promise<void> {
if (event.target === this._viewer.canvas) {
event.stopPropagation();
if (event.target !== this._viewer.canvas) {
return;
}

event.stopPropagation();

const { offsetX, offsetY } = event;

const intersection = await this._viewer.getIntersectionFromPixel(offsetX, offsetY);
Expand Down

0 comments on commit 1dae829

Please sign in to comment.