Fixing zoom and rotate issues

This commit is contained in:
Yury Delendik 2012-04-11 09:42:41 -07:00
parent 82dd32e807
commit 2f4423cffb
2 changed files with 15 additions and 3 deletions

View File

@ -19,7 +19,7 @@
return this.page.view; return this.page.view;
}, },
getViewport: function(scale, rotate) { getViewport: function(scale, rotate) {
if (arguments < 2) if (arguments.length < 2)
rotate = this.rotate; rotate = this.rotate;
return new PDFJS.PageViewport(this.view, scale, rotate, 0, 0); return new PDFJS.PageViewport(this.view, scale, rotate, 0, 0);
}, },

View File

@ -747,8 +747,6 @@ var PageView = function pageView(container, pdfPage, id, scale,
var viewport = this.pdfPage.getViewport(this.scale); var viewport = this.pdfPage.getViewport(this.scale);
this.viewport = viewport; this.viewport = viewport;
this.width = viewport.width;
this.height = viewport.height;
div.style.width = viewport.width + 'px'; div.style.width = viewport.width + 'px';
div.style.height = viewport.height + 'px'; div.style.height = viewport.height + 'px';
@ -763,6 +761,20 @@ var PageView = function pageView(container, pdfPage, id, scale,
div.appendChild(this.loadingIconDiv); div.appendChild(this.loadingIconDiv);
}; };
Object.defineProperty(this, 'width', {
get: function PageView_getWidth() {
return this.viewport.width;
},
enumerable: true
});
Object.defineProperty(this, 'height', {
get: function PageView_getHeight() {
return this.viewport.height;
},
enumerable: true
});
function setupAnnotations(pdfPage, viewport) { function setupAnnotations(pdfPage, viewport) {
function bindLink(link, dest) { function bindLink(link, dest) {
link.href = PDFView.getDestinationHash(dest); link.href = PDFView.getDestinationHash(dest);