Fix issues caused by scanning ranges which don't start with a text node
The rects returned by range.getClientRects() could include the entire start element's bounding box.
This commit is contained in:
parent
a2139213c8
commit
c0bf6ff033
@ -195,6 +195,11 @@ function docSentenceExtract(source, extent) {
|
||||
}
|
||||
|
||||
function isPointInRange(x, y, range) {
|
||||
// Require a text node to start
|
||||
if (range.startContainer.nodeType !== Node.TEXT_NODE) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Scan forward
|
||||
const nodePre = range.endContainer;
|
||||
const offsetPre = range.endOffset;
|
||||
|
Loading…
Reference in New Issue
Block a user