@cornerstonejs/tools 4.2.2 → 4.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import { state } from '../../store/state';
|
|
2
2
|
import { ToolModes } from '../../enums';
|
|
3
3
|
import filterToolsWithAnnotationsForElement from '../../store/filterToolsWithAnnotationsForElement';
|
|
4
|
-
import { getToolGroupForViewport } from '../../store/ToolGroupManager';
|
|
5
4
|
import getToolsWithModesForMouseEvent from '../shared/getToolsWithModesForMouseEvent';
|
|
6
5
|
import triggerAnnotationRender from '../../utilities/triggerAnnotationRender';
|
|
7
|
-
import { setCursorForElement } from '../../cursors';
|
|
8
|
-
import { getStyleProperty } from '../../stateManagement/annotation/config/helpers';
|
|
9
6
|
const { Active, Passive } = ToolModes;
|
|
10
7
|
export default function mouseMove(evt) {
|
|
11
8
|
if (state.isInteractingWithTool || state.isMultiPartToolActive) {
|
|
@@ -16,36 +13,17 @@ export default function mouseMove(evt) {
|
|
|
16
13
|
Passive,
|
|
17
14
|
]);
|
|
18
15
|
const eventDetail = evt.detail;
|
|
19
|
-
const { element
|
|
16
|
+
const { element } = eventDetail;
|
|
20
17
|
const toolsWithAnnotations = filterToolsWithAnnotationsForElement(element, activeAndPassiveTools);
|
|
21
18
|
const toolsWithoutAnnotations = activeAndPassiveTools.filter((tool) => {
|
|
22
19
|
const doesNotHaveAnnotations = !toolsWithAnnotations.some((toolAndAnnotation) => toolAndAnnotation.tool.getToolName() === tool.getToolName());
|
|
23
20
|
return doesNotHaveAnnotations;
|
|
24
21
|
});
|
|
25
22
|
let annotationsNeedToBeRedrawn = false;
|
|
26
|
-
let showCrosshairsCursor = false;
|
|
27
23
|
for (const { tool, annotations } of toolsWithAnnotations) {
|
|
28
24
|
if (typeof tool.mouseMoveCallback === 'function') {
|
|
29
25
|
annotationsNeedToBeRedrawn =
|
|
30
26
|
tool.mouseMoveCallback(evt, annotations) || annotationsNeedToBeRedrawn;
|
|
31
|
-
for (const annotation of annotations) {
|
|
32
|
-
showCrosshairsCursor =
|
|
33
|
-
!!tool.getHandleNearImagePoint(element, annotation, currentPoints.canvas, 6) || showCrosshairsCursor;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
const showGrabCursorEnabled = Boolean(getStyleProperty('showGrabCursor', {}));
|
|
38
|
-
if (showCrosshairsCursor && showGrabCursorEnabled) {
|
|
39
|
-
setCursorForElement(element, 'move');
|
|
40
|
-
}
|
|
41
|
-
else {
|
|
42
|
-
const toolGroup = getToolGroupForViewport(viewportId, renderingEngineId);
|
|
43
|
-
const activeTool = toolGroup?.getActivePrimaryMouseButtonTool();
|
|
44
|
-
if (activeTool) {
|
|
45
|
-
setCursorForElement(element, activeTool);
|
|
46
|
-
}
|
|
47
|
-
else {
|
|
48
|
-
setCursorForElement(element, 'default');
|
|
49
27
|
}
|
|
50
28
|
}
|
|
51
29
|
toolsWithoutAnnotations.forEach((tool) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
type Modes = '' | 'Active' | 'Passive' | 'Enabled';
|
|
2
2
|
type States = '' | 'Highlighted' | 'Selected' | 'Locked' | 'AutoGenerated';
|
|
3
|
-
type Properties = 'color' | 'colorAutoGenerated' | 'lineWidth' | 'lineWidthAutoGenerated' | 'lineDash' | 'textBoxFontFamily' | 'textBoxFontSize' | 'textBoxColor' | 'textBoxBackground' | 'textBoxLinkLineWidth' | 'textBoxLinkLineDash' | 'locked' | 'fillColor' | 'fillOpacity' | 'textbox' | 'shadow' | 'visibility' | 'markerSize' | 'angleArcLineDash' | 'pointerStrokeWidth' | 'showHandlesAlways'
|
|
3
|
+
type Properties = 'color' | 'colorAutoGenerated' | 'lineWidth' | 'lineWidthAutoGenerated' | 'lineDash' | 'textBoxFontFamily' | 'textBoxFontSize' | 'textBoxColor' | 'textBoxBackground' | 'textBoxLinkLineWidth' | 'textBoxLinkLineDash' | 'locked' | 'fillColor' | 'fillOpacity' | 'textbox' | 'shadow' | 'visibility' | 'markerSize' | 'angleArcLineDash' | 'pointerStrokeWidth' | 'showHandlesAlways';
|
|
4
4
|
export type AnnotationStyle = {
|
|
5
5
|
[key in `${Properties}${States}${Modes}`]?: string | number | boolean | Record<string, unknown>;
|
|
6
6
|
};
|
package/dist/esm/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "4.2.
|
|
1
|
+
export declare const version = "4.2.4";
|
package/dist/esm/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '4.2.
|
|
1
|
+
export const version = '4.2.4';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cornerstonejs/tools",
|
|
3
|
-
"version": "4.2.
|
|
3
|
+
"version": "4.2.4",
|
|
4
4
|
"description": "Cornerstone3D Tools",
|
|
5
5
|
"types": "./dist/esm/index.d.ts",
|
|
6
6
|
"module": "./dist/esm/index.js",
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
"canvas": "^3.1.0"
|
|
109
109
|
},
|
|
110
110
|
"peerDependencies": {
|
|
111
|
-
"@cornerstonejs/core": "^4.2.
|
|
111
|
+
"@cornerstonejs/core": "^4.2.4",
|
|
112
112
|
"@kitware/vtk.js": "32.12.1",
|
|
113
113
|
"@types/d3-array": "^3.0.4",
|
|
114
114
|
"@types/d3-interpolate": "^3.0.1",
|
|
@@ -127,5 +127,5 @@
|
|
|
127
127
|
"type": "individual",
|
|
128
128
|
"url": "https://ohif.org/donate"
|
|
129
129
|
},
|
|
130
|
-
"gitHead": "
|
|
130
|
+
"gitHead": "6c47c1ba0dc3307bde44ea13b6adaedaec001825"
|
|
131
131
|
}
|