|
|
@ -6,6 +6,7 @@ local Input = require("ui/input")
|
|
|
|
local Event = require("ui/event")
|
|
|
|
local Event = require("ui/event")
|
|
|
|
local GestureRange = require("ui/gesturerange")
|
|
|
|
local GestureRange = require("ui/gesturerange")
|
|
|
|
local ReaderPanning = require("ui/reader/readerpanning")
|
|
|
|
local ReaderPanning = require("ui/reader/readerpanning")
|
|
|
|
|
|
|
|
local UIManager = require("ui/uimanager")
|
|
|
|
local DEBUG = require("dbg")
|
|
|
|
local DEBUG = require("dbg")
|
|
|
|
local _ = require("gettext")
|
|
|
|
local _ = require("gettext")
|
|
|
|
|
|
|
|
|
|
|
@ -243,7 +244,7 @@ end
|
|
|
|
|
|
|
|
|
|
|
|
function ReaderRolling:onZoom()
|
|
|
|
function ReaderRolling:onZoom()
|
|
|
|
--@TODO re-read doc_height info after font or lineheight changes 05.06 2012 (houqp)
|
|
|
|
--@TODO re-read doc_height info after font or lineheight changes 05.06 2012 (houqp)
|
|
|
|
self:onUpdatePos()
|
|
|
|
self:updatePos()
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
--[[
|
|
|
|
--[[
|
|
|
@ -251,6 +252,11 @@ end
|
|
|
|
font has been changed, or line height has been changed.
|
|
|
|
font has been changed, or line height has been changed.
|
|
|
|
--]]
|
|
|
|
--]]
|
|
|
|
function ReaderRolling:onUpdatePos()
|
|
|
|
function ReaderRolling:onUpdatePos()
|
|
|
|
|
|
|
|
UIManager:scheduleIn(0.1, function () self:updatePos() end)
|
|
|
|
|
|
|
|
return true
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function ReaderRolling:updatePos()
|
|
|
|
-- reread document height
|
|
|
|
-- reread document height
|
|
|
|
self.ui.document:_readMetadata()
|
|
|
|
self.ui.document:_readMetadata()
|
|
|
|
-- update self.current_pos if the height of document has been changed.
|
|
|
|
-- update self.current_pos if the height of document has been changed.
|
|
|
@ -262,7 +268,6 @@ function ReaderRolling:onUpdatePos()
|
|
|
|
self.old_page = new_page
|
|
|
|
self.old_page = new_page
|
|
|
|
self.ui:handleEvent(Event:new("UpdateToc"))
|
|
|
|
self.ui:handleEvent(Event:new("UpdateToc"))
|
|
|
|
end
|
|
|
|
end
|
|
|
|
return true
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function ReaderRolling:onChangeViewMode()
|
|
|
|
function ReaderRolling:onChangeViewMode()
|
|
|
|