Annotations: fixes (#11761)

This commit is contained in:
hius07
2024-05-07 19:54:57 +03:00
committed by GitHub
parent c47d3b3177
commit 725df17c45
4 changed files with 8 additions and 9 deletions

View File

@@ -26,6 +26,11 @@ function ReaderAnnotation:buildAnnotation(bm, highlights, init)
end
pageno = self.ui.paging and bm.page or self.document:getPageFromXPointer(bm.page)
end
if self.ui.paging and bm.pos0 and not bm.pos0.page then
-- old single-page reflow highlights do not have page in position
bm.pos0.page = bm.page
bm.pos1.page = bm.page
end
if not hl then -- page bookmark or orphaned bookmark
hl = {}
if bm.highlighted then -- orphaned bookmark
@@ -40,13 +45,6 @@ function ReaderAnnotation:buildAnnotation(bm, highlights, init)
end
end
end
if self.ui.paging then
-- old single-page reflow highlights do not have page in position
if not bm.pos0.page then
bm.pos0.page = bm.page
bm.pos1.page = bm.page
end
end
return { -- annotation
datetime = bm.datetime, -- creation time, not changeable
drawer = hl.drawer, -- highlight drawer