mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-23 08:38:06 +02:00
Actually disable TextLayerRenderTask.prototype.#processItems
when MAX_TEXT_DIVS_TO_RENDER
is reached (PR 18089 follow-up)
I broke this accidentally in PR 18089, sorry about that! Note that since `#processItems` is private we can no longer just "replace" the method as was done in PR 18052.
This commit is contained in:
parent
4db843617f
commit
d5f3829f91
1 changed files with 6 additions and 1 deletions
|
@ -192,6 +192,8 @@ function layout(params) {
|
|||
}
|
||||
|
||||
class TextLayerRenderTask {
|
||||
#disableProcessItems = false;
|
||||
|
||||
#reader = null;
|
||||
|
||||
#textContentSource = null;
|
||||
|
@ -278,6 +280,9 @@ class TextLayerRenderTask {
|
|||
}
|
||||
|
||||
#processItems(items, lang) {
|
||||
if (this.#disableProcessItems) {
|
||||
return;
|
||||
}
|
||||
if (!this._layoutTextParams.ctx) {
|
||||
this._textDivProperties.set(this._rootContainer, { lang });
|
||||
this._layoutTextParams.ctx = getCtx(lang);
|
||||
|
@ -291,7 +296,7 @@ class TextLayerRenderTask {
|
|||
if (textDivs.length > MAX_TEXT_DIVS_TO_RENDER) {
|
||||
warn("Ignoring additional textDivs for performance reasons.");
|
||||
|
||||
this._processItems = () => {}; // Avoid multiple warnings for one page.
|
||||
this.#disableProcessItems = true; // Avoid multiple warnings for one page.
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue