Fix selected word non-highlighted on PDF

Optimisation for CRE from dd74194e made it not work with
KOpt-based documents.
This commit is contained in:
poire-z
2021-01-09 21:59:29 +01:00
parent 9ec3dcb376
commit 27b493afef

View File

@@ -762,11 +762,13 @@ function ReaderHighlight:onHold(arg, ges)
local boxes = {}
table.insert(boxes, self.selected_word.sbox)
self.view.highlight.temp[self.hold_pos.page] = boxes
-- Unfortunately, getWordFromPosition() may not return good coordinates,
-- so refresh the whole page
UIManager:setDirty(self.dialog, "ui")
else
-- With crengine, getWordFromPosition() does return good coordinates
UIManager:setDirty(self.dialog, "ui", self.selected_word.sbox)
end
-- Unfortunately, CREngine does not return good coordinates
-- UIManager:setDirty(self.dialog, "ui")
-- But now it does:
UIManager:setDirty(self.dialog, "ui", self.selected_word.sbox)
self:_resetHoldTimer()
if word.pos0 then
-- Remember original highlight start position, so we can show