Honor dithering on diagonal swipe refreshes (#5836)

c.f., https://github.com/koreader/koreader-base/pull/1039#issuecomment-583494496
reviewable/pr5838/r1
NiLuJe 4 years ago committed by GitHub
parent f6b23adb2c
commit 833fed79ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -577,6 +577,7 @@ function UIManager:setDirty(widget, refreshtype, refreshregion, refreshdither)
if self._window_stack[i].widget.dithered then
-- NOTE: That works when refreshtype is NOT a function,
-- which is why _repaint does another pass of this check ;).
logger.dbg("setDirty on all widgets: found a dithered widget, infecting the refresh queue")
refreshdither = true
end
end
@ -593,6 +594,18 @@ function UIManager:setDirty(widget, refreshtype, refreshregion, refreshdither)
refreshdither = true
end
end
else
-- Another special case: if we did NOT specify a widget, but requested a full refresh nonetheless (i.e., a diagonal swipe),
-- we'll want to check the window stack in order to honor dithering...
if refreshtype == "full" then
for i = 1, #self._window_stack do
-- If any of 'em were dithered, honor their dithering hint
if self._window_stack[i].widget.dithered then
logger.dbg("setDirty full on no specific widget: found a dithered widget, infecting the refresh queue")
refreshdither = true
end
end
end
end
-- handle refresh information
if type(refreshtype) == "function" then

Loading…
Cancel
Save