From 24bca450ca2f348b6cc6201a8bd8950532ec82fd Mon Sep 17 00:00:00 2001 From: ladeirarodolfo <39910206+ladeirarodolfo@users.noreply.github.com> Date: Wed, 1 Apr 2020 02:41:50 -0300 Subject: [PATCH] feat: Ensure AngleTool and ArrowAnnotateTool fire MEASUREMENT_COMPLETED event (#1204) Co-authored-by: Rodolfo Ladeira Co-authored-by: Danny Brown --- src/tools/annotation/AngleTool.js | 12 ++++++++++++ src/tools/annotation/ArrowAnnotateTool.js | 7 +++++++ 2 files changed, 19 insertions(+) diff --git a/src/tools/annotation/AngleTool.js b/src/tools/annotation/AngleTool.js index b0e92eb31..daf2be54e 100644 --- a/src/tools/annotation/AngleTool.js +++ b/src/tools/annotation/AngleTool.js @@ -336,6 +336,18 @@ export default class AngleTool extends BaseAnnotationTool { } this.preventNewMeasurement = false; + external.cornerstone.updateImage(element); + + const modifiedEventData = { + toolType: this.name, + element, + measurementData, + }; + triggerEvent( + element, + EVENTS.MEASUREMENT_COMPLETED, + modifiedEventData + ); } ); } diff --git a/src/tools/annotation/ArrowAnnotateTool.js b/src/tools/annotation/ArrowAnnotateTool.js index 2dd627f4d..0db1fbffa 100644 --- a/src/tools/annotation/ArrowAnnotateTool.js +++ b/src/tools/annotation/ArrowAnnotateTool.js @@ -277,6 +277,13 @@ export default class ArrowAnnotateTool extends BaseAnnotationTool { } external.cornerstone.updateImage(element); + + const modifiedEventData = { + toolType: this.name, + element, + measurementData, + }; + triggerEvent(element, EVENTS.MEASUREMENT_COMPLETED, modifiedEventData); } ); }