Skip to content

Commit

Permalink
fix: 🐛 Fix ArrowAnnotate's event firing on complete/cancel (#1266)
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesAPetts authored Jul 8, 2020
1 parent 6693743 commit 0868812
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions src/tools/annotation/ArrowAnnotateTool.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
);
}
Expand Down

0 comments on commit 0868812

Please sign in to comment.