diff --git a/data/core/config.lua b/data/core/config.lua index bfe4fb7..8cc7d55 100644 --- a/data/core/config.lua +++ b/data/core/config.lua @@ -19,6 +19,7 @@ config.line_limit = 80 config.max_symbols = 4000 config.max_project_files = 2000 config.transitions = true +config.animation_rate = 1.0 config.blink_period = 0.8 -- Disable plugin loading setting to false the config entry diff --git a/data/core/view.lua b/data/core/view.lua index 4d49959..9a58cc4 100644 --- a/data/core/view.lua +++ b/data/core/view.lua @@ -24,7 +24,10 @@ function View:move_towards(t, k, dest, rate) if not config.transitions or math.abs(val - dest) < 0.5 then t[k] = dest else - t[k] = common.lerp(val, dest, rate or 0.5) + rate = common.clamp(rate or 0.5, 1e-8, 1 - 1e-8) + local alpha = math.log(1 - rate) * config.animation_rate + local dt = 60 / config.fps + t[k] = common.lerp(val, dest, 1 - math.exp(alpha * dt)) end if val ~= dest then core.redraw = true