Mercurial > hg > orthanc-stone
comparison 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 |
comparison
equal
deleted
inserted
replaced
1989:e8b9a2ba1df1 | 1990:f03a827f8b47 |
---|---|
1678 { | 1678 { |
1679 double x1 = handle1_.GetCenter().GetX(); | 1679 double x1 = handle1_.GetCenter().GetX(); |
1680 double y1 = handle1_.GetCenter().GetY(); | 1680 double y1 = handle1_.GetCenter().GetY(); |
1681 double x2 = handle2_.GetCenter().GetX(); | 1681 double x2 = handle2_.GetCenter().GetX(); |
1682 double y2 = handle2_.GetCenter().GetY(); | 1682 double y2 = handle2_.GetCenter().GetY(); |
1683 | 1683 |
1684 // Put the label to the right of the right-most handle | 1684 { |
1685 //const double y = std::min(y1, y2); | 1685 // Put the label to the right of the right-most handle |
1686 const double y = (y1 + y2) / 2.0; | 1686 //const double y = std::min(y1, y2); |
1687 if (x1 < x2) | 1687 const double y = (y1 + y2) / 2.0; |
1688 { | 1688 if (x1 < x2) |
1689 label_.SetPosition(x2, y); | 1689 { |
1690 } | 1690 label_.SetPosition(x2, y); |
1691 else | 1691 } |
1692 { | 1692 else |
1693 label_.SetPosition(x1, y); | 1693 { |
1694 label_.SetPosition(x1, y); | |
1695 } | |
1694 } | 1696 } |
1695 | 1697 |
1696 std::string text; | 1698 std::string text; |
1697 | 1699 |
1698 char buf[32]; | 1700 char buf[32]; |
1930 { | 1932 { |
1931 double x1 = handle1_.GetCenter().GetX(); | 1933 double x1 = handle1_.GetCenter().GetX(); |
1932 double y1 = handle1_.GetCenter().GetY(); | 1934 double y1 = handle1_.GetCenter().GetY(); |
1933 double x2 = handle2_.GetCenter().GetX(); | 1935 double x2 = handle2_.GetCenter().GetX(); |
1934 double y2 = handle2_.GetCenter().GetY(); | 1936 double y2 = handle2_.GetCenter().GetY(); |
1935 | 1937 |
1936 // Put the label to the right of the right-most handle | 1938 { |
1937 //const double y = std::min(y1, y2); | 1939 // Put the label to the right of the right-most handle |
1938 const double y = (y1 + y2) / 2.0; | 1940 //const double y = std::min(y1, y2); |
1939 if (x1 < x2) | 1941 const double y = (y1 + y2) / 2.0; |
1940 { | 1942 if (x1 < x2) |
1941 label_.SetPosition(x2, y); | 1943 { |
1942 } | 1944 label_.SetPosition(x2, y); |
1943 else | 1945 } |
1944 { | 1946 else |
1945 label_.SetPosition(x1, y); | 1947 { |
1948 label_.SetPosition(x1, y); | |
1949 } | |
1946 } | 1950 } |
1947 | 1951 |
1948 std::string text; | 1952 std::string text; |
1949 | 1953 |
1950 char buf[32]; | 1954 char buf[32]; |