summaryrefslogtreecommitdiffhomepage
path: root/qfunctionconfigurator
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2015-07-07 13:26:08 +0200
committerStanislaw Halik <sthalik@misaki.pl>2015-07-07 13:26:08 +0200
commit4edcae8dd0092535485de12e8bcf3d4526ff99df (patch)
treeeac65c5d0d5b39800e155e83cc27a13535035afd /qfunctionconfigurator
parent7f18b823af6998b18e041fc01ef2d5ee3c189056 (diff)
qfc: only prepend leading (0,0) if there's more than 1 point
Diffstat (limited to 'qfunctionconfigurator')
-rw-r--r--qfunctionconfigurator/functionconfig.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/qfunctionconfigurator/functionconfig.cpp b/qfunctionconfigurator/functionconfig.cpp
index 6d1a48b4..7edbe0ef 100644
--- a/qfunctionconfigurator/functionconfig.cpp
+++ b/qfunctionconfigurator/functionconfig.cpp
@@ -74,9 +74,6 @@ void Map::reload() {
QList<QPointF> input = cur.input;
auto& data = cur.data;
- if (input.size() && input[0].x() > 1e-2)
- input.prepend(QPointF(0, 0));
-
data = std::vector<float>(value_count);
const int mult = precision();
@@ -92,6 +89,8 @@ void Map::reload() {
data[k] = input[0].y() * k / (input[0].x() * mult);
}
}
+ else if (input[0].x() > 1e-2)
+ input.prepend(QPointF(0, 0));
for (int i = 0; i < sz; i++) {
QPointF p0 = ensureInBounds(input, i - 1);