CGRect screenSize = [[UIScreen mainScreen]bounds];
CGFloat screenWidth = screenSize.size.width;
CGRect visibleRect;
visibleRect.origin = scrollView.contentOffset;
visibleRect.size = imageView.frame.size;
CGPoint midPoint = CGPointMake(visibleRect.origin.x + visibleRect.size.width / 2, visibleRect.origin.y + visibleRect.size.height / 2);
CGPoint place = CGPointMake(class.xValue, class.yValue);
xValue and yValue being 'int's declared in the class.
-(int)distanceFrom:(CGPoint)point1 to:(CGPoint)point2{
CGFloat xDist = ((point2.x) - (point1.x));
CGFloat yDist = ((point2.y) - (point1.y));
return (sqrt((xDist * xDist) + (yDist * yDist)));
}
The problem is that once I change the zoomScale by scrolling in the app and recall the method the numbers change drastically (~1000 pixels). How to I take into account for the zoomScale? Thanks in advance, Alex