mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Fix occasional incoherent back xpointer when following a link (#4061)
In rare cases, the origin xpointer when following a link was detected as incoherent, and not used when going back, so no left margin marker was shown.
This commit is contained in:
@@ -174,8 +174,14 @@ function ReaderLink:isXpointerCoherent(a_xpointer)
|
||||
-- We should get the same a_xpointer. If not, crengine has messed up
|
||||
-- and we should not trust this xpointer to get back to this link.
|
||||
if re_a_xpointer ~= a_xpointer then
|
||||
logger.info("not coherent a_xpointer:", a_xpointer)
|
||||
return false
|
||||
-- Try it again with screen_x+1 (in the rare cases where screen_x
|
||||
-- fails, screen_x+1 usually works - probably something in crengine,
|
||||
-- but easier to workaround here that way)
|
||||
re_link_xpointer, re_a_xpointer = self.ui.document:getLinkFromPosition({x = screen_x+1, y = screen_y}) -- luacheck: no unused
|
||||
if re_a_xpointer ~= a_xpointer then
|
||||
logger.info("not coherent a_xpointer:", a_xpointer)
|
||||
return false
|
||||
end
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user