@cornerstonejs/tools 2.13.0 → 2.14.0

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.
@@ -25,7 +25,7 @@ declare class ProbeTool extends AnnotationTool {
25
25
  };
26
26
  };
27
27
  constructor(toolProps?: PublicToolProps, defaultToolProps?: any);
28
- isPointNearTool(): boolean;
28
+ isPointNearTool(element: HTMLDivElement, annotation: ProbeAnnotation, canvasCoords: Types.Point2, proximity: number): boolean;
29
29
  toolSelectedCallback(): void;
30
30
  static hydrate: (viewportId: string, points: Types.Point3[], options?: {
31
31
  annotationUID?: string;
@@ -163,7 +163,10 @@ class ProbeTool extends AnnotationTool {
163
163
  const point = data.handles.points[0];
164
164
  const canvasCoordinates = viewport.worldToCanvas(point);
165
165
  styleSpecifier.annotationUID = annotationUID;
166
- const { color } = this.getAnnotationStyle({ annotation, styleSpecifier });
166
+ const { color, lineWidth } = this.getAnnotationStyle({
167
+ annotation,
168
+ styleSpecifier,
169
+ });
167
170
  if (!data.cachedStats) {
168
171
  data.cachedStats = {};
169
172
  }
@@ -201,7 +204,7 @@ class ProbeTool extends AnnotationTool {
201
204
  return renderStatus;
202
205
  }
203
206
  const handleGroupUID = '0';
204
- drawHandlesSvg(svgDrawingHelper, annotationUID, handleGroupUID, [canvasCoordinates], { color });
207
+ drawHandlesSvg(svgDrawingHelper, annotationUID, handleGroupUID, [canvasCoordinates], { color, lineWidth });
205
208
  renderStatus = true;
206
209
  const options = this.getLinkedTextBoxStyle(styleSpecifier, annotation);
207
210
  if (!options.visibility) {
@@ -220,8 +223,13 @@ class ProbeTool extends AnnotationTool {
220
223
  return renderStatus;
221
224
  };
222
225
  }
223
- isPointNearTool() {
224
- return false;
226
+ isPointNearTool(element, annotation, canvasCoords, proximity) {
227
+ const enabledElement = getEnabledElement(element);
228
+ const { viewport } = enabledElement;
229
+ const { data } = annotation;
230
+ const point = data.handles.points[0];
231
+ const annotationCanvasCoordinate = viewport.worldToCanvas(point);
232
+ return vec2.distance(canvasCoords, annotationCanvasCoordinate) < proximity;
225
233
  }
226
234
  toolSelectedCallback() { }
227
235
  static { this.hydrate = (viewportId, points, options) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cornerstonejs/tools",
3
- "version": "2.13.0",
3
+ "version": "2.14.0",
4
4
  "description": "Cornerstone3D Tools",
5
5
  "types": "./dist/esm/index.d.ts",
6
6
  "module": "./dist/esm/index.js",
@@ -104,7 +104,7 @@
104
104
  "canvas": "^2.11.2"
105
105
  },
106
106
  "peerDependencies": {
107
- "@cornerstonejs/core": "^2.13.0",
107
+ "@cornerstonejs/core": "^2.14.0",
108
108
  "@kitware/vtk.js": "32.1.1",
109
109
  "@types/d3-array": "^3.0.4",
110
110
  "@types/d3-interpolate": "^3.0.1",
@@ -123,5 +123,5 @@
123
123
  "type": "individual",
124
124
  "url": "https://ohif.org/donate"
125
125
  },
126
- "gitHead": "dcac6b44a3c251f0e11da0fa3f43397626fae920"
126
+ "gitHead": "df90c42c63dc8392c9ebc2cdd953ee0dd1a974de"
127
127
  }