bugfix: use ceil to keep index greater than or equal to 1

This commit is contained in:
chrox
2013-04-15 14:11:57 +08:00
parent 324e0575d0
commit 598772562d

View File

@@ -31,7 +31,7 @@ end
function ReaderFrontLight:onAdjust(arg, ges)
if self.lipc_handle then
local rel_proportion = ges.distance / Screen:getWidth()
local delta_int = self.steps[math.floor(#self.steps*rel_proportion)]
local delta_int = self.steps[math.ceil(#self.steps*rel_proportion)]
local msg = ""
if ges.direction == "north" then
msg = _("Increase front light intensity to ")