Annotations: fixes (#11761)

reviewable/pr11775/r1
hius07 3 weeks ago committed by GitHub
parent c47d3b3177
commit 725df17c45
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

@ -1124,7 +1124,7 @@ function ReaderBookmark:setHighlightedText(item, text)
self.ui.annotation.annotations[index].text_edited = edited
-- item table
item.text_orig = text
item.text = self.display_prefix[item.type] .. (item.note or text)
item.text = self:getBookmarkItemText(item)
item.text_edited = edited
if edited then
self.refresh()

@ -1119,6 +1119,7 @@ function ReaderHighlight:_getHighlightMenuAnchor()
if self.ui.paging then
text_box = self.view:pageToScreenTransform(self.ui.paging.current_page, text_box)
end
if text_box == nil then return end -- fallback to "center"
anchor_y = text_box.y + text_box.h + Size.padding.small -- do not stick to the box
if anchor_y + dialog_box.h <= self.screen_h - Size.padding.small then -- enough room below box with gest_pos
prefers_pop_down = true

@ -222,7 +222,7 @@ function ReaderView:paintTo(bb, x, y)
self.arrow:paintTo(bb, 0, self.dim_area.y == 0 and self.dim_area.h - center_offset or self.dim_area.y - center_offset)
elseif self.page_overlap_style == "line" then
bb:paintRect(0, self.dim_area.y == 0 and self.dim_area.h or self.dim_area.y,
self.dim_area.w, Size.line.medium, Blitbuffer.COLOR_BLACK)
self.dim_area.w, Size.line.medium, Blitbuffer.COLOR_DARK_GRAY)
end
end
-- draw saved highlight

Loading…
Cancel
Save