Updates for bidirectional tool
This commit is contained in:
parent
70aa9e9012
commit
dc813d1985
@ -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
|
// Cornerstone Methods
|
||||||
//****************************************/
|
//****************************************/
|
||||||
@ -970,7 +951,7 @@
|
|||||||
var context = eventData.canvasContext.canvas.getContext('2d');
|
var context = eventData.canvasContext.canvas.getContext('2d');
|
||||||
context.setTransform(1, 0, 0, 1, 0, 0);
|
context.setTransform(1, 0, 0, 1, 0, 0);
|
||||||
|
|
||||||
var color, cursor = '';
|
var color;
|
||||||
var element = eventData.element;
|
var element = eventData.element;
|
||||||
var lineWidth = cornerstoneTools.toolStyle.getToolWidth();
|
var lineWidth = cornerstoneTools.toolStyle.getToolWidth();
|
||||||
var config = cornerstoneTools.bidirectional.getConfiguration();
|
var config = cornerstoneTools.bidirectional.getConfiguration();
|
||||||
@ -990,10 +971,6 @@
|
|||||||
|
|
||||||
if (data.active) {
|
if (data.active) {
|
||||||
color = cornerstoneTools.toolColors.getActiveColor();
|
color = cornerstoneTools.toolColors.getActiveColor();
|
||||||
// increase line width of active tool...
|
|
||||||
strokeWidth *= 1.5;
|
|
||||||
// get appropriate cursor for current context
|
|
||||||
cursor = getAppropriateCursor(data) || 'move';
|
|
||||||
} else {
|
} else {
|
||||||
color = cornerstoneTools.toolColors.getToolColor();
|
color = cornerstoneTools.toolColors.getToolColor();
|
||||||
}
|
}
|
||||||
@ -1106,12 +1083,6 @@
|
|||||||
|
|
||||||
context.restore();
|
context.restore();
|
||||||
}
|
}
|
||||||
|
|
||||||
// update element cursor
|
|
||||||
if (element.style.cursor !== cursor) {
|
|
||||||
element.style.cursor = cursor;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function doubleClickCallback(e, eventData) {
|
function doubleClickCallback(e, eventData) {
|
||||||
|
|||||||
@ -48,10 +48,10 @@ function configureTools() {
|
|||||||
|
|
||||||
// Set shadow configuration for length and bidirectional text boxes
|
// Set shadow configuration for length and bidirectional text boxes
|
||||||
const shadowConfig = {
|
const shadowConfig = {
|
||||||
shadow: true,
|
shadow: false,
|
||||||
shadowColor: '#000000',
|
shadowColor: '#000000',
|
||||||
shadowOffsetX: 1,
|
shadowOffsetX: 0,
|
||||||
shadowOffsetY: 1
|
shadowOffsetY: 0
|
||||||
};
|
};
|
||||||
|
|
||||||
// Get some tools config to not override them
|
// Get some tools config to not override them
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user