Merge pull request #10201 from Snuffleupagus/find-less-updatePage

Reduce the number of redundant `updatetextlayermatches` events dispatched when calculating matches in `PDFFindController`
This commit is contained in:
Tim van der Meij 2018-10-31 22:29:40 +01:00 committed by GitHub
commit bb5f261c58
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -345,7 +345,11 @@ class PDFFindController {
this._calculateWordMatch(query, pageIndex, pageContent, entireWord); this._calculateWordMatch(query, pageIndex, pageContent, entireWord);
} }
this._updatePage(pageIndex); // When `highlightAll` is set, ensure that the matches on previously
// rendered (and still active) pages are correctly highlighted.
if (this._state.highlightAll) {
this._updatePage(pageIndex);
}
if (this._resumePageIdx === pageIndex) { if (this._resumePageIdx === pageIndex) {
this._resumePageIdx = null; this._resumePageIdx = null;
this._nextPageMatch(); this._nextPageMatch();