You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: js/containers/imageContainer.js
+28Lines changed: 28 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -20,6 +20,9 @@ import { ca } from '../canvasAdapter.js';
20
20
// This cap is an arbitrarily high number, and hitting indicates a logic error.
21
21
constMAX_SKIPPED_RETRY=32;
22
22
23
+
// Above the largest size any surface displays a thumbnail at, so CSS only ever downscales and cells stay crisp on high-DPI screens.
24
+
constTHUMBNAIL_W=300;
25
+
23
26
/** @type {?boolean} */
24
27
let_sabCapability=null;
25
28
/**
@@ -163,6 +166,12 @@ export class ImageStore {
163
166
*/
164
167
thumbnails=[];
165
168
169
+
/**
170
+
* Keyed by the Blob rather than the page index because reordering pages permutes `thumbnails`, leaving an index-keyed URL pointing at another page's image.
171
+
* @type {Map<Blob, string>}
172
+
*/
173
+
thumbnailUrls=newMap();
174
+
166
175
/**
167
176
* Estimated cost of re-rendering each display slot (ms), from its last render with one-time work excluded.
168
177
* @type {Array<number|undefined>}
@@ -600,6 +609,23 @@ export class ImageStore {
600
609
returnp;
601
610
};
602
611
612
+
/**
613
+
* A single object URL for page `n`'s thumbnail, created once and reused by every display surface.
614
+
* @param {number} n
615
+
* @returns {Promise<?string>} The URL, or null if the page cannot be rendered.
.catch((err)=>console.error('Failed to load the debug menu:',err));
423
422
}
424
423
// Style the otherwise-empty start zone as a left-aligned flex row, with an 8px inset mirroring the end zone's, so the menu button sits at the left edge.
@@ -802,12 +801,9 @@ class ScribePDFViewer {
802
801
redactCueShown=true;
803
802
this._showToast('Marked for redaction — the content is removed when you export.');
804
803
};
805
-
// No toolbar button: redaction is reached through the context menu and the find bar's "Redact all".
806
-
// Building the tool sets `scribe._redactEnabled`, the context-menu gate, and installs region box-draw.
* Install a `setInitialPositionZoom` implementation on `ScribeViewer` based on the requested fit mode.
2475
2483
* @param {FitMode} fitMode
2476
2484
* @param {boolean} [isDefaultFit=false] - `fitMode` is the constructor default, not a caller choice.
2477
-
* Only then may the narrow-viewer width-fit override apply.
2485
+
* Only then may the width-fit override apply.
2478
2486
*/
2479
2487
_installFit(fitMode,isDefaultFit=false){
2480
2488
this.scribe.setInitialPositionZoom=(imgDims)=>{
@@ -2483,10 +2491,10 @@ class ScribePDFViewer {
2483
2491
conststageW=sc.clientWidth;
2484
2492
conststageH=sc.clientHeight;
2485
2493
2486
-
// When the default height-fit lays the page out wider than the viewport, every text line needs a horizontal pan, so the un-chosen default becomes width-fit.
2487
-
// The criterion is the overflow itself, not a viewport-width proxy.
0 commit comments