소스 검색

small error

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