summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2016-07-04 10:36:42 +0200
committerStanislaw Halik <sthalik@misaki.pl>2016-07-04 10:36:42 +0200
commitc63688786b535b775cf34c7ad33b3afd238f04bb (patch)
tree3a10deba2dc5dfe6f452987698ffe029e63c322b
parent1062fc7fac2a6f5e48cdc2e35d16f5e9673108f0 (diff)
spline-widget: sort as defensive coding
-rw-r--r--spline-widget/functionconfig.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/spline-widget/functionconfig.cpp b/spline-widget/functionconfig.cpp
index 915510ca..2ac725f6 100644
--- a/spline-widget/functionconfig.cpp
+++ b/spline-widget/functionconfig.cpp
@@ -226,8 +226,9 @@ void Map::movePoint(int idx, QPointF pt)
if (idx >= 0 && idx < cur.input.size())
{
cur.input[idx] = pt;
+ // we don't allow points to be reordered, but sort due to possible caller logic error
+ std::stable_sort(cur.input.begin(), cur.input.end(), sortFn);
reload();
- // we don't allow points to be reordered, so no sort here
}
}