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

Since 3.0 multipart tools hog event inputs. Can't zoom/pan whilst in a draw loop. #833

Closed
JamesAPetts opened this issue Feb 12, 2019 · 1 comment
Assignees
Labels
Change: Implementation 💻 Change that updates implementation details w/o expanding the API 2️⃣ Priority: Medium

Comments

@JamesAPetts
Copy link
Member

With the introduction of cornerstoneTools 3.0's new spangled event dispatcher, some tools are able to block event dispatching and deal with mouse/touch input internally to the tool. This is useful for e.g. FreehandMouseTool, where an indeterminate number of clicks/drags are are required to complete the annotation.

This currently comes with the downside of not being able to use tools bound to other input during the tools usage. It'd be really useful to be able to zoom and/or pan during a multi-part tools draw loop.

After some discussion, @dannyrb and I came to the conclusion that only non-annotation tools (i.e. when !(tool instanceof BaseAnnotationTool) should be usable during a multi-part draw loop. If you have a use case that requires annotation tools to be used during a multi-part draw loop, please leave a comment and discuss.

TODO:

  • Rename state.isToolLocked to state.multiPartToolActive.
  • Change the dispatchers to still dispatch events to non-annotation tools whilst state.multiPartToolActive === true.
  • Create a multiPartTool mixin with helpers for easy mouse/touch mask management for event loops. The idea is that this will be useful but optional, as multi-part tools by nature are rather non-standard.
@dannyrb dannyrb added the Change: Implementation 💻 Change that updates implementation details w/o expanding the API label Feb 12, 2019
JamesAPetts pushed a commit to JamesAPetts/cornerstoneTools that referenced this issue Feb 13, 2019
…lti-part tool's loop.

Added a new flag, isMultiPartTool to tools, and a global state trigger you may set called
isMultiPartToolActive. If this is true, only non-annotation tools may be used whilst you are in a
multi-part tool's event loop.

re cornerstonejs#833
@JamesAPetts
Copy link
Member Author

Addressed in part by #836 .

Creating a multi-part tool will be a future addition.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Change: Implementation 💻 Change that updates implementation details w/o expanding the API 2️⃣ Priority: Medium
Projects
None yet
Development

No branches or pull requests

2 participants