Ensure the extreme values of xfade curves are exact
This commit is contained in:
parent
5bd80b4834
commit
12e9cf8896
1 changed files with 6 additions and 2 deletions
|
|
@ -84,13 +84,17 @@ Curve Curve::buildPredefinedCurve(int index)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
for (unsigned i = 0; i < NumValues; ++i) {
|
curve._points[0] = 0.0;
|
||||||
|
curve._points[NumValues - 1] = 1.0;
|
||||||
|
for (unsigned i = 1; i < NumValues - 1; ++i) {
|
||||||
double x = i / static_cast<double>(NumValues - 1);
|
double x = i / static_cast<double>(NumValues - 1);
|
||||||
curve._points[i] = std::sqrt(x);
|
curve._points[i] = std::sqrt(x);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
for (unsigned i = 0; i < NumValues; ++i) {
|
curve._points[0] = 1.0;
|
||||||
|
curve._points[NumValues - 1] = 0.0;
|
||||||
|
for (unsigned i = 1; i < NumValues - 1; ++i) {
|
||||||
double x = i / static_cast<double>(NumValues - 1);
|
double x = i / static_cast<double>(NumValues - 1);
|
||||||
curve._points[i] = std::sqrt(1.0 - x);
|
curve._points[i] = std::sqrt(1.0 - x);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue