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(rotation): Only one CAMERA_MODIFIED event per rotation #824

Conversation

jbocce
Copy link
Collaborator

@jbocce jbocce commented Oct 11, 2023

Context

Fixes: #819

Changes & Results

When setting the camera in StackViewport.setRotationGPU, do not fire a CAMERA_MODIFIED event because it is already being done so in setRotation.

Testing

See #819. However, here are some brief details here...

  1. Launch the Stack API example.
  2. Open the browser console and enter the following snippet of code that will log the event fired.
var viewport = cornerstone.getRenderingEngines()[0].getViewports()[0];
viewport.element.addEventListener(cornerstone.EVENTS.CAMERA_MODIFIED, (e) => console.log(e)); 
  1. Click any of the rotate buttons in the example.
  2. The console should log a single event for each rotation button click.

Checklist

PR

  • My Pull Request title is descriptive, accurate and follows the
    semantic-release format and guidelines.

Code

Public Documentation Updates

  • The documentation page has been updated as necessary for any public API
    additions or removals.

Tested Environment

  • "OS: Windows 11
  • "Node version: 16.14.0
  • "Browser: Chrome 117.0.5938.152

…U, do not fire

a CAMERA_MODIFIED event because it is already being done so in setRotation.
@netlify
Copy link

netlify bot commented Oct 11, 2023

Deploy Preview for cornerstone-3d-docs ready!

Name Link
🔨 Latest commit 4fccbdc
🔍 Latest deploy log https://app.netlify.com/sites/cornerstone-3d-docs/deploys/6526b0c238e0be00089b2a21
😎 Deploy Preview https://deploy-preview-824--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 configuration.

@jbocce jbocce requested a review from sedghi October 11, 2023 14:27
@sedghi sedghi merged commit fd27c43 into cornerstonejs:main Oct 14, 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.

[Bug] Set rotation duplicate trigger event "CAMERA MODIFIED"?
2 participants