From 3e913cdf543d5d4b2fd297eb27f3536be692100c Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 7 May 2017 11:31:12 +0200 Subject: spline: rename, change call site --- spline/spline.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'spline/spline.cpp') diff --git a/spline/spline.cpp b/spline/spline.cpp index 76a6190f..3c1c3eba 100644 --- a/spline/spline.cpp +++ b/spline/spline.cpp @@ -134,7 +134,6 @@ float spline::get_value_internal(int x) { if (!validp) { - recompute(); update_interp_data(); validp = true; } @@ -191,6 +190,8 @@ void spline::update_interp_data() { points_t points = s->points; + ensure_valid(points); + int sz = element_count(points, max_x); if (sz == 0) @@ -384,11 +385,11 @@ void spline::set_bundle(bundle b) } } -void spline::recompute() +void spline::ensure_valid(const QList& the_points) { QMutexLocker foo(&_mutex); - QList list = s->points; + QList list = the_points; // storing to s->points fires bundle::changed and that leads to an infinite loop // thus, only store if we can't help it @@ -419,7 +420,7 @@ void spline::recompute() ret_list.push_back(pt); } - if (ret_list != s->points) + if (ret_list != the_points) s->points = ret_list; last_input_value = QPointF(0, 0); -- cgit v1.2.3