PDF written highlights: fix boxes, trash cached tiles

TileCacheItem: add created_ts property.
Document: manage a tile_cache_validity_ts and ignore
older cached tiles.
This timestamps is updated when highlights are written
as annotations in, or deleted from, the PDF, so we can
get the most current rendered bitmap from MuPDF and
avoid highlight ghosts on old tiles.
Save this timestamp in doc settings so older cached to
disk tiles will also be ignored across re-openings.
Bump base for: mupdf.lua: update frontend pboxes with
MuPDF adjusted ones.
This commit is contained in:
poire-z
2021-07-18 19:56:19 +02:00
parent eeb09d2150
commit e3bac94db1
5 changed files with 49 additions and 3 deletions

View File

@@ -17,6 +17,7 @@ function TileCacheItem:totable()
size = self.size,
pageno = self.pageno,
excerpt = self.excerpt,
created_ts = self.created_ts,
persistent = self.persistent,
bb = {
w = self.bb.w,
@@ -51,6 +52,7 @@ function TileCacheItem:fromtable(t)
self.size = t.size
self.pageno = t.pageno
self.excerpt = t.excerpt
self.created_ts = t.created_ts
self.persistent = t.persistent
self.bb = Blitbuffer.fromstring(t.bb.w, t.bb.h, t.bb.fmt, t.bb.data, t.bb.stride)
end