mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Fix scrolling, add inertial scroll on non-eInk devices
Add a new reader module: ReaderScrolling, that exposes some Scrolling options to the menu (which are to be used by and implemented in ReaderPaging and ReaderRolling themselves) and implement some inertial scrolling logic used by both of them. Default to "Classic scrolling" which is the expected behaviour on phones and tablets. The old CreDocument buggy behaviour is available as "Turbo scrolling" for both Paging and Rolling documents. Added a "On release scrolling" option that might be useful on eInk to avoid dynamic pan/scrolling. Try to avoid bad interactions between pan and swipe, cancelling unwanted panning if we ended up doing a swipe or multiswipe.
This commit is contained in:
@@ -73,6 +73,9 @@ local ReaderView = OverlapGroup:extend{
|
||||
flipping_visible = false,
|
||||
-- to ensure periodic flush of settings
|
||||
settings_last_save_tv = nil,
|
||||
-- might be directly updated by readerpaging/readerrolling when
|
||||
-- they handle some panning/scrolling, to request "fast" refreshes
|
||||
currently_scrolling = false,
|
||||
}
|
||||
|
||||
function ReaderView:init()
|
||||
@@ -614,7 +617,7 @@ function ReaderView:recalculate()
|
||||
end
|
||||
-- Flag a repaint so self:paintTo will be called
|
||||
-- NOTE: This is also unfortunately called during panning, essentially making sure we'll never be using "fast" for pans ;).
|
||||
UIManager:setDirty(self.dialog, "partial")
|
||||
UIManager:setDirty(self.dialog, self.currently_scrolling and "fast" or "partial")
|
||||
end
|
||||
|
||||
function ReaderView:PanningUpdate(dx, dy)
|
||||
|
||||
Reference in New Issue
Block a user