ecore/animator: code refactoring.

renamed to more meaningful name.
don't stupid computaion twice.
This commit is contained in:
ChunEon Park 2014-12-09 16:43:23 +09:00
parent 3b6a5956f9
commit 1d8693d3e9
1 changed files with 4 additions and 4 deletions

View File

@ -355,7 +355,7 @@ _cubic_bezier_t_get(double a,
const int LIMIT = 100;
double current_slope;
double tmp;
double change;
double current_x;
double guess_t = a;
@ -364,9 +364,9 @@ _cubic_bezier_t_get(double a,
current_slope = _cubic_bezier_slope_get(guess_t, x1, x2);
if (current_slope == 0.0) return guess_t;
current_x = _cubic_bezier_calc(guess_t, x1, x2) - a;
tmp = current_x / current_slope;
guess_t -= current_x / current_slope;
if (APPROXIMATE_RANGE(tmp)) break;
change = current_x / current_slope;
guess_t -= change;
if (APPROXIMATE_RANGE(change)) break;
}
return guess_t;
}