]> git.parisson.com Git - pdf.js.git/commitdiff
Fix current page number not updating.
authorBrendan Dahl <brendan.dahl@gmail.com>
Mon, 30 Apr 2012 17:56:49 +0000 (10:56 -0700)
committerBrendan Dahl <brendan.dahl@gmail.com>
Mon, 30 Apr 2012 17:56:49 +0000 (10:56 -0700)
web/viewer.js

index 5bd6c4111a07b7b3a25cdbdd282d7b521b2a57f2..98caa45be270af13c822484501792335239a60d8 100644 (file)
@@ -675,7 +675,10 @@ var PDFView = {
 
     var currentHeight = kTopPadding + kBottomMargin;
     var container = this.container;
-    var containerTop = container.scrollTop;
+    // Add 1px to the scrolltop to give a little wiggle room if the math is off,
+    // this won't be needed if we calc current page number based off the middle
+    // of the screen instead of the top.
+    var containerTop = container.scrollTop + 1;
     for (var i = 1; i <= pages.length; ++i) {
       var page = pages[i - 1];
       var pageHeight = page.height + kBottomMargin;