summaryrefslogtreecommitdiffhomepage
path: root/qfunctionconfigurator
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2015-07-26 10:50:36 +0200
committerStanislaw Halik <sthalik@misaki.pl>2015-07-26 10:50:36 +0200
commit21c2135588a6a76b6dcc4defc6e64a3d9032db59 (patch)
treed227f50027a7e86a9d3ab1bf7d095c015e30c038 /qfunctionconfigurator
parent191bbda2b587bfe612a96199eff75a225a018a2e (diff)
qfc: interpolate the right way for negative values
Diffstat (limited to 'qfunctionconfigurator')
-rw-r--r--qfunctionconfigurator/functionconfig.cpp2
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);