Nicolas Winkler 5 年 前
コミット
e1d6e03387
3 ファイル変更3 行追加3 行削除
  1. 1 1
      Almond.cpp
  2. 1 1
      CubicSpline.cpp
  3. 1 1
      libalmond/src/CubicSpline.cpp

+ 1 - 1
Almond.cpp

@@ -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) {

+ 1 - 1
CubicSpline.cpp

@@ -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);

+ 1 - 1
libalmond/src/CubicSpline.cpp

@@ -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);