From 6cab015fdd1288b581d5741dda8f08fb2b354cfb Mon Sep 17 00:00:00 2001 From: Uwe Date: Fri, 7 Jan 2022 21:28:27 +0100 Subject: [PATCH] [TD] fix another compiler warning about double to float truncation --- src/Mod/TechDraw/Gui/CommandExtensionPack.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Mod/TechDraw/Gui/CommandExtensionPack.cpp b/src/Mod/TechDraw/Gui/CommandExtensionPack.cpp index b1ca436ad5..7db21d891f 100644 --- a/src/Mod/TechDraw/Gui/CommandExtensionPack.cpp +++ b/src/Mod/TechDraw/Gui/CommandExtensionPack.cpp @@ -1697,17 +1697,17 @@ std::vector _getVertexPoints(std::vector SubNames,T return vertexPoints; } -float _getAngle(Base::Vector3d center, Base::Vector3d point){ +float _getAngle(Base::Vector3d center, Base::Vector3d point) { // get angle between x-axis and the vector from center to point - const float Pi180 = 180.0/3.14159; - Base::Vector3d vecCP = point-center; + const auto Pi180 = 180.0 / M_PI; + Base::Vector3d vecCP = point - center; float dy = vecCP.y; float sign = -1.0; if (dy < 0.0) sign = -sign; - float angle = acos(vecCP.Normalize().x)*Pi180*sign; + float angle = acos(vecCP.Normalize().x) * Pi180 * sign; if (angle < 0.0) - angle = 360+angle; + angle = 360 + angle; return angle; }