diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2017-05-07 11:31:12 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2017-05-10 11:19:22 +0200 |
commit | 3e913cdf543d5d4b2fd297eb27f3536be692100c (patch) | |
tree | 77bb07e91a7485cd35077c6ad89f4bbf06225a7d /spline/spline.cpp | |
parent | 80deba23647e80895d2942ab2d3b8e247fb68f69 (diff) |
spline: rename, change call site
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); |