Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Can't render ScaleOverlayTool #1445

Open
lwamuhaji opened this issue Aug 29, 2024 · 3 comments
Open

[Bug] Can't render ScaleOverlayTool #1445

lwamuhaji opened this issue Aug 29, 2024 · 3 comments

Comments

@lwamuhaji
Copy link

Describe the Bug

The ScaleOverlayTool annotation object is successfully added to the annotation manager at its first call of _init() function in which addAnnotation() is called, however, as of second call of it, addAnnotation() is not called. That's because viewportsWithAnnotations that stores which viewports have an annotation prevents _init() from calling addAnnotation(), but there is no logic removes viewports from viewportsWithAnnotations array. So even after removing annotation with something like annotation.state.removeAllAnnotations(), you cannot add ScaleOverlay annotation again, which results in fail of rendering scale overlay.

Steps to Reproduce

  1. Enable ScaleOverlayTool (this will call _init())
  2. removeAllAnnotations()
  3. Enable ScaleOverlayTool again
  4. Uncaught TypeError from ScaleOverlayTool.renderAnnotation()

The current behavior

Can't render ScaleOverlayTool

The expected behavior

Render ScaleOverlayTool

OS

Windows 10

Node version

20.11.1

Browser

Chrome 128.0.6613.85 64bit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@lwamuhaji and others