Skip to content

Improve zoom and scroll #96

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

pscheede
Copy link

Hi!

When trying out the new experimental "static" export of structurizr/cli, I've stumbled across behavior of the UI that is not ideal, in my opinion. A quick check in structurizr/lite revealed this behavior there as well.

  • When dragging a large diagram, the mouse position is not fixed to the diagram. Instead, the mouse moves more than the diagram does.
  • Zooming is linear, which means that the first zoom step is perceived to be much bigger than the last steps.

This PR is my attempt at fixing these problems, by:

  • removing an (IMO) unnecessary scale factor when dragging the diagram
  • changing zoomDelta to zoomFactor and therefore using exponential zooming, which feels much more natural, in my opinion

I also slowed down zooming by mousewheel on the static page, because I felt, that the mousewheel could benefit from double the amount of zoom steps.

Please let me know, what you think, and if there's anything you'd like me to change!

Zooming is now exponential.
Scrolling now follows the mouse directly.

Zooming was linear before, which meant that the first
zoom step was perceived to be much bigger than the last.
With exponential zooming, each step now feels the same.

Zooming with mouse was too sensitive, in my opinion.
Therefore I halved the zoom factor with the mouse.
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.

1 participant