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(reslicecursorwidget): fix camera reset on rotation after a camera… #3033

Conversation

finetjul
Copy link
Member

… translation

BREAKING CHANGE: ResliceCursorWidget.interactionEvent has been modified

Context

When the user translates a camera (shift+left drag), and then rotate the reslice cursor widget in another view, the camera was reset. This is because the focal point offsets were not "stored" after the camera translation. The rotation was therefore resetting the camera translation.

Results

A solution would have been to observe the interactor style each time the camera is manipulated. Instead, we prefer to save the focal point offsets before any reslice cursor widget interaction happens, namely when startInteraction is triggered.

Changes

This makes computeFocalPointOffset parameter in the reslice cursor widget interactionEvent obsolete. It has therefore been removed along with the associated canUpdateFocalPoint. This is not the behavior's responsibility to tell the event consumers what they must do.

  • Documentation and TypeScript definitions were updated to match those changes

PR and Code Checklist

  • semantic-release commit messages
  • Run npm run reformat to have correctly formatted code

Testing

  • This change adds or fixes unit tests
  • Tested environment:
    • vtk.js: master
    • OS: Windows
    • Browser: Chrome

@finetjul finetjul requested review from floryst and bruyeret March 18, 2024 22:44
@finetjul finetjul force-pushed the rcw-fix-camera-reset-on-rotate-after-camera-translation branch from b50d278 to 0e65ed8 Compare March 18, 2024 22:46
@finetjul
Copy link
Member Author

@bruyeret could I have broken the CPR widget ?

@bruyeret
Copy link
Contributor

@bruyeret could I have broken the CPR widget ?

I tested and it doesn't look broken, I don't think that the change could affect it

@floryst
Copy link
Collaborator

floryst commented Mar 19, 2024

LGTM

@floryst
Copy link
Collaborator

floryst commented Mar 19, 2024

Whenever this is ready to merge, we should merge it with #3020 to cut a single major release, instead of two.

… translation

When the user translates a camera (shift+left drag), and then rotate the reslice cursor widget in
another view, the camera was reset. This is because the focal point offsets were not "stored" after
the camera translation. The rotation was therefore resetting the camera translation. A solution
would have been to observe the interactor style each time the camera is manipulated. Instead, we
prefer to save the focal point offsets before any reslice cursor widget interaction happens, namely
when startInteraction is triggered. This makes computeFocalPointOffset parameter in the reslice
cursor widget interactionEvent obsolete. It has therefore been removed along with the associated
canUpdateFocalPoint. This is not the behavior's responsibility to tell the event consumers what they
must do.

BREAKING CHANGE: ResliceCursorWidget.interactionEvent has been modified
@finetjul finetjul force-pushed the rcw-fix-camera-reset-on-rotate-after-camera-translation branch from 0e65ed8 to a2ce9a9 Compare March 22, 2024 14:23
@finetjul finetjul added this pull request to the merge queue Mar 22, 2024
Merged via the queue into Kitware:master with commit 74494c8 Mar 22, 2024
3 checks passed
Copy link

🎉 This PR is included in version 30.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions github-actions bot added the released Automated label label Mar 22, 2024
@finetjul finetjul mentioned this pull request Mar 22, 2024
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released Automated label
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants