From e7d8bffa6ac23aabeb0818380c878206909d4e3a Mon Sep 17 00:00:00 2001 From: kuuuube Date: Sat, 25 May 2024 13:57:07 -0400 Subject: [PATCH] Clear mouse position on popup close --- ext/js/app/frontend.js | 6 ++++++ ext/js/language/text-scanner.js | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/ext/js/app/frontend.js b/ext/js/app/frontend.js index cc71311ddd..c856ae0f41 100644 --- a/ext/js/app/frontend.js +++ b/ext/js/app/frontend.js @@ -349,6 +349,7 @@ export class Frontend { */ _onClosePopups() { this._clearSelection(true); + this._clearMousePosition(); } /** @@ -438,6 +439,11 @@ export class Frontend { this._textScanner.clearSelection(); } + /** */ + _clearMousePosition() { + this._textScanner.clearMousePosition(); + } + /** * @param {number} delay * @param {boolean} restart diff --git a/ext/js/language/text-scanner.js b/ext/js/language/text-scanner.js index 17809300db..0d8e49b1ea 100644 --- a/ext/js/language/text-scanner.js +++ b/ext/js/language/text-scanner.js @@ -364,6 +364,11 @@ export class TextScanner extends EventDispatcher { } } + /** */ + clearMousePosition() { + this._lastMouseMove = null; + } + /** * @returns {?import('text-source').TextSource} */