mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
restrict highlight in current page area
This should fix #588. Highlight in multiple pages is too complicated and requires large code refactoring and will not be considered for now.
This commit is contained in:
@@ -231,6 +231,13 @@ function ReaderHighlight:onHoldPan(arg, ges)
|
||||
DEBUG("no previous hold position")
|
||||
return true
|
||||
end
|
||||
local page_area = self.view:getScreenPageArea(self.hold_pos.page)
|
||||
DEBUG("current page area", page_area)
|
||||
if ges.pos:notIntersectWith(page_area) then
|
||||
DEBUG("not inside page area")
|
||||
return true
|
||||
end
|
||||
|
||||
self.holdpan_pos = self.view:screenToPageTransform(ges.pos)
|
||||
DEBUG("holdpan position in page", self.holdpan_pos)
|
||||
self.selected_text = self.ui.document:getTextFromPositions(self.hold_pos, self.holdpan_pos)
|
||||
|
||||
Reference in New Issue
Block a user