Merge pull request #4099 from yurydelendik/bug958050

Fixes FitV scrolling
This commit is contained in:
Tim van der Meij 2014-01-10 13:50:47 -08:00
commit d6ed4f2631

View File

@ -336,6 +336,11 @@ var PageView = function pageView(container, id, scale,
var x = 0, y = 0; var x = 0, y = 0;
var width = 0, height = 0, widthScale, heightScale; var width = 0, height = 0, widthScale, heightScale;
var changeOrientation = !!(this.rotation % 180);
var pageWidth = (changeOrientation ? this.height : this.width) /
this.scale / CSS_UNITS;
var pageHeight = (changeOrientation ? this.width : this.height) /
this.scale / CSS_UNITS;
var scale = 0; var scale = 0;
switch (dest[1].name) { switch (dest[1].name) {
case 'XYZ': case 'XYZ':
@ -347,7 +352,7 @@ var PageView = function pageView(container, id, scale,
// since aligning the bottom of the intended page with the // since aligning the bottom of the intended page with the
// top of the window is rarely helpful). // top of the window is rarely helpful).
x = x !== null ? x : 0; x = x !== null ? x : 0;
y = y !== null ? y : (this.height / this.scale) / CSS_UNITS; y = y !== null ? y : pageHeight;
break; break;
case 'Fit': case 'Fit':
case 'FitB': case 'FitB':
@ -361,6 +366,8 @@ var PageView = function pageView(container, id, scale,
case 'FitV': case 'FitV':
case 'FitBV': case 'FitBV':
x = dest[2]; x = dest[2];
width = pageWidth;
height = pageHeight;
scale = 'page-height'; scale = 'page-height';
break; break;
case 'FitR': case 'FitR':