@cornerstonejs/tools 1.51.3 → 1.51.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cornerstonejs/tools",
3
- "version": "1.51.3",
3
+ "version": "1.51.5",
4
4
  "description": "Cornerstone3D Tools",
5
5
  "main": "src/index.ts",
6
6
  "types": "dist/types/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.51.3",
32
+ "@cornerstonejs/core": "^1.51.5",
33
33
  "comlink": "^4.4.1",
34
34
  "lodash.clonedeep": "4.5.0",
35
35
  "lodash.get": "^4.4.2"
@@ -53,5 +53,5 @@
53
53
  "type": "individual",
54
54
  "url": "https://ohif.org/donate"
55
55
  },
56
- "gitHead": "4e5375073e56c616d6fdcee5a094d66d5b35dc1d"
56
+ "gitHead": "8ed54955b6c0c04818954dabb9a1d22d1bf4360e"
57
57
  }
@@ -42,6 +42,8 @@ class MagnifyTool extends BaseTool {
42
42
  super(toolProps, defaultToolProps);
43
43
  }
44
44
 
45
+ private _hasBeenRemoved = false;
46
+
45
47
  _getReferencedImageId(
46
48
  viewport: Types.IStackViewport | Types.IVolumeViewport
47
49
  ): string {
@@ -155,8 +157,10 @@ class MagnifyTool extends BaseTool {
155
157
  const magnifyViewport = renderingEngine.getViewport(
156
158
  MAGNIFY_VIEWPORT_ID
157
159
  ) as Types.IStackViewport;
158
-
159
160
  magnifyViewport.setStack([referencedImageId]).then(() => {
161
+ if (this._hasBeenRemoved) {
162
+ return;
163
+ }
160
164
  // match the original viewport voi range
161
165
  magnifyViewport.setProperties(viewportProperties);
162
166
 
@@ -261,10 +265,12 @@ class MagnifyTool extends BaseTool {
261
265
 
262
266
  this._deactivateDraw(element);
263
267
  resetElementCursor(element);
268
+ this._hasBeenRemoved = true;
264
269
  };
265
270
 
266
271
  _activateDraw = (element: HTMLDivElement) => {
267
272
  state.isInteractingWithTool = true;
273
+ this._hasBeenRemoved = false;
268
274
 
269
275
  element.addEventListener(
270
276
  Events.MOUSE_UP,