Increase fudge factor when setting scroll position that determines which page is...
authorMichael Ang <mang@archive.org>
Fri, 15 Oct 2010 01:29:43 +0000 (01:29 +0000)
committerMichael Ang <mang@archive.org>
Fri, 15 Oct 2010 01:29:43 +0000 (01:29 +0000)
BookReader/BookReader.js

index c1f6717..463c042 100644 (file)
@@ -999,7 +999,8 @@ BookReader.prototype.resizePageView1up = function() {
         // current index in drawLeafsOnePage after we create the new view container
 
         // Make sure this will count as current page after resize
-        var fudgeFactor = (this.getPageHeight(this.currentIndex()) / this.reduce) * 0.5;
+        // console.log('fudging for index ' + this.currentIndex() + ' (page ' + this.getPageNum(this.currentIndex()) + ')');
+        var fudgeFactor = (this.getPageHeight(this.currentIndex()) / this.reduce) * 0.6;
         var oldLeafTop = this.onePageGetPageTop(this.currentIndex()) + fudgeFactor;
         var oldViewDimensions = this.onePageCalculateViewDimensions(this.reduce, this.padding);
         scrollRatio = oldLeafTop / oldViewDimensions.height;