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 desync of td view camera and store state #5550

Merged
merged 3 commits into from
Jun 9, 2021
Merged

Conversation

daniel-wer
Copy link
Member

@daniel-wer daniel-wer commented Jun 2, 2021

This bug led to a distortion of the 3d viewport when moving/zooming after maximizing it (could happen after minimizing it as well). The cause of the bug was a desynchronization of the 3d view camera internal state and its store state. The 3d view camera was adjusted when maximizing the 3d viewport without updating the store state. This led to distortion errors, afterwards.

I scanned the code but didn't find other occurrences where the 3d view camera is updated without updating the store state.

URL of deployed dev instance (used for testing):

  • https://___.webknossos.xyz

Steps to test:

  • Create some skeletons so that you see something in the 3d view
  • Maximize the 3d view using .
  • Then, without moving the mouse out of the 3d view or clicking, either zoom or move the 3d view -> No distortion should happen.
    • The repro can be a bit tricky. I would propose you to test this on master as well, to check whether the reproduction instructions work for you! For me the distortion doesn't always happen when zooming for some reason, but moving triggers it. If you cannot observe the distortion zoom a bit when not maximized and try again.

Issues:


@daniel-wer daniel-wer added the bug label Jun 2, 2021
@daniel-wer daniel-wer requested a review from philippotto June 2, 2021 15:15
@daniel-wer daniel-wer self-assigned this Jun 2, 2021
Copy link
Member

@philippotto philippotto left a comment

Choose a reason for hiding this comment

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

Awesome! The fix makes sense to me 👍 I was on the verge of giving up reproducing this issue, but in the end the repro somehow worked all of a sudden. I don't really know what changed inbetween 🤷 On the new dev instance, I couldn't provoke this error at all (and no other error either), so, I think, this is safe to be merged 💯

@bulldozer-boy bulldozer-boy bot merged commit 5a08455 into master Jun 9, 2021
@bulldozer-boy bulldozer-boy bot deleted the fix-camera-desync branch June 9, 2021 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

When zoom is the first action, the aspect ratio looks odd. Distortion in 3D viewport
2 participants