Skip to content

Commit a38e316

Browse files
Change of magic number to 2 * math.pi
1 parent c9a7698 commit a38e316

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/wibox/container/scroll.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,7 @@ function scroll.step_functions.smooth_back_and_forth(elapsed, size, visible_size
569569
local state = ((elapsed * speed) % (size)) / size
570570
-- The cosine function is scaled to map [0,1] to [0,2π] then it’s output is
571571
-- scaled from [1 -- -1 -- 1] to [0 -- 1 -- 0]
572-
return (size - visible_size) * (0.5 - 0.5*math.cos(state*6.2832))
572+
return (size - visible_size) * (0.5 - 0.5*math.cos(state * 2 * math.pi))
573573
end
574574

575575
return scroll

0 commit comments

Comments
 (0)