From f3caf199ca79c5ae8c28dbac38b87b782511548e Mon Sep 17 00:00:00 2001 From: Paul Gardiner Date: Tue, 1 Oct 2013 15:47:13 +0100 Subject: iOS: rework some positioning calclations The new code yields the same result as that that it replaces, but might be easier to understand. --- platform/ios/Classes/MuPageViewNormal.m | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'platform/ios/Classes') diff --git a/platform/ios/Classes/MuPageViewNormal.m b/platform/ios/Classes/MuPageViewNormal.m index fb03756d..cd2f1875 100644 --- a/platform/ios/Classes/MuPageViewNormal.m +++ b/platform/ios/Classes/MuPageViewNormal.m @@ -484,10 +484,9 @@ static UIImage *renderTile(fz_document *doc, fz_display_list *page_list, fz_disp float scale = tileScale; CGRect viewFrame = frame; - if (self.contentOffset.x < imageView.frame.origin.x) - viewFrame.origin.x = 0; - if (self.contentOffset.y < imageView.frame.origin.y) - viewFrame.origin.y = 0; + // Adjust viewFrame to be relative to imageView's origin + viewFrame.origin.x -= imageView.frame.origin.x; + viewFrame.origin.y -= imageView.frame.origin.y; if (scale < 1.01) return; -- cgit v1.2.3