summaryrefslogtreecommitdiffhomepage
path: root/qfunctionconfigurator/functionconfig.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2015-07-24 13:46:12 +0200
committerStanislaw Halik <sthalik@misaki.pl>2015-07-24 13:46:21 +0200
commite55389fb2a43cd7cc2f1db95bc04a1d1eb789fa9 (patch)
treee2c6dac7c0f584e30e1721969f4720275980deea /qfunctionconfigurator/functionconfig.cpp
parent3c4d10ead91f54fcaa52267aa7f8d81a09336e2a (diff)
qfc: allow max range as floating point
affects accela
Diffstat (limited to 'qfunctionconfigurator/functionconfig.cpp')
-rw-r--r--qfunctionconfigurator/functionconfig.cpp38
1 files changed, 19 insertions, 19 deletions
diff --git a/qfunctionconfigurator/functionconfig.cpp b/qfunctionconfigurator/functionconfig.cpp
index 264097ab..2b9d3a07 100644
--- a/qfunctionconfigurator/functionconfig.cpp
+++ b/qfunctionconfigurator/functionconfig.cpp
@@ -54,17 +54,17 @@ float Map::getValueInternal(int x) {
return ret * sign;
}
-static __inline QPointF ensureInBounds(QList<QPointF> points, int i) {
- int siz = points.size();
- if (siz == 0 || i < 0)
- return QPointF(0, 0);
- if (siz > i)
- return points[i];
- return points[siz - 1];
+static QPointF ensureInBounds(QList<QPointF> points, int i) {
+ int siz = points.size();
+ if (siz == 0 || i < 0)
+ return QPointF(0, 0);
+ if (siz > i)
+ return points[i];
+ return points[siz - 1];
}
static bool sortFn(const QPointF& one, const QPointF& two) {
- return one.x() < two.x();
+ return one.x() < two.x();
}
void Map::reload() {
@@ -149,8 +149,8 @@ void Map::removePoint(int i) {
void Map::addPoint(QPointF pt) {
QMutexLocker foo(&_mutex);
- cur.input.append(pt);
- reload();
+ cur.input.append(pt);
+ reload();
}
void Map::movePoint(int idx, QPointF pt) {
@@ -182,15 +182,15 @@ void Map::loadSettings(QSettings& settings, const QString& title) {
int max = settings.value("point-count", 0).toInt();
for (int i = 0; i < max; i++) {
- newPoint = QPointF(settings.value(QString("point-%1-x").arg(i), 0).toFloat(),
- settings.value(QString("point-%1-y").arg(i), 0).toFloat());
- if (newPoint.x() > max_x) {
- newPoint.setX(max_x);
- }
- if (newPoint.y() > max_y) {
- newPoint.setY(max_y);
- }
- points.append(newPoint);
+ newPoint = QPointF(settings.value(QString("point-%1-x").arg(i), 0).toFloat(),
+ settings.value(QString("point-%1-y").arg(i), 0).toFloat());
+ if (newPoint.x() > max_x) {
+ newPoint.setX(max_x);
+ }
+ if (newPoint.y() > max_y) {
+ newPoint.setY(max_y);
+ }
+ points.append(newPoint);
}
settings.endGroup();