[OHIF-295] - Esc button should stop the creation of a measurement or annotation (#1883)
* WIP, need to fix arrow making measurement * Update cornerstoneTools to fix cst arrow annotate event bug.
This commit is contained in:
1 parent
89cbe5bf2e
commit
ce40f04f2e
11 files changed
+38
-13
No files matched your search
@@ -79,6 +79,21 @@ const commandsModule = ({ servicesManager }) => {
|
||||
cornerstone.setViewport(enabledElement, viewport);
|
||||
}
|
||||
},
|
||||
cancelMeasurement: () => {
|
||||
const enabledElement = _getActiveViewportsEnabledElement();
|
||||
|
||||
if (enabledElement) {
|
||||
debugger;
|
||||
|
||||
const cancelActiveManipulatorsForElement = cornerstoneTools.getModule(
|
||||
'manipulatorState'
|
||||
).setters.cancelActiveManipulatorsForElement;
|
||||
|
||||
cancelActiveManipulatorsForElement(enabledElement);
|
||||
|
||||
cornerstone.updateImage(enabledElement);
|
||||
}
|
||||
},
|
||||
// TODO: this is receiving `evt` from `ToolbarRow`. We could use it to have
|
||||
// better mouseButtonMask sets.
|
||||
setToolActive: ({ toolName }) => {
|
||||
@@ -349,6 +364,11 @@ const commandsModule = ({ servicesManager }) => {
|
||||
storeContexts: [],
|
||||
options: {},
|
||||
},
|
||||
cancelMeasurement: {
|
||||
commandFn: actions.cancelMeasurement,
|
||||
storeContexts: [],
|
||||
options: {},
|
||||
},
|
||||
flipViewportVertical: {
|
||||
commandFn: actions.flipViewportVertical,
|
||||
storeContexts: [],
|
||||
|
||||
Reference in new issue
Block a user