[Pkg-javascript-commits] [pdf.js] 183/204: Fix "Automatic Zoom" for landscape documents with very wide pages (issue 5398)
David Prévot
taffit at moszumanska.debian.org
Sat Oct 25 18:50:49 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 670b842e090fec5a7ad4c937ce7276c914b4fe13
Author: Jonas Jenwald <jonas.jenwald at gmail.com>
Date: Sun Oct 12 02:25:35 2014 +0200
Fix "Automatic Zoom" for landscape documents with very wide pages (issue 5398)
---
web/pdf_viewer.js | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/web/pdf_viewer.js b/web/pdf_viewer.js
index a64f39b..47e109f 100644
--- a/web/pdf_viewer.js
+++ b/web/pdf_viewer.js
@@ -374,8 +374,10 @@ var PDFViewer = (function pdfViewer() {
break;
case 'auto':
var isLandscape = (currentPage.width > currentPage.height);
- var horizontalScale = isLandscape ? pageHeightScale :
- pageWidthScale;
+ // For pages in landscape mode, fit the page height to the viewer
+ // *unless* the page would thus become too wide to fit horizontally.
+ var horizontalScale = isLandscape ?
+ Math.min(pageHeightScale, pageWidthScale) : pageWidthScale;
scale = Math.min(MAX_AUTO_SCALE, horizontalScale);
break;
default:
--
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