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

Example: How to set zoom focus point? #3

Open
egunsoma opened this issue Apr 13, 2018 · 2 comments
Open

Example: How to set zoom focus point? #3

egunsoma opened this issue Apr 13, 2018 · 2 comments

Comments

@egunsoma
Copy link

When running on Android Emulator, the focus point of the zoom is not in the middle, but on the left side of the screen. Any ideas why? :) I can post screenshots, but the code is the same as in the example.

@msand
Copy link
Owner

msand commented Apr 15, 2018

I'm not sure what you mean, perhaps the screenshots would help 😉

@salacode
Copy link

salacode commented Oct 6, 2020

I suspect the problem was that if zoomable-svg is not placed to the top-left corner of the screen then the zoom focus/origin/center point is not properly calcualted. Simply, when pinching, the objects are sliping away a bit.

I think the problem is that zoomable-svg does not translate absolute (pageX, pageY) coords into relative ones. I have a fix, @msand do you accept PR-s? Here is my propsed fix: master...salacode:master

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

3 participants