File tree 3 files changed +12
-2
lines changed
3 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -202,7 +202,6 @@ class BaseViewer {
202
202
} else {
203
203
this . renderingQueue = options . renderingQueue ;
204
204
}
205
-
206
205
this . _doc = document . documentElement ;
207
206
208
207
this . scroll = watchScroll ( this . container , this . _scrollUpdate . bind ( this ) ) ;
@@ -708,7 +707,6 @@ class BaseViewer {
708
707
}
709
708
return ;
710
709
}
711
-
712
710
this . _doc . style . setProperty ( "--zoom-factor" , newScale ) ;
713
711
714
712
for ( let i = 0 , ii = this . _pages . length ; i < ii ; i ++ ) {
Original file line number Diff line number Diff line change @@ -110,6 +110,7 @@ class PDFPageView {
110
110
this . renderingState = RenderingStates . INITIAL ;
111
111
this . resume = null ;
112
112
this . _renderError = null ;
113
+ this . _isStandalone = ! this . renderingQueue ?. hasViewer ( ) ;
113
114
114
115
this . annotationLayer = null ;
115
116
this . textLayer = null ;
@@ -281,6 +282,10 @@ class PDFPageView {
281
282
if ( optionalContentConfigPromise instanceof Promise ) {
282
283
this . _optionalContentConfigPromise = optionalContentConfigPromise ;
283
284
}
285
+ if ( this . _isStandalone ) {
286
+ const doc = document . documentElement ;
287
+ doc . style . setProperty ( "--zoom-factor" , this . scale ) ;
288
+ }
284
289
285
290
const totalRotation = ( this . rotation + this . pdfPageRotate ) % 360 ;
286
291
this . viewport = this . viewport . clone ( {
Original file line number Diff line number Diff line change @@ -60,6 +60,13 @@ class PDFRenderingQueue {
60
60
return this . highestPriorityPage === view . renderingId ;
61
61
}
62
62
63
+ /**
64
+ * @returns {boolean }
65
+ */
66
+ hasViewer ( ) {
67
+ return ! ! this . pdfViewer ;
68
+ }
69
+
63
70
/**
64
71
* @param {Object } currentlyVisiblePages
65
72
*/
You can’t perform that action at this time.
0 commit comments