[Pkg-javascript-commits] [pdf.js] 11/204: Auto zoom landscape	documents to fit their height
    David Prévot 
    taffit at moszumanska.debian.org
       
    Sat Oct 25 18:50:25 UTC 2014
    
    
  
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository pdf.js.
commit 50a4510ab76745bee9ee57d3701b035ba12a1b8c
Author: Chris Peterson <cpeterson at mozilla.com>
Date:   Sat Aug 23 00:12:55 2014 -0700
    Auto zoom landscape documents to fit their height
---
 web/viewer.js | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/web/viewer.js b/web/viewer.js
index 4a4282e..0845c18 100644
--- a/web/viewer.js
+++ b/web/viewer.js
@@ -359,7 +359,9 @@ var PDFView = {
           scale = Math.min(pageWidthScale, pageHeightScale);
           break;
         case 'auto':
-          scale = Math.min(MAX_AUTO_SCALE, pageWidthScale);
+          var isLandscape = (currentPage.width > currentPage.height);
+          var horizontalScale = isLandscape ? pageHeightScale : pageWidthScale;
+          scale = Math.min(MAX_AUTO_SCALE, horizontalScale);
           break;
         default:
           console.error('pdfViewSetScale: \'' + value +
-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/pdf.js.git
    
    
More information about the Pkg-javascript-commits
mailing list