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

BUG: Zoom on center instead on current mouse position #16

Open
EdinCeman opened this issue Aug 29, 2019 · 0 comments
Open

BUG: Zoom on center instead on current mouse position #16

EdinCeman opened this issue Aug 29, 2019 · 0 comments

Comments

@EdinCeman
Copy link

Hi,

while using your plugin for org chart (which is BTW amazing thanks a lot), I noticed that when you apply the zoom function on the chart you only watch and change the matrix scale property and the translationX and Y stays 0. This leads to constantly zooming to center of the div and not on the current mouse position. Also when zooming is enabled you should set overflow from auto to hidden to prevent collision between scroll and zoom on mouse wheel. Solution is that you track where is the current mouse position on x and y and than subtract the offset of the div x an y, so your mouse position does not move while zooming in. This value is then inserted in last 2 parameters of matrix and the problem should be solved.

Thanks again for amazing plugin and keep up the good work :) .

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

No branches or pull requests

1 participant