Merge pull request 're-fix the easing.lua fix with default values' (#1) from master into realfd-develop

Reviewed-on: #1
This commit is contained in:
Katoski 2021-12-25 21:36:10 +00:00
commit 8cd3f36e15
1 changed files with 12 additions and 0 deletions

View File

@ -41,16 +41,25 @@ local function linear(t, b, c, d)
end
local function inQuad(t, b, c, d)
b = b or 0
c = c or 1
d = d or 1
t = t / d
return c * (t ^ 2) + b
end
local function outQuad(t, b, c, d)
b = b or 0
c = c or 1
d = d or 1
t = t / d
return -c * t * (t - 2) + b
end
local function inOutQuad(t, b, c, d)
b = b or 0
c = c or 1
d = d or 1
t = t / d * 2
if t < 1 then
return c / 2 * (t ^ 2) + b
@ -60,6 +69,9 @@ local function inOutQuad(t, b, c, d)
end
local function outInQuad(t, b, c, d)
b = b or 0
c = c or 1
d = d or 1
if t < d / 2 then
return outQuad (t * 2, b, c / 2, d)
else