|
@@ -149,6 +149,7 @@ class PDFViewer {
|
|
|
this.viewer = options.viewer || options.container.firstElementChild;
|
|
|
this.annotationStore = options.annotationStore
|
|
|
this.messageHandler = options.messageHandler
|
|
|
+ this.exitPresentationMode = false
|
|
|
if (this.container?.tagName !== "DIV" || this.viewer?.tagName !== "DIV") {
|
|
|
throw new Error("Invalid `container` and/or `viewer` option.");
|
|
|
}
|
|
@@ -979,6 +980,7 @@ class PDFViewer {
|
|
|
this.#scaleTimeoutId = setTimeout(() => {
|
|
|
this.#scaleTimeoutId = null;
|
|
|
this.refresh();
|
|
|
+ this.exitPresentationMode = false
|
|
|
}, drawingDelay);
|
|
|
}
|
|
|
|
|
@@ -1343,7 +1345,7 @@ class PDFViewer {
|
|
|
}
|
|
|
|
|
|
async update() {
|
|
|
- if (this.#scaleTimeoutId !== null) {
|
|
|
+ if (this.#scaleTimeoutId !== null && (!this.isInPresentationMode && !this.exitPresentationMode)) {
|
|
|
clearTimeout(this.#scaleTimeoutId);
|
|
|
this.#scaleTimeoutId = null;
|
|
|
}
|
|
@@ -1519,8 +1521,10 @@ class PDFViewer {
|
|
|
const renderingTask = []
|
|
|
for (let i = 0; i < visiblePages.views.length; i++) {
|
|
|
const pageView = visiblePages.views[i].view
|
|
|
- if (pageView.renderingState === RenderingStates.FINISHED) {
|
|
|
+ if (pageView.renderingState === RenderingStates.FINISHED && pageView.canvas) {
|
|
|
continue
|
|
|
+ } else if (pageView.renderingState === RenderingStates.FINISHED) {
|
|
|
+ pageView.reset()
|
|
|
}
|
|
|
await this.#ensurePdfPageLoaded(pageView).then(() => {
|
|
|
renderingTask.push(pageView.draw())
|
|
@@ -2007,7 +2011,7 @@ class PDFViewer {
|
|
|
for (const pageView of this._pages) {
|
|
|
pageView.update(updateArgs);
|
|
|
}
|
|
|
- if (this.#scaleTimeoutId !== null && !this.isInPresentationMode) {
|
|
|
+ if (this.#scaleTimeoutId !== null && (!this.isInPresentationMode && !this.exitPresentationMode)) {
|
|
|
clearTimeout(this.#scaleTimeoutId);
|
|
|
this.#scaleTimeoutId = null;
|
|
|
}
|