diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2015-07-07 13:26:08 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2015-07-07 13:26:08 +0200 |
commit | 4edcae8dd0092535485de12e8bcf3d4526ff99df (patch) | |
tree | eac65c5d0d5b39800e155e83cc27a13535035afd /qfunctionconfigurator/functionconfig.cpp | |
parent | 7f18b823af6998b18e041fc01ef2d5ee3c189056 (diff) |
qfc: only prepend leading (0,0) if there's more than 1 point
Diffstat (limited to 'qfunctionconfigurator/functionconfig.cpp')
-rw-r--r-- | qfunctionconfigurator/functionconfig.cpp | 5 |
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); |