Fix Auto Clamped limits when smoothing the transition of cyclic curves.

The value of l[count-1] should be ready by the time hmin/hmax is computed.
Otherwise the left limit for the transition key would be scaled wrong.
This commit is contained in:
Alexander Gavrilov 2020-11-28 15:53:15 +03:00
parent c99d767735
commit 566e7e6145
1 changed files with 9 additions and 6 deletions

View File

@ -3886,7 +3886,15 @@ static void bezier_handle_calc_smooth_fcurve(
/* ratio of x intervals */
l[0] = l[count - 1] = 1.0f;
if (full_cycle) {
dx[0] = dx[count - 1];
dy[0] = dy[count - 1];
l[0] = l[count - 1] = dx[1] / dx[0];
}
else {
l[0] = l[count - 1] = 1.0f;
}
for (int i = 1; i < count - 1; i++) {
l[i] = dx[i + 1] / dx[i];
@ -3922,11 +3930,6 @@ static void bezier_handle_calc_smooth_fcurve(
/* reduce the number of unknowns by one */
int i = solve_count = count - 1;
dx[0] = dx[i];
dy[0] = dy[i];
l[0] = l[i] = dx[1] / dx[0];
hmin[0] = max_ff(hmin[0], hmin[i]);
hmax[0] = min_ff(hmax[0], hmax[i]);