Merge pull request #15796 from Snuffleupagus/issue-15795

Ensure that the various layers always get the correct initial size (issue 15795)
This commit is contained in:
Jonas Jenwald 2022-12-09 17:26:35 +01:00 committed by GitHub
commit 9d4aadbf7a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 0 deletions

View File

@ -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

View File

@ -747,6 +747,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 =