Merge pull request #3970 from brendandahl/rotation
Fix page rotation for unloaded pages.
This commit is contained in:
commit
d4e4634d06
@ -54,11 +54,19 @@ var PageView = function pageView(container, id, scale,
|
|||||||
this.setPdfPage = function pageViewSetPdfPage(pdfPage) {
|
this.setPdfPage = function pageViewSetPdfPage(pdfPage) {
|
||||||
this.pdfPage = pdfPage;
|
this.pdfPage = pdfPage;
|
||||||
this.pdfPageRotate = pdfPage.rotate;
|
this.pdfPageRotate = pdfPage.rotate;
|
||||||
this.viewport = pdfPage.getViewport(this.scale * CSS_UNITS);
|
this.updateViewport();
|
||||||
this.stats = pdfPage.stats;
|
this.stats = pdfPage.stats;
|
||||||
this.reset();
|
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.destroy = function pageViewDestroy() {
|
||||||
this.zoomLayer = null;
|
this.zoomLayer = null;
|
||||||
this.reset();
|
this.reset();
|
||||||
@ -103,11 +111,7 @@ var PageView = function pageView(container, id, scale,
|
|||||||
this.rotation = rotation;
|
this.rotation = rotation;
|
||||||
}
|
}
|
||||||
|
|
||||||
var totalRotation = (this.rotation + this.pdfPageRotate) % 360;
|
this.updateViewport();
|
||||||
this.viewport = this.viewport.clone({
|
|
||||||
scale: this.scale * CSS_UNITS,
|
|
||||||
rotation: totalRotation
|
|
||||||
});
|
|
||||||
|
|
||||||
if (USE_ONLY_CSS_ZOOM && this.canvas) {
|
if (USE_ONLY_CSS_ZOOM && this.canvas) {
|
||||||
this.cssTransform(this.canvas);
|
this.cssTransform(this.canvas);
|
||||||
|
Loading…
Reference in New Issue
Block a user