Skip to content

Commit

Permalink
Merge pull request #1126 from ftaffelt/fix-#999
Browse files Browse the repository at this point in the history
Fix #999: Ensure that the rotation in the viewer is not set too early
  • Loading branch information
VadimDez committed Sep 11, 2024
2 parents e15fea1 + ffc8f27 commit 57c4946
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/app/pdf-viewer/pdf-viewer.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
-moz-text-size-adjust: none;
text-size-adjust: none;
forced-color-adjust: none;
transform-origin: 0 0;
}

.textLayer span,
Expand Down
7 changes: 4 additions & 3 deletions src/app/pdf-viewer/pdf-viewer.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -561,9 +561,10 @@ export class PdfViewerComponent
this._rotation !== 0 ||
this.pdfViewer.pagesRotation !== this._rotation
) {
setTimeout(() => {
this.pdfViewer.pagesRotation = this._rotation;
});
// wait until at least the first page is available.
this.pdfViewer.firstPagePromise?.then(
() => (this.pdfViewer.pagesRotation = this._rotation)
);
}

if (this._stickToPage) {
Expand Down

0 comments on commit 57c4946

Please sign in to comment.