diff options
author | Paul Gardiner <paul.gardiner@artifex.com> | 2013-10-01 15:47:13 +0100 |
---|---|---|
committer | Paul Gardiner <paul.gardiner@artifex.com> | 2013-10-02 12:57:55 +0100 |
commit | f3caf199ca79c5ae8c28dbac38b87b782511548e (patch) | |
tree | 31fe4b07d6222b9d4f29834ec1bbd6057b3e36a6 /platform/ios/Classes | |
parent | 7dacbb542aa870d81f9d5285904481ae6004fa18 (diff) | |
download | mupdf-f3caf199ca79c5ae8c28dbac38b87b782511548e.tar.xz |
iOS: rework some positioning calclations
The new code yields the same result as that that it replaces, but might
be easier to understand.
Diffstat (limited to 'platform/ios/Classes')
-rw-r--r-- | platform/ios/Classes/MuPageViewNormal.m | 7 |
1 files changed, 3 insertions, 4 deletions
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; |