Merge pull request #13874 from Snuffleupagus/components-annotation-zoom-factor
Update the Annotation `--zoom-factor` CSS variable when `PDFPageView` is used standalone (PR 13868 follow-up)
This commit is contained in:
commit
849bab973c
@ -202,7 +202,6 @@ class BaseViewer {
|
|||||||
} else {
|
} else {
|
||||||
this.renderingQueue = options.renderingQueue;
|
this.renderingQueue = options.renderingQueue;
|
||||||
}
|
}
|
||||||
|
|
||||||
this._doc = document.documentElement;
|
this._doc = document.documentElement;
|
||||||
|
|
||||||
this.scroll = watchScroll(this.container, this._scrollUpdate.bind(this));
|
this.scroll = watchScroll(this.container, this._scrollUpdate.bind(this));
|
||||||
@ -708,7 +707,6 @@ class BaseViewer {
|
|||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this._doc.style.setProperty("--zoom-factor", newScale);
|
this._doc.style.setProperty("--zoom-factor", newScale);
|
||||||
|
|
||||||
for (let i = 0, ii = this._pages.length; i < ii; i++) {
|
for (let i = 0, ii = this._pages.length; i < ii; i++) {
|
||||||
|
@ -110,6 +110,7 @@ class PDFPageView {
|
|||||||
this.renderingState = RenderingStates.INITIAL;
|
this.renderingState = RenderingStates.INITIAL;
|
||||||
this.resume = null;
|
this.resume = null;
|
||||||
this._renderError = null;
|
this._renderError = null;
|
||||||
|
this._isStandalone = !this.renderingQueue?.hasViewer();
|
||||||
|
|
||||||
this.annotationLayer = null;
|
this.annotationLayer = null;
|
||||||
this.textLayer = null;
|
this.textLayer = null;
|
||||||
@ -281,6 +282,10 @@ class PDFPageView {
|
|||||||
if (optionalContentConfigPromise instanceof Promise) {
|
if (optionalContentConfigPromise instanceof Promise) {
|
||||||
this._optionalContentConfigPromise = optionalContentConfigPromise;
|
this._optionalContentConfigPromise = optionalContentConfigPromise;
|
||||||
}
|
}
|
||||||
|
if (this._isStandalone) {
|
||||||
|
const doc = document.documentElement;
|
||||||
|
doc.style.setProperty("--zoom-factor", this.scale);
|
||||||
|
}
|
||||||
|
|
||||||
const totalRotation = (this.rotation + this.pdfPageRotate) % 360;
|
const totalRotation = (this.rotation + this.pdfPageRotate) % 360;
|
||||||
this.viewport = this.viewport.clone({
|
this.viewport = this.viewport.clone({
|
||||||
|
@ -60,6 +60,13 @@ class PDFRenderingQueue {
|
|||||||
return this.highestPriorityPage === view.renderingId;
|
return this.highestPriorityPage === view.renderingId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @returns {boolean}
|
||||||
|
*/
|
||||||
|
hasViewer() {
|
||||||
|
return !!this.pdfViewer;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Object} currentlyVisiblePages
|
* @param {Object} currentlyVisiblePages
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user