From 442e75853b62035999d044692ee187add38392b1 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Thu, 9 Jul 2015 00:18:42 -0500 Subject: [PATCH] Base textNodeLength on textNode.textContent.length This is how we were computing the length previously. Not sure what the difference is but I want to keep it the same. --- src/lines-tile-component.coffee | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lines-tile-component.coffee b/src/lines-tile-component.coffee index 8af408da5..8a35bc4e3 100644 --- a/src/lines-tile-component.coffee +++ b/src/lines-tile-component.coffee @@ -346,15 +346,15 @@ class LinesTileComponent rangeForMeasurement ?= document.createRange() iterator = document.createNodeIterator(lineNode, NodeFilter.SHOW_TEXT, AcceptFilter) textNode = iterator.nextNode() - textNodeLength = textNode.length + textNodeLength = textNode.textContent.length textNodeIndex = 0 - nextTextNodeIndex = textNode.textContent.length + nextTextNodeIndex = textNodeLength while nextTextNodeIndex <= charIndex textNode = iterator.nextNode() - textNodeLength = textNode.length + textNodeLength = textNode.textContent.length textNodeIndex = nextTextNodeIndex - nextTextNodeIndex = textNodeIndex + textNode.textContent.length + nextTextNodeIndex = textNodeIndex + textNodeLength i = charIndex - textNodeIndex rangeForMeasurement.setStart(textNode, i)