From d77b5118495e9b07f184c921ee615d1398a8ef4f Mon Sep 17 00:00:00 2001 From: poire-z Date: Fri, 16 Feb 2024 20:09:14 +0100 Subject: [PATCH] bump crengine: text selection and footnotes fixes and tweaks Includes: - LvDocView: allow setting custom title/authors/series - elementFromPoint(): fix possible crash when float at end of document - Non-linear fragments: fix generic handling on erm_final - DrawBorder: fix bottom border inset/outset drawing - getSegmentRects(): allow segments to include images - getRangeText(): allow gathering images - Allow standalone image in link to trigger in-page footnotes - ldomDocument::render(): avoid uneeded deserialization on each page turn - lvtinydom: add ldomNode::getAllInnerAttributeValues() - LVFootNote: avoid retrieving internal CompactArray object - In-page footnotes: allows for multiple id= inside them cre.cpp: - rename overrideDocumentProp() to setAltDocumentProp() - isLinkToFootnote(): handle image-only links - text selection functions: add includeImages param --- base | 2 +- frontend/apps/reader/modules/readerlink.lua | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/base b/base index b6ca09e06..8f5f38d73 160000 --- a/base +++ b/base @@ -1 +1 @@ -Subproject commit b6ca09e06615df75f2219270a5e09d8ea331cd00 +Subproject commit 8f5f38d732bba170abdae5df015f9f4b475fac6e diff --git a/frontend/apps/reader/modules/readerlink.lua b/frontend/apps/reader/modules/readerlink.lua index da9f8faca..a28a5e182 100644 --- a/frontend/apps/reader/modules/readerlink.lua +++ b/frontend/apps/reader/modules/readerlink.lua @@ -1058,7 +1058,9 @@ function ReaderLink:onGoToPageLink(ges, internal_links_only, max_distance) for _, link in ipairs(links) do -- link.uri may be an empty string with some invalid links: ignore them if link.section or (link.uri and link.uri ~= "") then - if link.segments then + -- Note: we may get segments empty in some conditions (in which + -- case we'll fallback to the 'else' branch and using x/y) + if link.segments and #link.segments > 0 then -- With segments, each is a horizontal segment, with start_x < end_x, -- and we should compute the distance from gesture position to -- each segment.