Skip to content

Commit

Permalink
Change of magic number to 2 * math.pi
Browse files Browse the repository at this point in the history
  • Loading branch information
CauchyUnderground committed Apr 8, 2024
1 parent c9a7698 commit a38e316
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/wibox/container/scroll.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a38e316

Please sign in to comment.