summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2017-10-21 14:23:02 +0200
committerStanislaw Halik <sthalik@misaki.pl>2017-10-21 14:23:02 +0200
commita22264f5111ff9b2c63ef8e94021d44c03e17a45 (patch)
treec2165388bc2395b7feb49ae299feced94e1ae5eb
parent207a70f1cd99e9719a878b9c6b3909302a020e93 (diff)
spline: don't remove points from config
-rw-r--r--spline/spline.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/spline/spline.cpp b/spline/spline.cpp
index ef1e9c58..1252d3ae 100644
--- a/spline/spline.cpp
+++ b/spline/spline.cpp
@@ -399,8 +399,8 @@ void spline::ensure_valid(QList<QPointF>& the_points)
const int sz = list.size();
- QList<QPointF> ret_list;
- ret_list.reserve(sz);
+ QList<QPointF> ret_list, ret_list_2;
+ ret_list.reserve(sz), ret_list_2.reserve(sz);
const double maxx = max_input(), maxy = max_output();
@@ -422,12 +422,18 @@ void spline::ensure_valid(QList<QPointF>& the_points)
);
if (!overlap)
+ ret_list_2.append(pt);
+
+ if (pt.x() - 1e-2 < maxx && pt.x() >= 0 &&
+ pt.y() - 1e-2 < maxy && pt.y() >= 0 && !overlap)
+ {
ret_list.push_back(pt);
+ }
}
if (ret_list != the_points)
{
- s->points = ret_list;
+ s->points = std::move(ret_list_2);
the_points = std::move(ret_list);
}