ReaderHighlight: adjustable "Edit highlight" dialog position (#12599)

This commit is contained in:
hius07
2024-10-11 19:26:33 +03:00
committed by GitHub
parent 85591c75ce
commit f143f5f8b1
2 changed files with 36 additions and 10 deletions

View File

@@ -628,7 +628,7 @@ function CreDocument:getImageFromPosition(pos, want_frames, accept_cre_scalable_
end
end
function CreDocument:getWordFromPosition(pos)
function CreDocument:getWordFromPosition(pos, do_not_draw_selection)
local wordbox = {
page = self._document:getCurrentPage(),
}
@@ -641,7 +641,11 @@ function CreDocument:getWordFromPosition(pos)
local word_found = false
local box_found = false
local text_range = self._document:getTextFromPositions(pos.x, pos.y, pos.x, pos.y)
local drawSelection, drawSegmentedSelection
if do_not_draw_selection then
drawSelection, drawSegmentedSelection = false, false
end
local text_range = self._document:getTextFromPositions(pos.x, pos.y, pos.x, pos.y, drawSelection, drawSegmentedSelection)
logger.dbg("CreDocument: get text range", text_range)
if text_range then
if text_range.text and text_range.text ~= "" then