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

Mouse pointer as zoom/pan direction #778

Open
bwv-1011 opened this issue Nov 2, 2022 · 4 comments
Open

Mouse pointer as zoom/pan direction #778

bwv-1011 opened this issue Nov 2, 2022 · 4 comments
Labels

Comments

@bwv-1011
Copy link

bwv-1011 commented Nov 2, 2022

This is more of a feature request than an issue. Since an animation method is already implemented, it would be great if it can somehow be reused to change the zoom behaviour to zoom/pan towards where the mouse is currently pointing at and not the center.

@mistic100
Copy link
Owner

mistic100 commented Nov 5, 2022

Do you have an example of such behaviour ? I tried to implement it but it is not pleasant at all.

The main problem is that the mouse interations does not use the animation system but instead controls each value (longitude, latitude, zoom) independently, with no way to synchronize them.

I have a draft helper for this problem but it does not work https://github.com/mistic100/Photo-Sphere-Viewer/blob/v4/src/utils/DynamicXD.js

@bwv-1011
Copy link
Author

bwv-1011 commented Nov 6, 2022

Thanks for giving this a try so quickly!

I was thinking of google streetview! It seems like they have implemented some sort of curve that is calculated from the horizontal position of the mouse, e.g. if you zoom all the way in, and place your mouse pointer all the way to the left or right and then zoom out, it does so along some sort of curve. Also when zooming in it does not necessarily center the position that the mouse is pointing at, but at least it pans and zoom towards that direction.

@alexsaleh
Copy link

+1 to that request. Currently the zoom is "central" but it would be nice to zoom where the cursor is. That would allow the user to zoom without having to "pan" after that in order to get to the point of interest

@mistic100
Copy link
Owner

Please refrain to comment "+1" and use the Github reactions on the initial post.

Unless of course you have a proposal of algorithm to do that correctly because personally my tries were all a failure.

mistic100 added a commit that referenced this issue Jan 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants