mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Allow disabling automagic image inversion in Nightmode in CRe (#5095)
* Allow disabling automagic image inversion in NightMode Fix #4986
This commit is contained in:
@@ -23,6 +23,7 @@ local CreDocument = Document:new{
|
||||
_loaded = false,
|
||||
_view_mode = nil,
|
||||
_smooth_scaling = false,
|
||||
_nightmode_images = true,
|
||||
|
||||
line_space_percent = 100,
|
||||
default_font = "Noto Serif",
|
||||
@@ -378,7 +379,7 @@ function CreDocument:drawCurrentView(target, x, y, rect, pos)
|
||||
|
||||
-- local start_clock = os.clock()
|
||||
self._drawn_images_count, self._drawn_images_surface_ratio =
|
||||
self._document:drawCurrentPage(self.buffer, self.render_color, Screen.night_mode, self._smooth_scaling, Screen.sw_dithering)
|
||||
self._document:drawCurrentPage(self.buffer, self.render_color, Screen.night_mode and self._nightmode_images, self._smooth_scaling, Screen.sw_dithering)
|
||||
-- print(string.format("CreDocument:drawCurrentView: Rendering took %9.3f ms", (os.clock() - start_clock) * 1000))
|
||||
|
||||
-- start_clock = os.clock()
|
||||
@@ -736,6 +737,11 @@ function CreDocument:setImageScaling(toggle)
|
||||
self._smooth_scaling = toggle
|
||||
end
|
||||
|
||||
function CreDocument:setNightmodeImages(toggle)
|
||||
logger.dbg("CreDocument: set nightmode images", toggle)
|
||||
self._nightmode_images = toggle
|
||||
end
|
||||
|
||||
function CreDocument:setFloatingPunctuation(enabled)
|
||||
-- FIXME: occasional segmentation fault when toggling floating punctuation
|
||||
logger.dbg("CreDocument: set floating punctuation", enabled)
|
||||
|
||||
Reference in New Issue
Block a user