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:
commit
3f5c31e203
4 changed files with 4 additions and 10 deletions
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue