From d0376016fc89df016eb1d0fecf3c029629a400d8 Mon Sep 17 00:00:00 2001 From: alex-stout <17804548+alex-stout@users.noreply.github.com> Date: Fri, 6 Dec 2024 11:00:31 -0700 Subject: [PATCH] fix(LengthTool): _dragCallback element reference --- packages/tools/src/tools/annotation/LengthTool.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/tools/src/tools/annotation/LengthTool.ts b/packages/tools/src/tools/annotation/LengthTool.ts index a2c5ec322..68f93d1fe 100644 --- a/packages/tools/src/tools/annotation/LengthTool.ts +++ b/packages/tools/src/tools/annotation/LengthTool.ts @@ -430,7 +430,6 @@ class LengthTool extends AnnotationTool { _dragCallback = (evt: EventTypes.InteractionEventType): void => { this.isDrawing = true; const eventDetail = evt.detail; - const { element } = eventDetail; const { annotation, @@ -441,7 +440,7 @@ class LengthTool extends AnnotationTool { } = this.editData; const { data } = annotation; - this.createMemo(element, annotation, { newAnnotation }); + this.createMemo(eventDetail.element, annotation, { newAnnotation }); if (movingTextBox) { // Drag mode - moving text box @@ -836,7 +835,7 @@ class LengthTool extends AnnotationTool { return Math.sqrt(dx * dx + dy * dy + dz * dz); } - _calculateCachedStats(annotation, renderingEngine, enabledElement) { + _calculateCachedStats(annotation, _, enabledElement) { const data = annotation.data; const { element } = enabledElement.viewport; @@ -893,7 +892,7 @@ class LengthTool extends AnnotationTool { return cachedStats; } - _isInsideVolume(index1, index2, dimensions) { + _isInsideVolume(index1, index2, dimensions): boolean { return ( csUtils.indexWithinDimensions(index1, dimensions) && csUtils.indexWithinDimensions(index2, dimensions)