From a22264f5111ff9b2c63ef8e94021d44c03e17a45 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sat, 21 Oct 2017 14:23:02 +0200 Subject: spline: don't remove points from config --- spline/spline.cpp | 12 +++++++++--- 1 file 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& the_points) const int sz = list.size(); - QList ret_list; - ret_list.reserve(sz); + QList 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& 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); } -- cgit v1.2.3