diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2015-07-26 10:50:36 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2015-07-26 10:50:36 +0200 |
commit | 21c2135588a6a76b6dcc4defc6e64a3d9032db59 (patch) | |
tree | d227f50027a7e86a9d3ab1bf7d095c015e30c038 /qfunctionconfigurator | |
parent | 191bbda2b587bfe612a96199eff75a225a018a2e (diff) |
qfc: interpolate the right way for negative values
Diffstat (limited to 'qfunctionconfigurator')
-rw-r--r-- | qfunctionconfigurator/functionconfig.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/qfunctionconfigurator/functionconfig.cpp b/qfunctionconfigurator/functionconfig.cpp index 38a9e703..825aa3c1 100644 --- a/qfunctionconfigurator/functionconfig.cpp +++ b/qfunctionconfigurator/functionconfig.cpp @@ -28,7 +28,7 @@ Map::num Map::getValue(Map::num x) { num q = x * precision(); int xi = (int)q; num yi = getValueInternal(xi); - num yiplus1 = getValueInternal(xi+1); + num yiplus1 = getValueInternal(xi + (x < 0 ? -1 : 1)); num f = (q-xi); num ret = yiplus1 * f + yi * (1.0f - f); // at least do a linear interpolation. last_input_value.setX(x); |