Browse Source

Merge pull request #3970 from brendandahl/rotation

Fix page rotation for unloaded pages.
Yury Delendik 12 years ago
parent
commit
d4e4634d06
  1. 16
      web/page_view.js

16
web/page_view.js

@ -54,11 +54,19 @@ var PageView = function pageView(container, id, scale, @@ -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, @@ -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);

Loading…
Cancel
Save