ReaderRolling: proper refresh when toggling scroll/page mode

When toggling between scroll and page modes multiple
times, _gotoXPointer() could find the xpointer to be
already positionned and avoid calling setDirty() (so
not enqueuing a whole screen refresh). But the page
will be slightly moved to account for the top margin
disappearing. We need that whole screen refresh in
such cases, so ensure one is enqueued.
This commit is contained in:
poire-z
2019-03-26 20:52:31 +01:00
parent b7b4cdd2a7
commit a47f3a2765

View File

@@ -688,6 +688,8 @@ function ReaderRolling:onChangeViewMode()
self.ui:handleEvent(Event:new("UpdateToc"))
if self.xpointer then
self:_gotoXPointer(self.xpointer)
-- Ensure a whole screen refresh is always enqueued
UIManager:setDirty(self.view.dialog, "partial")
else
table.insert(self.ui.postInitCallback, function()
self:_gotoXPointer(self.xpointer)