fix: bug with createEaseInOutBack in interpolationFunctions.ts (#69)

The second half of easeInOutBack was sampling the wrong parts of the easeOutBack formula, these two changes fix that
This commit is contained in:
TomatechGames
2022-07-17 20:03:02 +01:00
committed by GitHub
parent 063085109b
commit 2b958768a6

View File

@@ -82,11 +82,11 @@ export function createEaseInOutBack(s = 1.70158): InterpolationFunction {
if (value < 1) {
return map(from, to, (value * value * ((s + 1) * value - s)) / 2);
}
value -= 2;
value -= 1;
return map(
from,
to,
(1 + (value - 1) * (value - 1) * ((s + 1) * (value - 1) + s)) / 2,
(1 + (value - 1) * (value - 1) * ((s + 1) * (value - 1) + s)) / 2 + 0.5,
);
};
}