From 0868812233c7b4ca83401586e5dca2ab356ece28 Mon Sep 17 00:00:00 2001 From: James Petts Date: Wed, 8 Jul 2020 10:51:26 +0100 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20Fix=20ArrowAnnotate's=20e?= =?UTF-8?q?vent=20firing=20on=20complete/cancel=20(#1266)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/tools/annotation/ArrowAnnotateTool.js | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/tools/annotation/ArrowAnnotateTool.js b/src/tools/annotation/ArrowAnnotateTool.js index 81f702cb6..444545477 100644 --- a/src/tools/annotation/ArrowAnnotateTool.js +++ b/src/tools/annotation/ArrowAnnotateTool.js @@ -289,20 +289,24 @@ export default class ArrowAnnotateTool extends BaseAnnotationTool { }); }, evt.detail); } + + const modifiedEventData = { + toolName: this.name, + toolType: this.name, // Deprecation notice: toolType will be replaced by toolName + element, + measurementData, + }; + + triggerEvent( + element, + EVENTS.MEASUREMENT_COMPLETED, + modifiedEventData + ); } else { removeToolState(element, this.name, measurementData); } external.cornerstone.updateImage(element); - - const modifiedEventData = { - toolName: this.name, - toolType: this.name, // Deprecation notice: toolType will be replaced by toolName - element, - measurementData, - }; - - triggerEvent(element, EVENTS.MEASUREMENT_COMPLETED, modifiedEventData); } ); }