1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-22 16:18:08 +02:00

Merge pull request #15778 from Snuffleupagus/keep-structTree

Don't re-create the `structTreeLayer` on zooming and rotation
This commit is contained in:
Jonas Jenwald 2022-12-06 10:02:20 +01:00 committed by GitHub
commit cdd39ec69e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 51 additions and 86 deletions

View file

@ -1623,9 +1623,7 @@ class PDFPageProxy {
* or `null` when no structure tree is present for the current page.
*/
getStructTree() {
return (this._structTreePromise ||= this._transport.getStructTree(
this._pageIndex
));
return this._transport.getStructTree(this._pageIndex);
}
/**
@ -1659,7 +1657,6 @@ class PDFPageProxy {
this._bitmaps.clear();
this._annotationPromises.clear();
this._jsActionsPromise = null;
this._structTreePromise = null;
this.pendingCleanup = false;
return Promise.all(waitOn);
}
@ -1694,7 +1691,6 @@ class PDFPageProxy {
this.objs.clear();
this._annotationPromises.clear();
this._jsActionsPromise = null;
this._structTreePromise = null;
if (resetStats && this._stats) {
this._stats = new StatTimer();
}