mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-10 02:05:37 +02:00
Move --scale-factor variable in the viewer container (fix #15929)
When a css variable is update in a node then all the children under this node are updated. In order to avoid to update all the UI when a page is rescaling, this patch moves the --scale-factor from the :root to the viewer container.
This commit is contained in:
parent
e9c8aa63e3
commit
089ed6fb65
3 changed files with 11 additions and 6 deletions
|
@ -758,7 +758,7 @@ class PDFViewer {
|
|||
});
|
||||
// Ensure that the various layers always get the correct initial size,
|
||||
// see issue 15795.
|
||||
docStyle.setProperty("--scale-factor", viewport.scale);
|
||||
this.viewer.style.setProperty("--scale-factor", viewport.scale);
|
||||
|
||||
for (let pageNum = 1; pageNum <= pagesCount; ++pageNum) {
|
||||
const pageView = new PDFPageView({
|
||||
|
@ -1093,7 +1093,7 @@ class PDFViewer {
|
|||
return;
|
||||
}
|
||||
|
||||
docStyle.setProperty(
|
||||
this.viewer.style.setProperty(
|
||||
"--scale-factor",
|
||||
newScale * PixelsPerInch.PDF_TO_CSS_UNITS
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue