Check if there is only one line between the two positions and no
word boxes are found, if so break the loop immediately.
pull/153/head
chrox 11 years ago
parent 5a3f239e8a
commit 56c8b28f7c

@ -355,6 +355,7 @@ function ReaderHighlight:getTextFromPositions(boxes, pos0, pos1)
j_start, j_stop = j_stop, j_start
end
for i = i_start, i_stop do
if i_start == i_stop and #boxes[i] == 0 then break end
-- insert line words
local j0 = i > i_start and 1 or j_start
local j1 = i < i_stop and #boxes[i] or j_stop

Loading…
Cancel
Save