re-fix the easing.lua fix with default values #1

Merged
Katoski merged 1 commits from master into realfd-develop 2021-12-25 22:36:11 +01:00
1 changed files with 12 additions and 0 deletions

View File

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