diff OrthancStone/Sources/Scene2D/AnnotationsSceneLayer.cpp @ 1990:f03a827f8b47

cppcheck
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 31 Oct 2022 21:05:49 +0100
parents a595776232bb
children 1fa3f484008e
line wrap: on
line diff
--- a/OrthancStone/Sources/Scene2D/AnnotationsSceneLayer.cpp	Mon Oct 31 20:59:59 2022 +0100
+++ b/OrthancStone/Sources/Scene2D/AnnotationsSceneLayer.cpp	Mon Oct 31 21:05:49 2022 +0100
@@ -1680,17 +1680,19 @@
       double y1 = handle1_.GetCenter().GetY();
       double x2 = handle2_.GetCenter().GetX();
       double y2 = handle2_.GetCenter().GetY();
-        
-      // Put the label to the right of the right-most handle
-      //const double y = std::min(y1, y2);
-      const double y = (y1 + y2) / 2.0;
-      if (x1 < x2)
+
       {
-        label_.SetPosition(x2, y);
-      }
-      else
-      {
-        label_.SetPosition(x1, y);
+        // Put the label to the right of the right-most handle
+        //const double y = std::min(y1, y2);
+        const double y = (y1 + y2) / 2.0;
+        if (x1 < x2)
+        {
+          label_.SetPosition(x2, y);
+        }
+        else
+        {
+          label_.SetPosition(x1, y);
+        }
       }
 
       std::string text;
@@ -1932,17 +1934,19 @@
       double y1 = handle1_.GetCenter().GetY();
       double x2 = handle2_.GetCenter().GetX();
       double y2 = handle2_.GetCenter().GetY();
-        
-      // Put the label to the right of the right-most handle
-      //const double y = std::min(y1, y2);
-      const double y = (y1 + y2) / 2.0;
-      if (x1 < x2)
+
       {
-        label_.SetPosition(x2, y);
-      }
-      else
-      {
-        label_.SetPosition(x1, y);
+        // Put the label to the right of the right-most handle
+        //const double y = std::min(y1, y2);
+        const double y = (y1 + y2) / 2.0;
+        if (x1 < x2)
+        {
+          label_.SetPosition(x2, y);
+        }
+        else
+        {
+          label_.SetPosition(x1, y);
+        }
       }
 
       std::string text;