From 4edcae8dd0092535485de12e8bcf3d4526ff99df Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Tue, 7 Jul 2015 13:26:08 +0200 Subject: qfc: only prepend leading (0,0) if there's more than 1 point --- qfunctionconfigurator/functionconfig.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'qfunctionconfigurator') 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 input = cur.input; auto& data = cur.data; - if (input.size() && input[0].x() > 1e-2) - input.prepend(QPointF(0, 0)); - data = std::vector(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); -- cgit v1.2.3