Add a special case for 0-time interpolations
This commit is contained in:
4
thirdparty/misc/easing_equations.cpp
vendored
4
thirdparty/misc/easing_equations.cpp
vendored
@ -312,6 +312,10 @@ Tween::interpolater Tween::interpolaters[Tween::TRANS_MAX][Tween::EASE_MAX] = {
|
||||
};
|
||||
|
||||
real_t Tween::run_equation(TransitionType p_trans_type, EaseType p_ease_type, real_t t, real_t b, real_t c, real_t d) {
|
||||
if (d == 0) {
|
||||
// Special case to avoid dividing by 0 in equations.
|
||||
return b + c;
|
||||
}
|
||||
|
||||
interpolater cb = interpolaters[p_trans_type][p_ease_type];
|
||||
ERR_FAIL_COND_V(cb == NULL, b);
|
||||
|
||||
Reference in New Issue
Block a user