From cab2a3998169040a6a6d5bda828d4a8af5592cd6 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Tue, 17 Dec 2019 20:56:32 -0500 Subject: Simplify options passed to docRangeFromPoint --- ext/fg/js/document.js | 3 +-- ext/mixed/js/display.js | 2 +- ext/mixed/js/text-scanner.js | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) (limited to 'ext') diff --git a/ext/fg/js/document.js b/ext/fg/js/document.js index d54a2e44..fa7e7cbc 100644 --- a/ext/fg/js/document.js +++ b/ext/fg/js/document.js @@ -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; diff --git a/ext/mixed/js/display.js b/ext/mixed/js/display.js index ab0674a9..f3b5dd2a 100644 --- a/ext/mixed/js/display.js +++ b/ext/mixed/js/display.js @@ -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; } diff --git a/ext/mixed/js/text-scanner.js b/ext/mixed/js/text-scanner.js index ac5d68d1..9a739c7e 100644 --- a/ext/mixed/js/text-scanner.js +++ b/ext/mixed/js/text-scanner.js @@ -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; } -- cgit v1.2.3