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 fit view bug after panning and zooming #246

Merged
merged 1 commit into from
May 23, 2024

Conversation

ghsteff
Copy link
Contributor

@ghsteff ghsteff commented May 23, 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?

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

What is the current behavior?

If you pan and zoom, then fit nodes to the view, sometimes the view doesn't fit properly

What is the new behavior?

The view always fits properly

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

This awaits the zoom reset before positioning the camera when triggering fitNodesInView. Now there's a visual split between zooming and positioning the camera, but it's better than the view not being fit to the nodes properly

BEFORE
(happened on the 3rd fit to view trigger)

Screen.Recording.2024-05-23.at.12.37.49.PM.mov

AFTER

Screen.Recording.2024-05-23.at.12.39.36.PM.mov

Note: If you only zoom or only pan, there's no wonky/jumpyness when fitting the view

Copy link

netlify bot commented May 23, 2024

Deploy Preview for reagraph ready!

Name Link
🔨 Latest commit 3e4999e
🔍 Latest deploy log https://app.netlify.com/sites/reagraph/deploys/664f72350edf6b000875cb87
😎 Deploy Preview https://deploy-preview-246--reagraph.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.

@ghsteff ghsteff requested a review from amcdnl May 23, 2024 16:44
@amcdnl amcdnl merged commit f35495a into master May 23, 2024
5 checks passed
@amcdnl amcdnl deleted the Fix-zoom-pan-fit-to-view-bug branch May 23, 2024 16:52
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