1818// eslint-disable-next-line max-len
1919/** @typedef {import("../src/display/display_utils").PageViewport } PageViewport */
2020/** @typedef {import("./event_utils").EventBus } EventBus */
21- /** @typedef {import("./interfaces").IRenderableView } IRenderableView */
2221// eslint-disable-next-line max-len
2322/** @typedef {import("./pdf_rendering_queue").PDFRenderingQueue } PDFRenderingQueue */
2423
@@ -27,8 +26,8 @@ import {
2726 OutputScale ,
2827 RenderingCancelledException ,
2928} from "pdfjs-lib" ;
29+ import { RenderableView , RenderingStates } from "./renderable_view.js" ;
3030import { AppOptions } from "./app_options.js" ;
31- import { RenderingStates } from "./ui_utils.js" ;
3231
3332const DRAW_UPSCALE_FACTOR = 2 ; // See comment in `PDFThumbnailView.draw` below.
3433const MAX_NUM_SCALING_STEPS = 3 ;
@@ -78,10 +77,9 @@ class TempImageFactory {
7877 }
7978}
8079
81- /**
82- * @implements {IRenderableView}
83- */
84- class PDFThumbnailView {
80+ class PDFThumbnailView extends RenderableView {
81+ #renderingState = RenderingStates . INITIAL ;
82+
8583 /**
8684 * @param {PDFThumbnailViewOptions } options
8785 */
@@ -98,6 +96,7 @@ class PDFThumbnailView {
9896 pageColors,
9997 enableSplitMerge = false ,
10098 } ) {
99+ super ( ) ;
101100 this . id = id ;
102101 this . renderingId = `thumbnail${ id } ` ;
103102 this . pageLabel = null ;
@@ -115,9 +114,6 @@ class PDFThumbnailView {
115114 this . linkService = linkService ;
116115 this . renderingQueue = renderingQueue ;
117116
118- this . renderTask = null ;
119- this . renderingState = RenderingStates . INITIAL ;
120- this . resume = null ;
121117 this . placeholder = null ;
122118
123119 const imageContainer = ( this . div = document . createElement ( "div" ) ) ;
@@ -162,6 +158,14 @@ class PDFThumbnailView {
162158 this . image . style . height = `${ canvasHeight } px` ;
163159 }
164160
161+ get renderingState ( ) {
162+ return this . #renderingState;
163+ }
164+
165+ set renderingState ( state ) {
166+ this . #renderingState = state ;
167+ }
168+
165169 setPdfPage ( pdfPage ) {
166170 this . pdfPage = pdfPage ;
167171 this . pdfPageRotate = pdfPage . rotate ;
0 commit comments