summaryrefslogtreecommitdiffhomepage
path: root/qfunctionconfigurator/functionconfig.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qfunctionconfigurator/functionconfig.cpp')
-rw-r--r--qfunctionconfigurator/functionconfig.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/qfunctionconfigurator/functionconfig.cpp b/qfunctionconfigurator/functionconfig.cpp
index 69522da9..6db3b55f 100644
--- a/qfunctionconfigurator/functionconfig.cpp
+++ b/qfunctionconfigurator/functionconfig.cpp
@@ -34,7 +34,7 @@ Map::Map() :
float Map::getValue(float x) {
QMutexLocker foo(&_mutex);
- int x2 = (int) (std::min<float>(std::max<float>(x, -360), 360) * MEMOIZE_PRECISION);
+ int x2 = x * (double) MEMOIZE_PRECISION;
float ret = getValueInternal(x2);
last_input_value.setX(x);
last_input_value.setY(ret);
@@ -55,7 +55,7 @@ float Map::getValueInternal(int x) {
if (sz == 0)
ret = 0;
else
- ret = std::max(std::min(x, sz-1), 0);
+ ret = data[std::max(std::min(x, sz-1), 0)];
return ret * sign;
}