diff options
| author | Francesco Abbate <francesco.bbt@gmail.com> | 2021-03-20 17:00:43 +0100 |
|---|---|---|
| committer | Francesco Abbate <francesco.bbt@gmail.com> | 2021-03-20 17:00:43 +0100 |
| commit | f9115751b456e0e1a3f5e4bb4984b83a9509b50c (patch) | |
| tree | 6024e3bdc1a4b2d8d37b3d7e2506c0961845c420 /data | |
| parent | 7f50df6a2f6f44c5a0285f26118695e22afc3fc2 (diff) | |
| download | lite-xl-f9115751b456e0e1a3f5e4bb4984b83a9509b50c.tar.gz lite-xl-f9115751b456e0e1a3f5e4bb4984b83a9509b50c.zip | |
Minor simplification of animation rate adjustment
Diffstat (limited to 'data')
| -rw-r--r-- | data/core/view.lua | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/data/core/view.lua b/data/core/view.lua index 7ab5e042..2fb431d6 100644 --- a/data/core/view.lua +++ b/data/core/view.lua @@ -25,11 +25,9 @@ function View:move_towards(t, k, dest, rate) t[k] = dest else rate = rate or 0.5 - if config.fps ~= 60 then - local xrate = common.clamp(rate, 1e-8, 1 - 1e-8) - local alpha = math.log(1 - xrate) * config.animation_rate + if config.fps ~= 60 or config.animation_rate ~= 1 then local dt = 60 / config.fps - rate = 1 - math.exp(alpha * dt) + rate = 1 - common.clamp(1 - rate, 1e-8, 1 - 1e-8)^(config.animation_rate * dt) end t[k] = common.lerp(val, dest, rate) end |
