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
Get drawable coordinates #89
Comments
You can get the coordinates using |
this would work but getting the pan doesn't consider the zoom scale factor. I believe coordinates system gets amplified when zoom in. Is there any other way to do it with respect to zoom and scale factor? |
I think you can just multiply it with the |
Not accurate as get the zoom and doing the multiplication will not consider the zoom center pivot (where the pinch is happening) so this would linear translate all coordinates based on the default position of the pivot. I tried resetting the pivot X and Y on the pinch position but i got no luck. |
Why is the pivot point of the pinch important when the views on top of the zoom layout have a fixed position relative to it? Shouldn't it be sufficient to move the views on top just like the zoom layout pan but in reverse? When the zoom layout is zoomed in (i.e. zoom > 1) the translation of the views on top would then need to be less than the original pixel size because as you said the zoom layout coordinates will be amplified (off the top of my head I would think you just need to divide the pan by the zoom factor). |
When using the pan and the zoom the pins of the superposed layout (on top of the zoomLayout) are transposed on the diagonal as linear transpose. What i want to say here is that some times you pinch on a position where the pin is located, therefore this latter should not transpose at all but in my case whether multipliying or dividing it just travels on the diagonal. Besides all that I think this library needs couple of callbacks to be added such as "onZoomUpdate -> zoom: Float" and "onViewPanUpdate -> float[x,y]" |
Markus is right, but instead of So either you need Also depending on how you are drawing, you might have to take other things into account, like the screen size / container size. In the end, it is purely a math problem, just make sure to understand what You can also use |
Sounds good i'll give it a try. Thanks a lot |
@andromedcodes were you able to get the correct drawable coordinates inside ZoomImageView? Here's what I've tried:
But I don't understand how to adjust the pan and zoom values in there. Any help would be appreciated. Thanks |
This issue has been automatically marked as stale because it has not had activity in the last 20 days. It will be closed if no further activity occurs within the next seven days. Thank you for your contributions. |
Hi,
Thank you very much for putting hard work into this amazing library. I am pretty satisfied with the result and the API, However, I would like to get the X and Y coordinates of the drawable inside the ZoomImageView cuz i drawing some circles on top of the ZoomImageView and i would like them to move along with the drawable (after zoom as well). Think about the problem as you have a map (ZoomImageView) and on top of it you have some pins that they have to keep the same relative position when the user zoom in/out or pan the view. Any help would be very appreciated.
Thank you.
The text was updated successfully, but these errors were encountered: