summaryrefslogtreecommitdiffhomepage
path: root/qfunctionconfigurator/functionconfig.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2015-10-26 07:10:49 +0100
committerStanislaw Halik <sthalik@misaki.pl>2015-10-26 07:10:49 +0100
commit20f83ad3149237087d2d0a81a27e6d511a5e7973 (patch)
tree3aaf2bc964a026292451efaa553744165d3e1c93 /qfunctionconfigurator/functionconfig.cpp
parenta815d8dfe1b452e0cab9b588a9d4ec4650a5bdda (diff)
parent8f7e5c0441237a9c8c187f24a424f6c77c5e397e (diff)
Merge branch 'unstable' into trackhat
* unstable: main: use camera-based centering by default settings: clarify center method usage accela: fix typo win32: try win_key with modifier first shortcuts: remove obsolete code on win32 shortcuts: allow for numpad on win32 qfc: drop nan check pt: drop nan check shortcuts: allow for numlock on win32 accela: remove too many nan checks timer: guard against overflow on win32 accela: remove "done" logic timer: sprinkle some const shortcuts: allow for binding same key to multiple functions qfc: guard against unlikely division by zero cmake: update toolchain file
Diffstat (limited to 'qfunctionconfigurator/functionconfig.cpp')
-rw-r--r--qfunctionconfigurator/functionconfig.cpp16
1 files changed, 2 insertions, 14 deletions
diff --git a/qfunctionconfigurator/functionconfig.cpp b/qfunctionconfigurator/functionconfig.cpp
index cac8121c..27f3bf40 100644
--- a/qfunctionconfigurator/functionconfig.cpp
+++ b/qfunctionconfigurator/functionconfig.cpp
@@ -75,18 +75,6 @@ static bool sortFn(const QPointF& one, const QPointF& two) {
return one.x() < two.x();
}
-static inline bool nanp(double value)
-{
- return std::isnan(value) || std::isinf(value);
-}
-
-static inline double elide_nan(double value)
-{
- if (nanp(value))
- return -1;
- return value;
-}
-
void Map::reload() {
if (cur.input.size())
{
@@ -104,7 +92,7 @@ void Map::reload() {
for (int i = 0; i < sz; i++)
data[i] = -1;
- if (input.size() == 1)
+ if (input.size() == 1 && input[0].x() > 1e-2)
{
for (int k = 0; k < input[0].x() * mult; k++) {
if (k < sz)
@@ -144,7 +132,7 @@ void Map::reload() {
(-p0_y + 3. * p1_y - 3. * p2_y + p3_y) * t3);
if (x >= 0 && x < sz)
- data[x] = elide_nan(y);
+ data[x] = y;
}
}