This commit is contained in:
Vanessa 2022-10-01 17:17:46 +08:00
parent ae8ce006ba
commit da71f8c4aa
44 changed files with 4505 additions and 3740 deletions

View file

@ -13,6 +13,11 @@
* limitations under the License.
*/
/** @typedef {import("./interfaces").IRenderableView} IRenderableView */
/** @typedef {import("./pdf_viewer").PDFViewer} PDFViewer */
// eslint-disable-next-line max-len
/** @typedef {import("./pdf_thumbnail_viewer").PDFThumbnailViewer} PDFThumbnailViewer */
import { RenderingCancelledException } from "./pdfjs";
import { RenderingStates } from "./ui_utils.js";
@ -189,16 +194,16 @@ class PDFRenderingQueue {
case RenderingStates.INITIAL:
this.highestPriorityPage = view.renderingId;
view
.draw()
.finally(() => {
this.renderHighestPriority();
})
.catch(reason => {
if (reason instanceof RenderingCancelledException) {
return;
}
console.error(`renderView: "${reason}"`);
});
.draw()
.finally(() => {
this.renderHighestPriority();
})
.catch(reason => {
if (reason instanceof RenderingCancelledException) {
return;
}
console.error(`renderView: "${reason}"`);
});
break;
}
return true;