add gotoPercent for readerrolling.lua

This commit is contained in:
Qingping Hou
2012-06-12 00:34:30 +08:00
parent 2b39ba8b83
commit 4fb2c9d2e3

View File

@@ -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