UIManager:discardEvents(): use accurate "now"

Instead of UIManager possibly staled _now, which could have
no effect after a long ReaderRolling re-rendering.
Also lower the delay after such ReaderRolling re-rendering,
so we can change settings quicker when comparing renderings.
reviewable/pr8996/r2^2
poire-z 2 years ago
parent 0808560532
commit 814f42cce0

@ -884,7 +884,9 @@ function ReaderRolling:onUpdatePos()
self:updatePos() self:updatePos()
Device:setIgnoreInput(false) -- Allow processing of events (on Android). Device:setIgnoreInput(false) -- Allow processing of events (on Android).
UIManager:discardEvents(true) -- Discard events, which might have occured (double tap). UIManager:discardEvents(0.2) -- Discard events, which might have occurred (double tap).
-- We can use a smaller duration than the default (quite large to avoid accidental dismissals),
-- to allow for quicker setting changes and rendering comparisons.
end end
function ReaderRolling:updatePos() function ReaderRolling:updatePos()

@ -1081,7 +1081,7 @@ function UIManager:discardEvents(set_or_seconds)
else -- we expect a number else -- we expect a number
delay = TimeVal:new{ sec = set_or_seconds, usec = 0 } delay = TimeVal:new{ sec = set_or_seconds, usec = 0 }
end end
self._discard_events_till = self._now + delay self._discard_events_till = TimeVal:now() + delay
end end
--[[-- --[[--

Loading…
Cancel
Save