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 behavior locking panning to viewport #159

Merged
merged 1 commit into from
Aug 22, 2024
Merged

Fix behavior locking panning to viewport #159

merged 1 commit into from
Aug 22, 2024

Conversation

phschaad
Copy link
Collaborator

@phschaad phschaad commented Aug 22, 2024

This PR fixes issues with the functionality to restrict panning, keeping the graph in view.
The feature has been changed as follows:

  1. A config toggle allows disabling the pan restriction entirely
  2. The pan restriction is no longer based on the minimap. Basing it on the minimap leads to issues when the minimap is disabled or the viewer is initialized with the minimap already disabled, which is primarily an issue in embedded scenarios or VSCode.
  3. The pan restriction now no longer aims to keep the graph 'centered' in the viewport, but rather stops panning when the graph is about to exit the viewport entirely. This allows for a significantly higher degree of freedom and basically unnoticeably limits panning, while making sure the graph does not end up far out of view.

This is an alternative to and thus would close #155.
Closes #157.

Copy link
Contributor

@tbennun tbennun left a comment

Choose a reason for hiding this comment

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

I think this should work. Thanks!

@phschaad phschaad merged commit 51cf273 into master Aug 22, 2024
2 checks passed
@phschaad phschaad deleted the pan_fix branch August 22, 2024 14:14
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.

Pan "correction" only behaves well if the minimap is enabled
2 participants