Merge pull request #799 from chrox/new_ui_code

bugfix: clamp scroll offsets
pull/2/merge
{Qingping,Dave} Hou 11 years ago
commit b77e1145e8

@ -359,6 +359,8 @@ function ReaderPaging:onScrollPageRel(diff)
x = 0,
y = last_page_state.visible_area.h - self.overlap
}
-- scroll down offset should always be greater than 0
if offset.y < 0 then offset.y = 0 end
local state = self:updateLastPageState(last_page_state, blank_area, offset)
--DEBUG("updated state", state)
self.view.page_states = {}
@ -383,6 +385,8 @@ function ReaderPaging:onScrollPageRel(diff)
x = 0,
y = -first_page_state.visible_area.h + self.overlap
}
-- scroll up offset should always be less than 0
if offset.y > 0 then offset.y = 0 end
local state = self:updateFirstPageState(first_page_state, blank_area, offset)
--DEBUG("updated state", state)
self.view.page_states = {}

Loading…
Cancel
Save