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

fix: AngleTool not working after cancellation #342

Merged
merged 1 commit into from
Jan 4, 2023

Conversation

BardiaKh
Copy link
Contributor

AngleTool will be broken after annotation cancellation, because it tries to get the annotationId of a non-existing annotation.

Fixed this issue by setting angleStartedNotYetCompleted to false upon cancellation.

AngleTool will be broken after annotation cancellation, because it tries to get the annotationId of a non-existing annotation.

Fixed this issue by setting angleStartedNotYetCompleted to false upon cancellation.
@netlify
Copy link

netlify bot commented Dec 30, 2022

Deploy Preview for cornerstone-3d-docs ready!

Name Link
🔨 Latest commit 8d7f3c8
🔍 Latest deploy log https://app.netlify.com/sites/cornerstone-3d-docs/deploys/63af647640ca0c0007d1d02d
😎 Deploy Preview https://deploy-preview-342--cornerstone-3d-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@@ -462,6 +462,7 @@ class AngleTool extends AnnotationTool {
}

this.editData = null;
this.angleStartedNotYetCompleted = false;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see how this line only is solving the bug you found, maybe not all your source changes are pushed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I only meant to change this single line.
Basically, after calling the cancel event, the user should be able to click on another point in the viewport to start annotating an angle, calling the addNewAnnotation method. In line 99 of this script, the tool checks if there are some unfinished angles:

if (this.angleStartedNotYetCompleted) {
      return;
    }

This check prevents adding new annotations as this.angleStartedNotYetCompleted is set to true after the drawing starts (line 103). So, we have to set it to false in the cancel method to allow for new annotations to be created after that.

@sedghi
Copy link
Member

sedghi commented Jan 4, 2023

Thanks for your contribution

@sedghi sedghi changed the title Fixed AngleTool not working after cancellation fix: AngleTool not working after cancellation Jan 4, 2023
@sedghi sedghi merged commit a82c0bc into cornerstonejs:main Jan 4, 2023
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

Successfully merging this pull request may close these issues.

2 participants