Skip to content

Commit

Permalink
fix(annotation):The wrong annotation was being selected for common fr…
Browse files Browse the repository at this point in the history
…ameUID (#259)

* fix(annotation):The wrong annotation was being selected for common frameUID

* Small tweak to commit to be a bit more reliable for volume measurements

* fix(tools):getPointNearTool would throw an exception on volume viewport
  • Loading branch information
wayfarer3130 authored Oct 25, 2022
1 parent b4dd176 commit 4037314
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/tools/src/utilities/getAnnotationNearPoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,15 @@ function findAnnotationNearPointByTool(
enabledElement.viewport.element,
(tool.constructor as typeof BaseTool).toolName
);
const currentId = enabledElement.viewport?.getCurrentImageId?.();
if (annotations?.length) {
const { element } = enabledElement.viewport;
for (const annotation of annotations) {
const referencedImageId = annotation.metadata?.referencedImageId;
if (currentId && referencedImageId && currentId !== referencedImageId) {
continue;
}

if (
tool.isPointNearTool(element, annotation, point, proximity, '') ||
tool.getHandleNearImagePoint(element, annotation, point, proximity)
Expand Down

0 comments on commit 4037314

Please sign in to comment.