Fix page rotation for unloaded pages.

This commit is contained in:
Brendan Dahl 2013-11-25 10:05:23 -08:00
parent fe2700ca2d
commit c20476bfca

View File

@ -54,11 +54,19 @@ var PageView = function pageView(container, id, scale,
this.setPdfPage = function pageViewSetPdfPage(pdfPage) {
this.pdfPage = pdfPage;
this.pdfPageRotate = pdfPage.rotate;
this.viewport = pdfPage.getViewport(this.scale * CSS_UNITS);
this.updateViewport();
this.stats = pdfPage.stats;
this.reset();
};
this.updateViewport = function pageViewUpdateViewport() {
var totalRotation = (this.rotation + this.pdfPageRotate) % 360;
this.viewport = this.viewport.clone({
scale: this.scale * CSS_UNITS,
rotation: totalRotation
});
},
this.destroy = function pageViewDestroy() {
this.zoomLayer = null;
this.reset();
@ -103,11 +111,7 @@ var PageView = function pageView(container, id, scale,
this.rotation = rotation;
}
var totalRotation = (this.rotation + this.pdfPageRotate) % 360;
this.viewport = this.viewport.clone({
scale: this.scale * CSS_UNITS,
rotation: totalRotation
});
this.updateViewport();
if (USE_ONLY_CSS_ZOOM && this.canvas) {
this.cssTransform(this.canvas);