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 2D rotation on centering #188

Merged
merged 2 commits into from
Feb 26, 2024
Merged

Fix 2D rotation on centering #188

merged 2 commits into from
Feb 26, 2024

Conversation

ghsteff
Copy link
Contributor

@ghsteff ghsteff commented Feb 26, 2024

PR Checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

[ ] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[x] Other... Please describe: Improvement

What is the current behavior?

Centering a 2d graph after rotating locks to the wrong axis when it's the closest

What is the new behavior?

2d graphs rotate to the correct axis when centering

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

BEFORE

Screen.Recording.2024-02-26.at.1.02.02.PM.mov
Screen.Recording.2024-02-26.at.1.01.45.PM.mov

AFTER

Screen.Recording.2024-02-26.at.1.00.01.PM.mov
Screen.Recording.2024-02-26.at.1.01.21.PM.mov

This rotates 2d graphs properly when centering so they don't rotate to the incorrect axis when it's closer
Comment on lines +72 to +74
if (!layoutType.includes('3d')) {
void controls?.rotateTo(0, Math.PI / 2, true);
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This feels a little flaky and not so obvious if we were to add more layout types. It is simple tho 🤔

@ghsteff ghsteff requested a review from amcdnl February 26, 2024 19:06
@amcdnl amcdnl merged commit cbca26f into master Feb 26, 2024
2 checks passed
@amcdnl amcdnl deleted the fix/2d-center-rotation branch February 26, 2024 19:07
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