readerannotation: fix pdf page bookmark conversion

reviewable/pr11761/r1
hius07 4 weeks ago committed by GitHub
parent 5cabe255ae
commit 4715219516
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -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

Loading…
Cancel
Save