mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
synchronize hightlights in non-/reflowing modes
and there is no need to OCR word if we can extract text from original page in reflowing mode thanks to the rect maps between normal page and reflowed page.
This commit is contained in:
@@ -331,12 +331,16 @@ function ReaderView:drawSavedHighlight(bb, x, y)
|
||||
local items = self.highlight.saved[page]
|
||||
if not items then items = {} end
|
||||
for i = 1, #items do
|
||||
for j = 1, #items[i].boxes do
|
||||
local rect = self:pageToScreenTransform(page, items[i].boxes[j])
|
||||
if rect then
|
||||
self:drawHighlightRect(bb, x, y, rect, self.highlight.saved_drawer)
|
||||
end
|
||||
end -- end for each box
|
||||
local pos0, pos1 = items[i].pos0, items[i].pos1
|
||||
local boxes = self.ui.document:getPageBoxesFromPositions(page, pos0, pos1)
|
||||
if boxes then
|
||||
for _, box in pairs(boxes) do
|
||||
local rect = self:pageToScreenTransform(page, box)
|
||||
if rect then
|
||||
self:drawHighlightRect(bb, x, y, rect, self.highlight.saved_drawer)
|
||||
end
|
||||
end -- end for each box
|
||||
end -- end if boxes
|
||||
end -- end for each hightlight
|
||||
end -- end for each page
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user