changeset 4873:d68dbe6590ce

fix
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 17 Jan 2022 21:52:04 +0100
parents b1556cefa5c6
children bee6da5155dc
files OrthancFramework/Sources/Images/ImageProcessing.cpp
diffstat 1 files changed, 5 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/OrthancFramework/Sources/Images/ImageProcessing.cpp	Mon Jan 17 21:11:40 2022 +0100
+++ b/OrthancFramework/Sources/Images/ImageProcessing.cpp	Mon Jan 17 21:52:04 2022 +0100
@@ -2095,7 +2095,7 @@
 
         for (size_t i = 1; i < activeEdges.size(); i++)
         {
-          rampEnd = std::max(rampEnd, activeEdges[0].GetUpperY() + 1);
+          rampEnd = std::max(rampEnd, activeEdges[i].GetUpperY() + 1);
         }
       }
       else
@@ -2121,14 +2121,11 @@
         std::sort(activeEdges.begin(), activeEdges.end());
 
         // cf. "fillScan()" in textbook
-        if (y >= 0)
+        for (size_t k = 0; k + 1 < activeEdges.size(); k += 2)
         {
-          for (size_t k = 0; k + 1 < activeEdges.size(); k += 2)
-          {
-            int a = activeEdges[k].GetExitX();
-            int b = activeEdges[k + 1].GetEnterX();          
-            filler.Fill(y, std::min(a, b), std::max(a, b));
-          }
+          int a = activeEdges[k].GetExitX();
+          int b = activeEdges[k + 1].GetEnterX();
+          filler.Fill(y, std::min(a, b), std::max(a, b));
         }
 
         // cf. "updateActiveList()" in textbook