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.
pull/4848/head
poire-z 5 years ago
parent b7b4cdd2a7
commit a47f3a2765

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

Loading…
Cancel
Save