Updates for bidirectional tool

This commit is contained in:
Erik Ziegler 2016-11-16 17:21:30 +01:00
parent 70aa9e9012
commit dc813d1985
2 changed files with 4 additions and 33 deletions

View File

@ -675,25 +675,6 @@
});
}
// Get appropriate cursor for element.
// @param {Object} toolDataItem Data item returned by getToolState method of cornerstoneTools
function getAppropriateCursor(toolDataItem) {
var handle,
handles = toolDataItem.handles,
cursor = '';
for (handle in handles) {
handle = handles[handle];
if (handle.active === true && handle.hasBoundingBox === false) {
cursor = 'cell';
break;
}
}
return cursor;
}
//****************************************/
// Cornerstone Methods
//****************************************/
@ -970,7 +951,7 @@
var context = eventData.canvasContext.canvas.getContext('2d');
context.setTransform(1, 0, 0, 1, 0, 0);
var color, cursor = '';
var color;
var element = eventData.element;
var lineWidth = cornerstoneTools.toolStyle.getToolWidth();
var config = cornerstoneTools.bidirectional.getConfiguration();
@ -990,10 +971,6 @@
if (data.active) {
color = cornerstoneTools.toolColors.getActiveColor();
// increase line width of active tool...
strokeWidth *= 1.5;
// get appropriate cursor for current context
cursor = getAppropriateCursor(data) || 'move';
} else {
color = cornerstoneTools.toolColors.getToolColor();
}
@ -1106,12 +1083,6 @@
context.restore();
}
// update element cursor
if (element.style.cursor !== cursor) {
element.style.cursor = cursor;
}
}
function doubleClickCallback(e, eventData) {

View File

@ -48,10 +48,10 @@ function configureTools() {
// Set shadow configuration for length and bidirectional text boxes
const shadowConfig = {
shadow: true,
shadow: false,
shadowColor: '#000000',
shadowOffsetX: 1,
shadowOffsetY: 1
shadowOffsetX: 0,
shadowOffsetY: 0
};
// Get some tools config to not override them