mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Fix a few logic holes in dithering mode selection (#6419)
* Allow switching to SW dithering on a HW-capable device without that being lost on boot (and, worse, left in an undithered state). * Make sure the automagic toggles between HW/SW in the Dev menu are properly saved.
This commit is contained in:
@@ -130,10 +130,15 @@ end
|
||||
if Device:hasEinkScreen() then
|
||||
Device.screen:setupDithering()
|
||||
if Device.screen.hw_dithering and G_reader_settings:isTrue("dev_no_hw_dither") then
|
||||
Device.screen:toggleHWDithering()
|
||||
Device.screen:toggleHWDithering(false)
|
||||
end
|
||||
if Device.screen.sw_dithering and G_reader_settings:isTrue("dev_no_sw_dither") then
|
||||
Device.screen:toggleSWDithering()
|
||||
Device.screen:toggleSWDithering(false)
|
||||
end
|
||||
-- NOTE: If device can HW dither (i.e., after setupDithering(), hw_dithering is true, but sw_dithering is false),
|
||||
-- but HW dither is explicitly disabled, and SW dither enabled, don't leave SW dither disabled (i.e., re-enable sw_dithering)!
|
||||
if Device:canHWDither() and G_reader_settings:isTrue("dev_no_hw_dither") and G_reader_settings:nilOrFalse("dev_no_sw_dither") then
|
||||
Device.screen:toggleSWDithering(true)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user