ui
ui copied to clipboard
Improve zoom and scroll
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
zoomDeltatozoomFactorand 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!