Fixing handles displaying on arrow target tools

This commit is contained in:
Bruno Alves de Faria 2017-11-22 10:09:11 -02:00
parent cbc87aebf8
commit b42214d8ee
2 changed files with 16 additions and 10 deletions

View File

@ -19,7 +19,7 @@ var configuration = {
getMeasurementLocationCallback,
changeMeasurementLocationCallback,
drawHandles: false,
drawHandlesOnHover: false,
drawHandlesOnHover: true,
arrowFirst: true,
textBox: textBoxConfig
};

View File

@ -33,15 +33,21 @@ OHIF.lesiontracker.configureTargetToolsHandles = () => {
changeMeasurementLocationCallback: toggleLabel,
};
// TODO: Reconcile this with the configuration in toolManager
// it would be better to have this all in one place.
const bidirectionalConfig = cornerstoneTools.bidirectional.getConfiguration();
const config = Object.assign({}, bidirectionalConfig, callbackConfig);
// TODO: Reconcile this with the configuration in toolManager it would be better to have this
// all in one place.
const appendConfig = toolType => {
const tool = cornerstoneTools[toolType];
const toolConfig = tool.getConfiguration();
const config = Object.assign({}, toolConfig, callbackConfig);
cornerstoneTools.bidirectional.setConfiguration(config);
tool.setConfiguration(config);
};
// Set CR-Tool, UN-Tool, EX-Tool configurations
cornerstoneTools.targetCR.setConfiguration(config);
cornerstoneTools.targetUN.setConfiguration(config);
cornerstoneTools.targetEX.setConfiguration(config);
// Append the callback configuration to bidirectional tool
appendConfig('bidirectional');
// Append the callback configuration to CR, UN and EX tools
appendConfig('targetCR');
appendConfig('targetUN');
appendConfig('targetEX');
};