From 0289ccf1efee228a8196daae60882f1ec223d8ff Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 13 Feb 2017 23:00:07 +0100 Subject: spline-widget: linearly interpolate if singular point beyond zoom value exists --- spline-widget/spline.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'spline-widget') diff --git a/spline-widget/spline.cpp b/spline-widget/spline.cpp index ecfd459a..65e5d4af 100644 --- a/spline-widget/spline.cpp +++ b/spline-widget/spline.cpp @@ -188,7 +188,7 @@ void spline::update_interp_data() int sz = element_count(points, max_x); if (sz == 0) - points.append(QPointF(max_x, max_y)); + points.prepend(QPointF(max_x, max_y)); std::stable_sort(points.begin(), points.begin() + sz, sort_fn); @@ -214,7 +214,7 @@ void spline::update_interp_data() } else { - if (points[0].x() > 1e-2) + if (points[0].x() > 1e-2 && points[0].x() <= max_x) points.push_front(QPointF(0, 0)); for (int i = 0; i < sz; i++) -- cgit v1.2.3