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

Improve zooming behavior #677

Closed
hannobraun opened this issue Jun 10, 2022 · 0 comments · Fixed by #764
Closed

Improve zooming behavior #677

hannobraun opened this issue Jun 10, 2022 · 0 comments · Fixed by #764
Labels
good first issue Good for newcomers type: bug Something isn't working

Comments

@hannobraun
Copy link
Owner

The zooming behavior is a bit too finicky. It is quite easy to accidentally reverse the direction when trying to stop the zoom, for example.

The way zooming works, roughly, is that it checks how many scroll events (coming from the mouse wheel, for example) were generated over a recent time frame, and computes a zoom speed based on that. If it detects a scroll event that goes into the opposite direction as the current zoom speed, it will stop the zoom.

The design intent here is to provide appropriate control over the zooming behavior over a wide range of situations:

  • You are zoomed in closely, but want to zoom out quickly to get an overview? Turn the mouse wheel quickly to generate a fast zoom.
  • You are inspecting some detail of the model, and need to control the zoom very precisely? Zoom slowly by turning the mouse wheel slowly, and stop that zoom exactly where you want, by given the mouse wheel a turn in the opposite direction.

I think this design intent can be achieved using the current approach, but it needs some tuning to feel good. All input is handled in fj-viewer, and zooming specifically is done in zoom.rs. Using a completely different approach that realizes the same design intent would also be a perfectly acceptable resolution to this issue.

Please also note that there is a related issue (#25) that is specifically about zooming speed. It might make sense to tackle both issues concurrently.

Labeling https://github.com/hannobraun/Fornjot/labels/good%20first%20issue, as the code that governs zooming lives in a single file, making this a pretty focused issue that doesn't require any knowledge of Fornjot specifics.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers type: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant