mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
add gotoPercent for readerrolling.lua
This commit is contained in:
@@ -40,9 +40,13 @@ function ReaderRolling:gotoPos(new_pos)
|
||||
self.ui:handleEvent(Event:new("PosUpdate", new_pos))
|
||||
end
|
||||
|
||||
function ReaderRolling:gotoPercent(new_percent)
|
||||
self:gotoPos(new_percent * self.length / 10000)
|
||||
end
|
||||
|
||||
function ReaderRolling:onGotoPercent(percent)
|
||||
DEBUG("goto document offset in percent:", percent)
|
||||
self:gotoPos(percent * self.length / 10000)
|
||||
self:gotoPercent(percent)
|
||||
return true
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user