Speed up page turning on big cre documents (#3740)

Page turning, menu opening, ... everything actually
This commit is contained in:
poire-z
2018-03-12 20:46:40 +01:00
committed by GitHub
parent c5b547f6b3
commit 7d71d73cc4
2 changed files with 22 additions and 0 deletions

View File

@@ -99,6 +99,9 @@ function ReaderRolling:init()
end)
table.insert(self.ui.postReaderCallback, function()
self:updatePos()
-- Disable crengine internal history, with required redraw
self.ui.document:enableInternalHistory(false)
self:onRedrawCurrentView()
end)
self.ui.menu:registerToMainMenu(self)
end
@@ -566,10 +569,16 @@ function ReaderRolling:onSetDimensions(dimen)
end
function ReaderRolling:onChangeScreenMode(mode)
-- We need to temporarily re-enable internal history as crengine
-- uses it to reposition after resize
self.ui.document:enableInternalHistory(true)
self.ui:handleEvent(Event:new("SetScreenMode", mode))
self.ui.document:setViewDimen(Screen:getSize())
self:onChangeViewMode()
self:onUpdatePos()
-- Re-disable internal history, with required redraw
self.ui.document:enableInternalHistory(false)
self:onRedrawCurrentView()
end
function ReaderRolling:onColorRenderingUpdate()