1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-22 16:18:08 +02:00

Merge pull request #14780 from Snuffleupagus/rm-CSS-viewport-scale-factor

Replace the `--viewport-scale-factor` CSS variable
This commit is contained in:
Tim van der Meij 2022-04-14 21:12:29 +02:00 committed by GitHub
commit 3f5c31e203
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 10 deletions

View file

@ -1012,10 +1012,6 @@ class BaseViewer {
}
this._doc.style.setProperty("--zoom-factor", newScale);
this._doc.style.setProperty(
"--viewport-scale-factor",
newScale * PixelsPerInch.PDF_TO_CSS_UNITS
);
const updateArgs = { scale: newScale };
for (const pageView of this._pages) {

View file

@ -329,16 +329,14 @@ class PDFPageView {
}
const totalRotation = (this.rotation + this.pdfPageRotate) % 360;
const viewportScale = this.scale * PixelsPerInch.PDF_TO_CSS_UNITS;
this.viewport = this.viewport.clone({
scale: viewportScale,
scale: this.scale * PixelsPerInch.PDF_TO_CSS_UNITS,
rotation: totalRotation,
});
if (this._isStandalone) {
const { style } = document.documentElement;
style.setProperty("--zoom-factor", this.scale);
style.setProperty("--viewport-scale-factor", viewportScale);
}
if (this.svg) {

View file

@ -22,7 +22,6 @@
--page-border: 9px solid transparent;
--spreadHorizontalWrapped-margin-LR: -3.5px;
--zoom-factor: 1;
--viewport-scale-factor: 1;
}
@media screen and (forced-colors: active) {