mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
credocument reader optimisation (avoid multiple TOC builds) (#3292)
Avoid unnecessary work in ReaderView:onSetViewMode() and ReaderRolling:updatePos() that would result in TOC being reset and rebuilt (which can take time on books with huge TOC) during reader setup.
This commit is contained in:
@@ -96,9 +96,9 @@ function CreDocument:init()
|
||||
-- @TODO check the default view_mode to a global user configurable
|
||||
-- variable 22.12 2012 (houqp)
|
||||
local ok
|
||||
ok, self._document = pcall(cre.newDocView,
|
||||
Screen:getWidth(), Screen:getHeight(), self.PAGE_VIEW_MODE
|
||||
)
|
||||
ok, self._document = pcall(cre.newDocView, Screen:getWidth(), Screen:getHeight(),
|
||||
DCREREADER_VIEW_MODE == "scroll" and self.SCROLL_VIEW_MODE or self.PAGE_VIEW_MODE
|
||||
) -- this mode must be the same as the default one set as ReaderView.view_mode
|
||||
if not ok then
|
||||
error(self._document) -- will contain error message
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user