Simplify options passed to docRangeFromPoint
This commit is contained in:
parent
4b5138b96e
commit
cab2a39981
@ -106,8 +106,7 @@ function docElementsFromPoint(x, y, all) {
|
|||||||
return e !== null ? [e] : [];
|
return e !== null ? [e] : [];
|
||||||
}
|
}
|
||||||
|
|
||||||
function docRangeFromPoint(x, y, options) {
|
function docRangeFromPoint(x, y, deepDomScan) {
|
||||||
const deepDomScan = options.scanning.deepDomScan;
|
|
||||||
const elements = docElementsFromPoint(x, y, deepDomScan);
|
const elements = docElementsFromPoint(x, y, deepDomScan);
|
||||||
let imposter = null;
|
let imposter = null;
|
||||||
let imposterContainer = null;
|
let imposterContainer = null;
|
||||||
|
@ -144,7 +144,7 @@ class Display {
|
|||||||
try {
|
try {
|
||||||
e.preventDefault();
|
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) {
|
if (textSource === null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -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)) {
|
if (this.textSourceCurrent !== null && this.textSourceCurrent.equals(textSource)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user