diff options
Diffstat (limited to 'spline/spline.cpp')
-rw-r--r-- | spline/spline.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
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<QPointF>& the_points) { QMutexLocker foo(&_mutex); - QList<QPointF> list = s->points; + QList<QPointF> 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); |