summaryrefslogtreecommitdiff
path: root/platform/java/example
diff options
context:
space:
mode:
Diffstat (limited to 'platform/java/example')
-rw-r--r--platform/java/example/Viewer.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/platform/java/example/Viewer.java b/platform/java/example/Viewer.java
index 1361a538..a924cf4b 100644
--- a/platform/java/example/Viewer.java
+++ b/platform/java/example/Viewer.java
@@ -383,12 +383,12 @@ public class Viewer extends Frame implements WindowListener, ActionListener, Ite
}
if (layoutEm != oldLayoutEm) {
- float oldPos = (pageNumber + 0.5f) / (float)pageCount;
+ long mark = doc.makeBookmark(pageNumber);
doc.layout(layoutWidth, layoutHeight, layoutEm);
updateOutline();
pageCount = doc.countPages();
pageLabel.setText("/ " + pageCount);
- pageNumber = (int)(oldPos * pageCount);
+ pageNumber = doc.findBookmark(mark);
}
if (zoomLevel != oldZoomLevel || pageNumber != oldPageNumber || layoutEm != oldLayoutEm || searchHits != oldSearchHits)