diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2022-09-20 21:06:39 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-20 21:06:39 -0400 |
commit | 480869c3d1d820b344d23989d2deae64a594869e (patch) | |
tree | bc1d0c5143b71e312322e3dc851cb2c98050b8c6 /ext/js/dom/text-source-range.js | |
parent | ac373a67944a3241f96091b2bcd94f1b337a3940 (diff) |
Exclude documentElement from zoom calculation (#2227)
* Exclude documentElement from zoom calculation
* Add an option
* Refactor zoom coordinate conversion functions
* Convert zoom coordinates for text sources
* Rename variable
* Convert rect coordinate spaces
* Handle shadow DOM
Diffstat (limited to 'ext/js/dom/text-source-range.js')
-rw-r--r-- | ext/js/dom/text-source-range.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/js/dom/text-source-range.js b/ext/js/dom/text-source-range.js index 5e3e814c..6c35c4cb 100644 --- a/ext/js/dom/text-source-range.js +++ b/ext/js/dom/text-source-range.js @@ -91,11 +91,11 @@ class TextSourceRange { } getRect() { - return this._range.getBoundingClientRect(); + return DocumentUtil.convertRectZoomCoordinates(this._range.getBoundingClientRect(), this._range.startContainer); } getRects() { - return this._range.getClientRects(); + return DocumentUtil.convertMultipleRectZoomCoordinates(this._range.getClientRects(), this._range.startContainer); } getWritingMode() { |