From a38e31674c0730eba69abbc2634a908811f98a39 Mon Sep 17 00:00:00 2001 From: Cauchy Underground Date: Mon, 8 Apr 2024 15:41:28 +0200 Subject: [PATCH] Change of magic number to 2 * math.pi --- lib/wibox/container/scroll.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/wibox/container/scroll.lua b/lib/wibox/container/scroll.lua index 2bae93d304..87a295cf35 100644 --- a/lib/wibox/container/scroll.lua +++ b/lib/wibox/container/scroll.lua @@ -569,7 +569,7 @@ function scroll.step_functions.smooth_back_and_forth(elapsed, size, visible_size local state = ((elapsed * speed) % (size)) / size -- The cosine function is scaled to map [0,1] to [0,2π] then it’s output is -- scaled from [1 -- -1 -- 1] to [0 -- 1 -- 0] - return (size - visible_size) * (0.5 - 0.5*math.cos(state*6.2832)) + return (size - visible_size) * (0.5 - 0.5*math.cos(state * 2 * math.pi)) end return scroll