re-fix the easing.lua fix with default values

This commit is contained in:
Hersi 2021-12-25 02:51:26 +01:00
parent 2005399156
commit 9d60fe06ee
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