diff options
author | Alex Yatskov <alex@foosoft.net> | 2016-04-23 21:24:45 -0700 |
---|---|---|
committer | Alex Yatskov <alex@foosoft.net> | 2016-04-23 21:24:45 -0700 |
commit | 659bb87a59c2f53e8144998fe1d3067526a83897 (patch) | |
tree | f7f449c4cd26be0cab8317741379076faeea68be /ext/fg/js/range.js | |
parent | c8d0ef50046dde2e3214a242674dff3c6dbf2a45 (diff) |
Mostly working
Diffstat (limited to 'ext/fg/js/range.js')
-rw-r--r-- | ext/fg/js/range.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/ext/fg/js/range.js b/ext/fg/js/range.js index cf568a9c..85430a7b 100644 --- a/ext/fg/js/range.js +++ b/ext/fg/js/range.js @@ -35,16 +35,16 @@ class Range { return null; } - range.setEnd(node, offset + length); + this.range.setEnd(node, offset + length); return length; } containsPoint(point) { - const rect = this.paddedRect(); + const rect = this.getBoundingClientRect(); return point.x >= rect.left && point.x <= rect.right; } - paddedRect() { + getBoundingClientRect() { const range = this.range.cloneRange(); const startOffset = range.startOffset; const endOffset = range.endOffset; @@ -72,8 +72,8 @@ class Range { equals(range) { const equal = - range.compareBoundaryPoints(Range.END_TO_END, this.range) === 0 && - range.compareBoundaryPoints(Range.START_TO_START, this.range) === 0; + range.range.compareBoundaryPoints(Range.END_TO_END, this.range) === 0 && + range.range.compareBoundaryPoints(Range.START_TO_START, this.range) === 0; return equal; |