mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-09 17:55:37 +02:00
Fix page rotation for unloaded pages.
This commit is contained in:
parent
fe2700ca2d
commit
c20476bfca
1 changed files with 10 additions and 6 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue