Reader: do not apply line spacing out of range (#10307)

* readercoptlistener: fix line spacing out of range

* readerkoptlistener: fix line spacing out of range

* creoptions: fix line spacing limit
reviewable/pr10326/r1
hius07 1 year ago committed by GitHub
parent 34c2dab54b
commit be7d6008d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -69,9 +69,9 @@ function ReaderCoptListener:onReadSettings(config)
end
function ReaderCoptListener:onConfigChange(option_name, option_value)
-- font_size is historically and sadly shared by both mupdf and cre reader modules,
-- font_size and line_spacing are historically and sadly shared by both mupdf and cre reader modules,
-- but fortunately they can be distinguished by their different ranges
if option_name == "font_size" and option_value < 5 then return end
if (option_name == "font_size" or option_name == "line_spacing") and option_value < 5 then return end
self.document.configurable[option_name] = option_value
self.ui:handleEvent(Event:new("StartActivityIndicator"))
return true

@ -72,9 +72,9 @@ function ReaderKoptListener:onDocLangUpdate(lang)
end
function ReaderKoptListener:onConfigChange(option_name, option_value)
-- font_size is historically and sadly shared by both mupdf and cre reader modules,
-- font_size and line_spacing are historically and sadly shared by both mupdf and cre reader modules,
-- but fortunately they can be distinguished by their different ranges
if option_name == "font_size" and option_value > 5 then return end
if (option_name == "font_size" or option_name == "line_spacing") and option_value > 5 then return end
self.document.configurable[option_name] = option_value
self.ui:handleEvent(Event:new("StartActivityIndicator"))
UIManager:setDirty("all", "partial")

@ -387,7 +387,7 @@ Note that your selected font size is not affected by this setting.]]),
more_options = true,
more_options_param = {
value_min = 50,
value_max = 300,
value_max = 200,
value_step = 1,
value_hold_step = 5,
unit = "%",

Loading…
Cancel
Save