Incorrect zoom coordinates when calling setZoom()/setZoomAnimated()
bartek-wesolowski opened this issue · comments
I used an older version of TouchImageView
in my map app. I have hardcoded point coordinates. I call setZoomAnimated()
when someone searches for a particular point. When I updated to the newest version of TouchImageView
then setZoomAnimated()
/setZoom()
started zooming on a different place even though the focus coordinates didn't change. On version 3.0.3 everything still works correctly. On 3.0.4 the focus coordinates are different.
Steps to reproduce
Use TouchImageView
version 3.0.3 to show an image. Pan the image using setZoom(2f, 0.7f, 0.7f)
. Take a screenshot.
Do the same for version 3.0.4. The screenshots will be different even though the focus coordinates are the same.
It looks like that it's related to #329
To be honest, it's a community project and I'm happy to merge any pull request
This change might have caused the problem.
This change and #329 are the same
But how to proceed ? I've no clue. @SimFG do you have an idea ?
I think that the changes made in #329 should be reverted because the formula is incorrect. Isn't the situation described in #329 (comment) a feature and not a bug? If we focus on point 0,0, don't we expect the image to be moved down like that? If not, shouldn't we adjust getFixTrans()
instead of setZoom()
? I started working on it a bit, but I'm going on vacation tomorrow and won't have access to my computer for a week.
BTW, using Paparazzi for screenshot tests would be nice.
I started working on it a bit, but I'm going on vacation tomorrow and won't have access to my computer for a week.
I would love to see some outcome in the future !
closed with #514