Skip to content

Commit

Permalink
fix(LengthTool): _dragCallback element reference
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-stout committed Dec 18, 2024
1 parent dcb9f77 commit d037601
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions packages/tools/src/tools/annotation/LengthTool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit d037601

Please sign in to comment.