]> git.parisson.com Git - pdf.js.git/commitdiff
Merge branch 'master' of https://github.com/andreasgal/pdf.js.git into zoom-bookmark
authornotmasteryet <async.processingjs@yahoo.com>
Mon, 5 Sep 2011 20:54:54 +0000 (15:54 -0500)
committernotmasteryet <async.processingjs@yahoo.com>
Mon, 5 Sep 2011 20:54:54 +0000 (15:54 -0500)
Conflicts:
web/viewer.js

1  2 
web/viewer.js

diff --cc web/viewer.js
index 2490c39e95aacc9a1121f95334084b67c1122705,811cfcbcc8e559fa15c5405b2ec058a924a3d1f8..c5d79c541dbb642aad7201a10d13d287a9cc80f3
@@@ -46,28 -44,26 +46,29 @@@ var PDFView = 
      window.dispatchEvent(event);
    },
  
 -  parseScale: function(value) {
 +  parseScale: function(value, resetAutoSettings) {
+     if ('custom' == value)
+       return;
      var scale = parseFloat(value);
      if (scale) {
        this.setScale(scale, true);
        return;
      }
-     if ('custom' == value)
-       return;
  
      var currentPage = this.pages[this.page - 1];
 -    var scrollbarPadding = 40;
 -    var pageWidthScale = (window.innerWidth - scrollbarPadding) /
 +    var pageWidthScale = (window.innerWidth - kScrollbarPadding) /
        currentPage.width / kCssUnits;
 -    var pageHeightScale = (window.innerHeight - scrollbarPadding) /
 +    var pageHeightScale = (window.innerHeight - kScrollbarPadding) /
        currentPage.height / kCssUnits;
      if ('page-width' == value)
 -      this.setScale(pageWidthScale);
 -    else if ('page-fit' == value)
 -      this.setScale(Math.min(pageWidthScale, pageHeightScale));
 +      this.setScale(pageWidthScale, resetAutoSettings);
 +    if ('page-height' == value)
 +      this.setScale(pageHeightScale, resetAutoSettings);
 +    if ('page-fit' == value) {
 +      this.setScale(
 +        Math.min(pageWidthScale, pageHeightScale), resetAutoSettings);
 +    }
    },
  
    zoomIn: function() {