I'm calculating the center point of a view using delta values calculated after scrolling, this works great when the zoom level is 1.0 but any other zoom level causes the center be incorrect. Here's my code:
- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
CGFloat dX = self.contentOffset.x - lastScrollPoint.x;
CGFloat dY = self.contentOffset.y - lastScrollPoint.y;
dX *= self.zoomScale;
dY *= self.zoomScale;
lastScrollPoint = self.contentOffset;
viewCenter.x += dX;
viewCenter.y += dY;
}
What do I need to do to adjust the delta for the zoom scale? I thought that multiplying by the zoomScale would be enough but it's obviously not.