diff options
Diffstat (limited to 'qfunctionconfigurator')
-rw-r--r-- | qfunctionconfigurator/functionconfig.cpp | 22 | ||||
-rw-r--r-- | qfunctionconfigurator/functionconfig.h | 2 | ||||
-rw-r--r-- | qfunctionconfigurator/qfunctionconfigurator.cpp | 7 | ||||
-rw-r--r-- | qfunctionconfigurator/qfunctionconfigurator.h | 2 |
4 files changed, 30 insertions, 3 deletions
diff --git a/qfunctionconfigurator/functionconfig.cpp b/qfunctionconfigurator/functionconfig.cpp index 33f9beee..cac8121c 100644 --- a/qfunctionconfigurator/functionconfig.cpp +++ b/qfunctionconfigurator/functionconfig.cpp @@ -1,3 +1,11 @@ +/* Copyright (c) 2012-2015, Stanislaw Halik <sthalik@misaki.pl> + + * Permission to use, copy, modify, and/or distribute this + * software for any purpose with or without fee is hereby granted, + * provided that the above copyright notice and this permission + * notice appear in all copies. + */ + #include <QMutexLocker> #include <QCoreApplication> #include <QPointF> @@ -67,6 +75,18 @@ 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()) { @@ -124,7 +144,7 @@ void Map::reload() { (-p0_y + 3. * p1_y - 3. * p2_y + p3_y) * t3); if (x >= 0 && x < sz) - data[x] = y; + data[x] = elide_nan(y); } } diff --git a/qfunctionconfigurator/functionconfig.h b/qfunctionconfigurator/functionconfig.h index 31aebdf6..6d76d0de 100644 --- a/qfunctionconfigurator/functionconfig.h +++ b/qfunctionconfigurator/functionconfig.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2014, Stanislaw Halik <sthalik@misaki.pl> +/* Copyright (c) 2012-2015, Stanislaw Halik <sthalik@misaki.pl> * Permission to use, copy, modify, and/or distribute this * software for any purpose with or without fee is hereby granted, diff --git a/qfunctionconfigurator/qfunctionconfigurator.cpp b/qfunctionconfigurator/qfunctionconfigurator.cpp index e62049db..bcb895ec 100644 --- a/qfunctionconfigurator/qfunctionconfigurator.cpp +++ b/qfunctionconfigurator/qfunctionconfigurator.cpp @@ -1,3 +1,10 @@ +/* Copyright (c) 2012-2015 Stanislaw Halik <sthalik@misaki.pl> + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + */ + #include "opentrack/options.hpp" using namespace options; #include "qfunctionconfigurator/qfunctionconfigurator.h" diff --git a/qfunctionconfigurator/qfunctionconfigurator.h b/qfunctionconfigurator/qfunctionconfigurator.h index 8957c898..667886cd 100644 --- a/qfunctionconfigurator/qfunctionconfigurator.h +++ b/qfunctionconfigurator/qfunctionconfigurator.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2014 Stanislaw Halik <sthalik@misaki.pl> +/* Copyright (c) 2012-2015 Stanislaw Halik <sthalik@misaki.pl> * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above |