Simplify options passed to docRangeFromPoint

This commit is contained in:
toasted-nutbread 2019-12-17 20:56:32 -05:00
parent 4b5138b96e
commit cab2a39981
3 changed files with 3 additions and 4 deletions

View File

@ -106,8 +106,7 @@ function docElementsFromPoint(x, y, all) {
return e !== null ? [e] : [];
}
function docRangeFromPoint(x, y, options) {
const deepDomScan = options.scanning.deepDomScan;
function docRangeFromPoint(x, y, deepDomScan) {
const elements = docElementsFromPoint(x, y, deepDomScan);
let imposter = null;
let imposterContainer = null;

View File

@ -144,7 +144,7 @@ class Display {
try {
e.preventDefault();
const textSource = docRangeFromPoint(e.clientX, e.clientY, this.options);
const textSource = docRangeFromPoint(e.clientX, e.clientY, this.options.scanning.deepDomScan);
if (textSource === null) {
return false;
}

View File

@ -297,7 +297,7 @@ class TextScanner {
}
}
const textSource = docRangeFromPoint(x, y, this.options);
const textSource = docRangeFromPoint(x, y, this.options.scanning.deepDomScan);
if (this.textSourceCurrent !== null && this.textSourceCurrent.equals(textSource)) {
return;
}