@cornerstonejs/tools 1.28.0 → 1.28.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.
- package/dist/cjs/stateManagement/annotation/config/ToolStyle.js +23 -18
- package/dist/cjs/stateManagement/annotation/config/ToolStyle.js.map +1 -1
- package/dist/esm/stateManagement/annotation/config/ToolStyle.js +23 -18
- package/dist/esm/stateManagement/annotation/config/ToolStyle.js.map +1 -1
- package/dist/umd/index.js +1 -1
- package/dist/umd/index.js.map +1 -1
- package/package.json +3 -3
- package/src/stateManagement/annotation/config/ToolStyle.ts +33 -18
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cornerstonejs/tools",
|
|
3
|
-
"version": "1.28.
|
|
3
|
+
"version": "1.28.2",
|
|
4
4
|
"description": "Cornerstone3D Tools",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"types": "dist/esm/index.d.ts",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"webpack:watch": "webpack --mode development --progress --watch --config ./.webpack/webpack.dev.js"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@cornerstonejs/core": "^1.28.
|
|
32
|
+
"@cornerstonejs/core": "^1.28.2",
|
|
33
33
|
"lodash.clonedeep": "4.5.0",
|
|
34
34
|
"lodash.get": "^4.4.2"
|
|
35
35
|
},
|
|
@@ -52,5 +52,5 @@
|
|
|
52
52
|
"type": "individual",
|
|
53
53
|
"url": "https://ohif.org/donate"
|
|
54
54
|
},
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "dde6ed05ccc26a500ed7432c3afdf98a6dffdabf"
|
|
56
56
|
}
|
|
@@ -193,56 +193,71 @@ class ToolStyle {
|
|
|
193
193
|
toolName: string
|
|
194
194
|
) {
|
|
195
195
|
if (annotationUID) {
|
|
196
|
-
const
|
|
196
|
+
const annotationToolStyles = this.getAnnotationToolStyles(annotationUID);
|
|
197
197
|
|
|
198
|
-
if (
|
|
198
|
+
if (annotationToolStyles) {
|
|
199
199
|
// check first in the toolSpecific styles
|
|
200
|
-
if (
|
|
201
|
-
return
|
|
200
|
+
if (annotationToolStyles[property] !== undefined) {
|
|
201
|
+
return annotationToolStyles[property];
|
|
202
202
|
}
|
|
203
203
|
}
|
|
204
204
|
}
|
|
205
205
|
|
|
206
206
|
if (viewportId) {
|
|
207
|
-
const
|
|
207
|
+
const viewportToolStyles = this.getViewportToolStyles(viewportId);
|
|
208
208
|
|
|
209
|
-
if (
|
|
209
|
+
if (viewportToolStyles) {
|
|
210
210
|
// check if we have the viewportId specific style
|
|
211
211
|
// check first in the toolSpecific styles
|
|
212
|
-
if (
|
|
213
|
-
|
|
212
|
+
if (
|
|
213
|
+
viewportToolStyles[toolName] &&
|
|
214
|
+
viewportToolStyles[toolName][property] !== undefined
|
|
215
|
+
) {
|
|
216
|
+
return viewportToolStyles[toolName][property];
|
|
214
217
|
}
|
|
215
218
|
|
|
216
219
|
// check if we have the style in the viewport specific global viewportSpecificStyles
|
|
217
|
-
if (
|
|
218
|
-
|
|
220
|
+
if (
|
|
221
|
+
viewportToolStyles.global &&
|
|
222
|
+
viewportToolStyles.global[property] !== undefined
|
|
223
|
+
) {
|
|
224
|
+
return viewportToolStyles.global[property];
|
|
219
225
|
}
|
|
220
226
|
}
|
|
221
227
|
}
|
|
222
228
|
|
|
223
229
|
if (toolGroupId) {
|
|
224
|
-
const
|
|
230
|
+
const toolGroupToolStyles = this.getToolGroupToolStyles(toolGroupId);
|
|
225
231
|
|
|
226
|
-
if (
|
|
232
|
+
if (toolGroupToolStyles) {
|
|
227
233
|
// check first in the toolSpecific styles
|
|
228
|
-
if (
|
|
229
|
-
|
|
234
|
+
if (
|
|
235
|
+
toolGroupToolStyles[toolName] &&
|
|
236
|
+
toolGroupToolStyles[toolName][property] !== undefined
|
|
237
|
+
) {
|
|
238
|
+
return toolGroupToolStyles[toolName][property];
|
|
230
239
|
}
|
|
231
240
|
|
|
232
241
|
// check if we have the style in the toolGroup specific global styles
|
|
233
|
-
if (
|
|
234
|
-
|
|
242
|
+
if (
|
|
243
|
+
toolGroupToolStyles.global &&
|
|
244
|
+
toolGroupToolStyles.global[property] !== undefined
|
|
245
|
+
) {
|
|
246
|
+
return toolGroupToolStyles.global[property];
|
|
235
247
|
}
|
|
236
248
|
}
|
|
237
249
|
}
|
|
238
250
|
|
|
239
251
|
const globalStyles = this.getDefaultToolStyles();
|
|
240
252
|
|
|
241
|
-
if (
|
|
253
|
+
if (
|
|
254
|
+
globalStyles[toolName] &&
|
|
255
|
+
globalStyles[toolName][property] !== undefined
|
|
256
|
+
) {
|
|
242
257
|
return globalStyles[toolName][property];
|
|
243
258
|
}
|
|
244
259
|
|
|
245
|
-
if (globalStyles.global && globalStyles.global[property]) {
|
|
260
|
+
if (globalStyles.global && globalStyles.global[property] !== undefined) {
|
|
246
261
|
return globalStyles.global[property];
|
|
247
262
|
}
|
|
248
263
|
}
|