@@ -204,7 +204,7 @@ void Almond::gradientEditOk(void)
return { RGBColor{ uint8_t(col.red()), uint8_t(col.green()), uint8_t(col.blue()) },
pos };
});
- std::sort(np.begin(), np.end(), [](auto& a, auto& b) { return a.second > b.second; });
+ std::sort(np.begin(), np.end(), [](auto& a, auto& b) { return a.second < b.second; });
if (!np.empty()) {
auto& first = np.at(0);
if (first.second > 0) {
@@ -44,7 +44,7 @@ float CubicSpline::interpolateAt(float x)
auto& right = *(it + 1);
float xleft = std::get<0>(left);
float xright = std::get<0>(right);
- if (xleft < x && xright >= x) {
+ if (xleft <= x && xright >= x) {
float w = (xright - xleft);
float t = (x - xleft) / w;
float yleft = std::get<1>(left);