summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gardiner <paulg.artifex@glidos.net>2012-11-08 12:09:18 +0000
committerPaul Gardiner <paulg.artifex@glidos.net>2012-11-08 12:09:18 +0000
commit6f5896f3859c1715cf62343961baed8c78784b5e (patch)
treeef141a6e7da819b8896debc09c126ddf4b369fc9
parent6cd0c1d0f4d6f783bd0890731c86144e2f06491c (diff)
downloadmupdf-6f5896f3859c1715cf62343961baed8c78784b5e.tar.xz
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.
-rw-r--r--android/src/com/artifex/mupdf/MuPDFCore.java8
1 files changed, 2 insertions, 6 deletions
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();
}