mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Fix bug #151
Check if there is only one line between the two positions and no word boxes are found, if so break the loop immediately.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user