mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
Merge pull request #18171 from Snuffleupagus/move-pendingTextLayers
Don't register a pending `TextLayer` until `render` is invoked (PR 18104 follow-up)
This commit is contained in:
commit
ee545930ea
1 changed files with 2 additions and 1 deletions
|
@ -122,7 +122,6 @@ class TextLayer {
|
|||
|
||||
setLayerDimensions(container, viewport);
|
||||
|
||||
TextLayer.#pendingTextLayers.add(this);
|
||||
// Always clean-up the temporary canvas once rendering is no longer pending.
|
||||
this.#capability.promise
|
||||
.catch(() => {
|
||||
|
@ -167,6 +166,7 @@ class TextLayer {
|
|||
}, this.#capability.reject);
|
||||
};
|
||||
this.#reader = this.#textContentSource.getReader();
|
||||
TextLayer.#pendingTextLayers.add(this);
|
||||
pump();
|
||||
|
||||
return this.#capability.promise;
|
||||
|
@ -423,6 +423,7 @@ class TextLayer {
|
|||
return;
|
||||
}
|
||||
this.#ascentCache.clear();
|
||||
|
||||
for (const { canvas } of this.#canvasContexts.values()) {
|
||||
canvas.remove();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue