mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user