summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2017-02-13 23:00:07 +0100
committerStanislaw Halik <sthalik@misaki.pl>2017-02-13 23:00:07 +0100
commit0289ccf1efee228a8196daae60882f1ec223d8ff (patch)
treec37c8aca279dbc3dfd76e5267af18cee5b039c0e
parentb7909dccf97d8802c7eb1ac5e2a2000bf81c5266 (diff)
spline-widget: linearly interpolate if singular point beyond zoom value exists
-rw-r--r--spline-widget/spline.cpp4
1 files changed, 2 insertions, 2 deletions
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++)