From: Michael Ang Date: Fri, 15 Oct 2010 01:29:43 +0000 (+0000) Subject: Increase fudge factor when setting scroll position that determines which page is... X-Git-Url: http://git.rot13.org/?p=bookreader.git;a=commitdiff_plain;h=70f5cd3fc575b0fe9b24d3a5ee6043516da66240 Increase fudge factor when setting scroll position that determines which page is considered current when drawing the one page view. Probably drawLeafsOnePage should take a target index instead. --- diff --git a/BookReader/BookReader.js b/BookReader/BookReader.js index c1f6717..463c042 100644 --- a/BookReader/BookReader.js +++ b/BookReader/BookReader.js @@ -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;