Skip to content

Commit

Permalink
Ensure that the various layers always get the correct initial size (i…
Browse files Browse the repository at this point in the history
…ssue 15795)
  • Loading branch information
Snuffleupagus committed Dec 8, 2022
1 parent c639063 commit ea97ac9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
7 changes: 7 additions & 0 deletions web/pdf_page_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,13 @@ class PDFPageView {
PDFJSDev.test("!PRODUCTION || GENERIC")) &&
this._isStandalone
) {
// Ensure that the various layers always get the correct initial size,
// see issue 15795.
docStyle.setProperty(
"--scale-factor",
this.scale * PixelsPerInch.PDF_TO_CSS_UNITS
);

const { optionalContentConfigPromise } = options;
if (optionalContentConfigPromise) {
// Ensure that the thumbnails always display the *initial* document
Expand Down
4 changes: 4 additions & 0 deletions web/pdf_viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -746,6 +746,10 @@ class PDFViewer {
const viewport = firstPdfPage.getViewport({
scale: scale * PixelsPerInch.PDF_TO_CSS_UNITS,
});
// Ensure that the various layers always get the correct initial size,
// see issue 15795.
docStyle.setProperty("--scale-factor", viewport.scale);

const textLayerFactory =
textLayerMode !== TextLayerMode.DISABLE && !isPureXfa ? this : null;
const annotationLayerFactory =
Expand Down

0 comments on commit ea97ac9

Please sign in to comment.