@cornerstonejs/tools 4.1.1 → 4.1.2
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.
|
@@ -15,10 +15,11 @@ export default class SVGMouseCursor extends ImageMouseCursor {
|
|
|
15
15
|
}
|
|
16
16
|
const urn = getCursorURN(name, pointer, color);
|
|
17
17
|
let cursor = super.getDefinedCursor(urn);
|
|
18
|
+
const pointerStrokeWidth = Number(getStyleProperty('pointerStrokeWidth', {}));
|
|
18
19
|
if (!cursor) {
|
|
19
20
|
const descriptor = getDefinedSVGCursorDescriptor(name);
|
|
20
21
|
if (descriptor) {
|
|
21
|
-
cursor = createSVGMouseCursor(descriptor, urn, pointer, color, super.getDefinedCursor('default'));
|
|
22
|
+
cursor = createSVGMouseCursor(descriptor, urn, pointer, color, pointerStrokeWidth, super.getDefinedCursor('default'));
|
|
22
23
|
super.setDefinedCursor(urn, cursor);
|
|
23
24
|
}
|
|
24
25
|
}
|
|
@@ -36,9 +37,9 @@ function getCursorURN(name, pointer, color) {
|
|
|
36
37
|
const type = pointer ? 'pointer' : 'cursor';
|
|
37
38
|
return `${type}:${name}/${color}`;
|
|
38
39
|
}
|
|
39
|
-
function createSVGMouseCursor(descriptor, name, pointer, color, fallback) {
|
|
40
|
+
function createSVGMouseCursor(descriptor, name, pointer, color, pointerStrokeWidth, fallback) {
|
|
40
41
|
const { x, y } = descriptor.mousePoint;
|
|
41
|
-
return new SVGMouseCursor(createSVGIconUrl(descriptor, pointer, { color }), x, y, name, fallback);
|
|
42
|
+
return new SVGMouseCursor(createSVGIconUrl(descriptor, pointer, { color, pointerStrokeWidth }), x, y, name, fallback);
|
|
42
43
|
}
|
|
43
44
|
function createSVGIconUrl(descriptor, pointer, options) {
|
|
44
45
|
const blob = createSVGIconBlob(descriptor, pointer, options);
|
|
@@ -64,10 +65,11 @@ function createSVGIconWithPointer(descriptor, options) {
|
|
|
64
65
|
const { iconContent, iconSize, viewBox, mousePointerGroupString } = descriptor;
|
|
65
66
|
const scale = iconSize / Math.max(viewBox.x, viewBox.y, 1);
|
|
66
67
|
const svgSize = 16 + iconSize;
|
|
68
|
+
const pointerStrokeWidth = options.pointerStrokeWidth || 1;
|
|
67
69
|
const svgString = `
|
|
68
70
|
<svg data-icon="cursor" role="img" xmlns="http://www.w3.org/2000/svg"
|
|
69
71
|
width="${svgSize}" height="${svgSize}" viewBox="0 0 ${svgSize} ${svgSize}">
|
|
70
|
-
<g>${mousePointerGroupString}</g>
|
|
72
|
+
<g stroke-width="${pointerStrokeWidth}">${mousePointerGroupString}</g>
|
|
71
73
|
<g transform="translate(16, 16) scale(${scale})">${iconContent}</g>
|
|
72
74
|
</svg>`;
|
|
73
75
|
return format(svgString, options);
|
|
@@ -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';
|
|
3
|
+
type Properties = 'color' | 'colorAutoGenerated' | 'lineWidth' | 'lineWidthAutoGenerated' | 'lineDash' | 'textBoxFontFamily' | 'textBoxFontSize' | 'textBoxColor' | 'textBoxBackground' | 'textBoxLinkLineWidth' | 'textBoxLinkLineDash' | 'locked' | 'fillColor' | 'fillOpacity' | 'textbox' | 'shadow' | 'visibility' | 'markerSize' | 'angleArcLineDash' | 'pointerStrokeWidth';
|
|
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.1.
|
|
1
|
+
export declare const version = "4.1.2";
|
package/dist/esm/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '4.1.
|
|
1
|
+
export const version = '4.1.2';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cornerstonejs/tools",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.2",
|
|
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.1.
|
|
111
|
+
"@cornerstonejs/core": "^4.1.2",
|
|
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": "202e80927ba5c5fe96f50940bf6c0e2465cdc652"
|
|
131
131
|
}
|