Merge pull request #812 from chrox/flip_fix

bugfix: remove original page number after leaving flipping mode
This commit is contained in:
{Qingping,Dave} Hou
2013-03-18 07:32:26 -07:00

View File

@@ -142,6 +142,8 @@ function ReaderPaging:onToggleFlipping()
self.flipping_page = self.current_page
if self.flipping_mode then
self:updateOriginalPage(self.current_page)
else
self:updateOriginalPage(nil)
end
self.ui:handleEvent(Event:new("SetHinting", not self.flipping_mode))
UIManager:setDirty(self.view.dialog, "partial")
@@ -208,7 +210,9 @@ end
function ReaderPaging:onPageUpdate(new_page_no, orig)
self.current_page = new_page_no
self.ui:handleEvent(Event:new("InitScrollPageStates", orig))
if orig ~= "scrolling" then
self.ui:handleEvent(Event:new("InitScrollPageStates", orig))
end
end
function ReaderPaging:onViewRecalculate(visible_area, page_area)
@@ -239,8 +243,8 @@ end
function ReaderPaging:onInitScrollPageStates(orig)
DEBUG("init scroll page states")
if orig == "scrolling" then return true end
if self.view.page_scroll then
self.orig_page = self.current_page
self.view.page_states = {}
local blank_area = Geom:new{}
blank_area:setSizeTo(self.view.dimen)
@@ -255,6 +259,7 @@ function ReaderPaging:onInitScrollPageStates(orig)
self:gotoPage(self.current_page + 1, "scrolling")
end
end
self:gotoPage(self.orig_page, "scrolling")
end
return true
end