Closed oscarkuo closed 7 years ago
@oscarkuo Thanks for the PR - it's a great start. I noticed though that if the scroll offset is (0,0) then after you zoom the viewport isn't correctly aligned with the content (so you either get extra white space, or content is cut off and can't be scrolled to). One solution might be to do an animated realignment when ACTION_UP fires. Want to have a go at this? Or I may be able to take a look when I get some more time 😄
@chrisfisher thanks for the feedback, by "scroll offset", do you mean if you use the scrollTo
method then there will be extra whitespace?
I'll give it a go since getting this PR merged is part of the task I'm working on at work.
@oscarkuo The scroll offset is (0,0) when you're in the top left corner (i.e. the starting point). If you pinch to zoom here in the example then you either get extra white space (zooming in) or content is cut off (zooming out).
Currently when you pinch-to-zoom the Android implementation, it always scale around the top left corner instead of the pinch point.
This PR sets the pivot point for scaling to where the pinch started.