mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
EPUB links: show footnotes in popup, larger tap area (#4261)
Adds new options to the Links> submenu, for now only available and used with CRE documents. - Allow larger tap area around links - Ignore external links - Show footnotes in popup - Show more links as footnotes (This last item is mostly for testing and loosening the footnote detection algorithm, and see how it would behave with glossary-like links and inter glossary terms links.) Fix distance computation from gesture position to link by using segments. Code for detecting if a link is a footnote is in cre.cpp, and tweakable a bit with flags in ReaderLink:showAsFoonotePopup(). Footnotes HTML content is displayed by a new FootnoteWidget, which uses MuPDF for its rendering. From it, swipe south or tap outside to close, swipe to the left to follow the original link and jump to the footnote location in the book. Also fix tap on highlights after the recent change to use segments for displaying: use segments also when checking taps.
This commit is contained in:
@@ -223,7 +223,7 @@ function ReaderHighlight:onTapXPointerSavedHighlight(ges)
|
||||
-- (A highlight starting on cur_page-17 and ending on cur_page+13 is
|
||||
-- a highlight to consider)
|
||||
if start_page <= cur_page + neighbour_pages and end_page >= cur_page - neighbour_pages then
|
||||
local boxes = self.ui.document:getScreenBoxesFromPositions(pos0, pos1)
|
||||
local boxes = self.ui.document:getScreenBoxesFromPositions(pos0, pos1, true) -- get_segments=true
|
||||
if boxes then
|
||||
for index, box in pairs(boxes) do
|
||||
if inside_box(pos, box) then
|
||||
|
||||
Reference in New Issue
Block a user