Fix minimal scale possible

This commit is contained in:
Daniel Rocha 2021-08-27 20:02:04 -03:00 committed by Francesco
parent 07c23fbf17
commit e342a017e1
1 changed files with 9 additions and 0 deletions

View File

@ -13,6 +13,8 @@ config.plugins.scale = {
use_mousewheel = true
}
local MIN_SCALE = 0.25;
local scale_level = 0
local scale_steps = 0.05
@ -89,6 +91,13 @@ local function inc_scale()
end
local function dec_scale()
local new_scale_level = default_scale + (scale_level - 1) * scale_steps
if new_scale_level < MIN_SCALE then
set_scale(MIN_SCALE)
return
end
scale_level = scale_level - 1
set_scale(default_scale + scale_level * scale_steps)
end