From 6f5896f3859c1715cf62343961baed8c78784b5e Mon Sep 17 00:00:00 2001 From: Paul Gardiner Date: Thu, 8 Nov 2012 12:09:18 +0000 Subject: Android: fix rendering-wrong-page bug The page number was being cached at two levels, and some calls were skipping the upper level, leaving it out of date. The fix is always to call the lower level gotoPage from the upper level. Since the lower level caches, there is little to gain in avoiding the call, in any case. --- android/src/com/artifex/mupdf/MuPDFCore.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'android/src') diff --git a/android/src/com/artifex/mupdf/MuPDFCore.java b/android/src/com/artifex/mupdf/MuPDFCore.java index 86ec308b..5dcebaea 100644 --- a/android/src/com/artifex/mupdf/MuPDFCore.java +++ b/android/src/com/artifex/mupdf/MuPDFCore.java @@ -12,10 +12,9 @@ public class MuPDFCore } /* Readable members */ - private int pageNum = -1;; private int numPages = -1; - public float pageWidth; - public float pageHeight; + private float pageWidth; + private float pageHeight; /* The native functions */ private static native int openFile(String filename); @@ -75,10 +74,7 @@ public class MuPDFCore page = numPages-1; else if (page < 0) page = 0; - if (this.pageNum == page) - return; gotoPageInternal(page); - this.pageNum = page; this.pageWidth = getPageWidth(); this.pageHeight = getPageHeight(); } -- cgit v1.2.3