Dispatcher: avoid multiple cre rerenderings when many settings changed (#9651)

When a gesture/profile was updating multiple cre settings,
each setting handler would emit UpdatePos which each would
force a re-rendering.
When this might be happening, postpone the rerendering
until all are set.
Needs some bit of refactoring to the events at play:
introduce "DocumentRerendered" event, and use it where
we used "UpdatePos" or "UpdateToc" to mean exactly that.
This commit is contained in:
poire-z
2022-10-25 13:16:01 +02:00
committed by GitHub
parent d1abbbfdd8
commit 48eb02318d
7 changed files with 58 additions and 28 deletions

View File

@@ -499,7 +499,7 @@ function ReaderThumbnail:onColorRenderingUpdate()
end
-- CRE: emitted after a re-rendering
ReaderThumbnail.onTocReset = ReaderThumbnail.resetCache
ReaderThumbnail.onDocumentRerendered = ReaderThumbnail.resetCache
-- Emitted When adding/removing/updating bookmarks and highlights
ReaderThumbnail.onBookmarkAdded = ReaderThumbnail.resetCachedPagesForBookmarks
ReaderThumbnail.onBookmarkRemoved = ReaderThumbnail.resetCachedPagesForBookmarks